:root {
    /* Color Palette - Premium Corporate Blue/Indigo */
    --primary: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF; /* Indigo 50 */
    
    --success: #10B981; /* Emerald 500 */
    
    --bg-main: #F3F4F6; /* Gray 100 */
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F9FAFB;
    
    --text-main: #111827; /* Gray 900 */
    --text-sec: #6B7280; /* Gray 500 */
    --text-light: #9CA3AF;
    
    --border-color: #E5E7EB;
    
    /* Variables */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-fully: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    --transition-fast: 0.15s ease;
    --transition-norm: 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5 { font-weight: 700; color: var(--text-main); }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.highlight {
    color: var(--primary);
}

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-item {
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-sec);
    padding: 8px 16px;
    border-radius: var(--radius- fully);
    cursor: pointer;
    transition: var(--transition-norm);
}

.nav-item:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
}

.bookmarks-nav {
    position: relative;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF4444; /* red-500 */
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid white;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-norm);
    border: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-surface-hover);
    border-color: #D1D5DB;
}

.btn-back {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-full);
    padding: 8px 16px;
}
.btn-back:hover {
    background: var(--bg-surface-hover);
}

/* Layout */
.app-content {
    min-height: calc(100vh - 80px);
}

.layout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    gap: 32px;
}

.layout-container.center-feed {
    justify-content: center;
}

.layout-container.single-page {
    flex-direction: column;
}

.sidebar-filters {
    width: 280px;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 100px;
}

.feed-section {
    flex-grow: 1;
    min-width: 0;
}

.full-width {
    width: 100%;
}

/* Heroes */
.search-hero, .companies-hero {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--primary-light) 100%);
    padding: 60px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-title {
    font-size: 36px;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-sec);
    max-width: 600px;
    margin: 0 auto;
}

.search-bar {
    max-width: 800px;
    margin: 32px auto 0;
    display: flex;
    gap: 16px;
    background: white;
    padding: 8px;
    border-radius: 9999px;
    box-shadow: var(--shadow-glass);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.search-input-group {
    flex-grow: 1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--bg-surface);
}

.search-icon {
    color: var(--text-light);
    margin-right: 12px;
}

.search-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-main);
    background: transparent;
}

.search-input::placeholder {
    color: var(--text-light);
}

.btn-search {
    background: var(--primary);
    color: white;
    border-radius: 9999px;
    padding: 12px 32px;
}

/* Filters */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.btn-clear-filters {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-clear-filters:hover {
    color: var(--primary);
}

.filter-group {
    margin-bottom: 28px;
}

.filter-title {
    font-size: 15px;
    margin-bottom: 12px;
}

.filter-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-item, .checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-sec);
    cursor: pointer;
}

.radio-item:hover, .checkbox-item:hover {
    color: var(--text-main);
}

input[type="radio"], input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Feed Headers */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.feed-title {
    font-size: 20px;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-sec);
}

.sort-select {
    border: none;
    background: transparent;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary);
    cursor: pointer;
    outline: none;
}

/* Cards (Vacancies) Grid */
.vacancies-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 24px;
}

.p-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: var(--transition-norm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.02);
}

.p-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.p-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    position: relative;
}

.p-logo-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: white;
}

.p-company-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.p-header-text {
    flex-grow: 1;
    margin-left: 12px;
    padding-right: 60px; /* space for date */
}

.p-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.p-company-name {
    font-size: 14px;
    color: var(--text-sec);
}

.p-date-top {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 12px;
    color: var(--text-light);
}

.p-top-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.p-tag-status {
    background: #FFF7ED; /* orange-50 */
    color: #C2410C; /* orange-700 */
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.p-tag-green {
    background: #ECFDF5; /* emerald-50 */
    color: #047857; /* emerald-700 */
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.p-grey-box {
    background: #F9FAFB;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.p-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-sec);
}

.p-info-row .p-icon {
    font-size: 18px;
    color: var(--text-light);
}

.p-skill-tags {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.p-tag-white {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-sec);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.p-card-footer {
    display: flex;
    gap: 12px;
    align-items: center;
}

.p-btn-bookmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-sec);
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.p-btn-bookmark:hover {
    background: var(--bg-surface-hover);
    color: var(--primary);
}

.p-btn-bookmark.bookmarked {
    color: var(--primary);
    border-color: var(--primary-light);
    background: var(--primary-light);
}

.p-btn-apply {
    flex-grow: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.p-btn-apply:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

/* Companies Grid */
.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.company-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-norm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.company-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.c-logo-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.c-name {
    font-size: 18px;
    margin-bottom: 8px;
}

.c-vacancies-count {
    color: var(--success);
    font-weight: 600;
    font-size: 14px;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 12px;
    border-radius: var(--radius-fully);
}

/* Detailed Views */
.detail-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.detail-header {
    margin-bottom: 32px;
}

.detail-title {
    font-size: 32px;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.detail-salary {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
}

.detail-reqs {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
    background: var(--bg-main);
    padding: 20px;
    border-radius: var(--radius-md);
}

.req-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.req-label {
    font-size: 13px;
    color: var(--text-sec);
}

.req-val {
    font-size: 15px;
    font-weight: 600;
}

.detail-body {
    font-size: 16px;
    color: var(--text-sec);
    line-height: 1.7;
    margin-bottom: 40px;
}

.detail-body h3, .detail-body h4 {
    color: var(--text-main);
    margin: 24px 0 12px;
}

.detail-body ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.detail-body li {
    margin-bottom: 8px;
}

.company-card-huge {
    display: flex;
    align-items: center;
    gap: 32px;
}

.c-logo-huge {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    object-fit: contain;
    border: 1px solid var(--border-color);
    padding: 8px;
}

.c-huge-info h1 {
    font-size: 32px;
    margin-bottom: 12px;
}

.c-huge-info p {
    font-size: 16px;
    color: var(--text-sec);
    line-height: 1.6;
}

/* Utils */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-sec);
}

.empty-state .material-symbols-outlined {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}


/* Mobile Sidebar */
.mobile-menu-btn {
    display: none !important;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    margin-right: 12px;
    padding: 0;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn .material-symbols-outlined {
    font-size: 28px;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
        padding: 20px 16px;
    }
    
    .main-nav {
        display: none !important;
    }
    .header-actions {
        display: none !important;
    }
    .mobile-main-nav {
        display: block !important;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 24px;
    }
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .sidebar-filters {
        position: fixed;
        top: 0;
        left: -100%;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        background: white;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .sidebar-filters.open {
        left: 0;
    }
    
    .search-hero, .companies-hero {
        padding: 40px 16px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .search-bar {
        flex-direction: column;
        border-radius: var(--radius-md);
        background: transparent;
        box-shadow: none;
        border: none;
        gap: 12px;
    }
    
    .search-input-group {
        border-radius: var(--radius-md);
        padding: 12px 16px;
        box-shadow: var(--shadow-sm);
    }
    
    .btn-search {
        border-radius: var(--radius-md);
    }

    .company-card-huge {
        flex-direction: column;
        text-align: center;
    }
}

/* Autocomplete updates */
.small-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    box-shadow: none;
    background: white;
}
.small-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.autocomplete-group {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    list-style: none;
    margin-top: 4px;
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--bg-surface-hover);
    color: var(--primary);
}

.region-context {
    font-size: 12px;
    color: var(--text-light);
    display: block;
    margin-top: 2px;
}

.role-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s;
}
.role-tab:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.role-tab.active {
    background: #eff6ff;
    color: var(--primary);
    border-color: var(--primary);
}
.role-count {
    font-size: 13px;
    color: #94a3b8;
}
.role-tab.active .role-count {
    color: var(--primary);
}

.pagination {
    grid-column: 1 / -1;
}


/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    padding: 8px 10px 12px 10px;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    flex: 1;
    position: relative;
    transition: all 0.2s ease;
}

.bottom-nav-item img {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.2s ease;
}

.bottom-nav-item.active {
    color: #4f46e5;
}

.bottom-nav-item.active img {
    filter: none;
}

/* Specific Badge styling for mobile nav */
#mobile-bookmark-badge {
    position: absolute;
    top: -5px;
    right: 15px;
    font-size: 10px;
    padding: 2px 6px;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    body {
        padding-bottom: 70px; /* Make room for bottom nav */
    }

    /* Hide the old hamburger menu */
    .mobile-menu-btn {
        display: none !important;
    }

    /* Hide the mobile main nav in sidebar since we have bottom nav now */
    .sidebar-filters .mobile-main-nav {
        display: none !important;
    }
}
@media (max-width: 768px) { .app-footer { display: none !important; } }
