/* --- SINGLE-PAGE NAVIGATION SYSTEM --- */
.page {
    display: none;
    padding-top: 128px; /* default pages: top bar + header */
    animation: pageFadeIn 0.5s ease-in-out;
}
.page.active {
    display: block;
}
/* Dashboard pages have no site header/topbar */
.dashboard-page { padding-top: 0; }
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 128px);
    background-color: #f8f9fa;
}

.dashboard-sidebar {
    width: 280px;
    background-color: var(--white);
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    position: fixed;
    top: 0; /* no header in dashboard pages */
    bottom: 0;  /* stretch to full viewport height */
    overflow-y: auto;
    border-right: 1px solid #eee;
    transition: transform 0.3s ease;
}

/* Sidebar scrollbar styling */
.dashboard-sidebar::-webkit-scrollbar {
    width: 10px;
}
.dashboard-sidebar::-webkit-scrollbar-track {
    background: #fafafa;
}
.dashboard-sidebar::-webkit-scrollbar-thumb {
    background-color: #d9d9d9;
    border-radius: 8px;
    border: 2px solid #fafafa;
}
.dashboard-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #c5c5c5;
}
/* Firefox */
.dashboard-sidebar { scrollbar-width: thin; scrollbar-color: #c5c5c5 #fafafa; }

.dashboard-main {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    min-height: calc(100vh - 128px);
    /* Let the page/body handle scrolling to keep sidebar alignment */
    overflow: visible;
}

/* Collapsed sidebar mode */
.sidebar-collapsed .dashboard-sidebar {
    width: 80px;
}
.sidebar-collapsed .dashboard-main {
    margin-left: 80px;
}
.sidebar-collapsed .sidebar-header .logo { font-size: 0; }
.sidebar-collapsed .sidebar-header .logo i { margin-right: 0; }
.sidebar-collapsed .sidebar-user-info { justify-content: center; }
.sidebar-collapsed .sidebar-user-info .user-details { display: none; }
.sidebar-collapsed .nav-item { font-size: 0; text-align: center; }
.sidebar-collapsed .nav-item i { margin-right: 0; }
/* In collapsed mode, hide subitems for clarity */
.sidebar-collapsed .nav-subitems { display: none; }

.dashboard-header {
    background-color: var(--white);
    padding: 20px 30px;
    margin: -30px -30px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.dashboard-title {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.dashboard-subtitle {
    color: #666;
    font-size: 1rem;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 1.2rem;
}

.user-details h4 {
    margin-bottom: 5px;
    color: var(--dark-color);
}

.user-details p {
    font-size: 0.9rem;
    color: #666;
}

.sidebar-nav {
    padding: 20px 0 80px; /* leave space for sticky footer */
    display: flex;
    flex-direction: column;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    padding: 0 20px 10px;
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(0, 150, 136, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

/* Small badge for nav items */
.nav-item .nav-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.4;
    background: var(--accent-color);
    color: #fff;
    border-radius: 999px;
}

/* Subitems under a parent nav item */
.nav-parent { }
.nav-subitems { padding-left: 28px; }
.nav-subitem { padding: 10px 20px; }

.nav-subitem i { width: 18px; margin-right: 10px; }

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.stat-icon.primary { background-color: var(--primary-color); }
.stat-icon.success { background-color: var(--success-color); }
.stat-icon.warning { background-color: var(--warning-color); }
.stat-icon.info { background-color: var(--info-color); }

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.dashboard-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.3rem;
    color: var(--dark-color);
    margin: 0;
}

.card-content {
    padding: 25px;
}

.table-container {
    overflow-x: auto;
}

/* Generic table styles for non-dashboard tables */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.table th, .table td { padding: 12px 14px; border-bottom:1px solid #eee; text-align: left; }
.table thead th { background:#f8f9fa; font-weight:600; color: var(--dark-color); position: sticky; top: 0; z-index: 1; }
.table tbody tr:hover { background: rgba(0, 150, 136, 0.05); }

/* Sticky headers for dashboard tables */
.dashboard-table thead th { position: sticky; top: 0; z-index: 1; }

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.dashboard-table th,
.dashboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.dashboard-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
}

.dashboard-table tbody tr:hover {
    background-color: rgba(0, 150, 136, 0.05);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 140px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: var(--box-shadow);
}

/* Sidebar footer (sticky logout) */
.sidebar-footer {
    position: sticky;
    bottom: 0;
    background: var(--white);
    border-top: 1px solid #eee;
    padding: 12px 20px;
}

/* Admin Users table alignment */
.admin-users-table th.actions,
.admin-users-table td.actions {
    text-align: right;
    white-space: nowrap;
}
.admin-users-table th.role,
.admin-users-table td.role { width: 220px; }
.admin-users-table th.status,
.admin-users-table td.status { width: 140px; }
.admin-users-table th.email,
.admin-users-table td.email { width: 260px; }
.admin-users-table .role-editor {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-users-table .role-editor .form-input,
.admin-users-table .role-editor .btn {
    height: 40px;
}

/* Sticky bulk action bar */
.bulk-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px 0;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

/* Compact top control bar */
.admin-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.admin-controls form { display:flex; gap:8px; align-items:center; }

@media (max-width: 992px) {
    .dashboard-sidebar { top: 0; }
    .dashboard-main { margin-left: 0; }
}

/* --- HEADER & NAVIGATION --- */

/* Simple grid helpers used in jobs pages */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-span-2 { grid-column: span 2; }

/* Cards container used in jobs listing */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.header { 
    background-color: var(--white); 
    position: fixed; 
    width: 100%; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    transition: all 0.3s ease, transform 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-with-topbar {
    top: 48px; /* Height of top bar with increased padding */
}
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 80px; 
}
.logo { 
    font-size: 1.8rem; 
    font-weight: 700; 
    color: var(--primary-color); 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    cursor: pointer; 
}
.logo i { 
    margin-right: 8px; 
    color: var(--accent-color); 
}
.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 30px; 
}
.nav-links a { 
    text-decoration: none; 
    color: var(--text-color); 
    font-weight: 500; 
    position: relative; 
    padding: 5px 0; 
    cursor: pointer; 
}
.nav-links a::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 0; 
    height: 2px; 
    background-color: var(--accent-color); 
    transition: width 0.3s ease; 
}
.nav-links a:hover::after, .nav-links a.active::after { 
    width: 100%; 
}
.nav-actions { 
    display: flex; 
    gap: 15px; 
}
.mobile-menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: var(--light-gray);
}

.mobile-menu-toggle i {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

/* --- HERO SECTION (HOME PAGE) --- */
.hero { 
    position: relative; 
    padding: 140px 0 100px 0; 
    text-align: center; 
    overflow: hidden; 
    background-color: #f8f9fa; 
}
.hero-bg { 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-image: linear-gradient(to right, var(--primary-color) 0%, var(--accent-color) 100%); 
    opacity: 0.1; 
    transform: skewY(-4deg); 
    transform-origin: top left; 
}
.hero-content { 
    position: relative; 
    z-index: 2; 
}
.hero-title { 
    font-size: 4rem; 
    font-weight: 700; 
    color: var(--dark-color); 
    line-height: 1.2; 
}
.hero-subtitle { 
    font-size: 1.25rem; 
    max-width: 700px; 
    margin: 20px auto 40px; 
    color: #555; 
}
.hero-cta { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 20px; 
}
.learn-more-link { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: var(--primary-color); 
    text-decoration: none; 
    font-weight: 600; 
    transition: gap 0.3s ease; 
    cursor: pointer; 
}
.learn-more-link:hover { 
    gap: 12px; 
    text-decoration: underline; 
}
.icon-small { 
    width: 20px; 
    height: 20px; 
}

/* --- LISTING PAGES (HIRE, SHOP, FIND) --- */
.filter-bar { 
    background-color: var(--white); 
    padding: 20px; 
    border-radius: var(--border-radius); 
    box-shadow: var(--box-shadow); 
    margin-bottom: 40px; 
    display: flex; 
    gap: 15px; 
    flex-wrap: wrap; 
}
.filter-group { 
    flex: 1; 
    min-width: 200px; 
}
.filter-group input, .filter-group select { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ccc; 
    border-radius: var(--border-radius); 
    font-family: var(--font-family); 
}
.results-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 30px; 
}

/* --- HOW IT WORKS PAGE --- */
.steps-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 60px; 
}
.step { 
    text-align: left; 
    flex: 1; 
    width: 100%; 
    max-width: none; 
}
.step-icon { 
    width: 70px; 
    height: 70px; 
    border: 2px solid var(--secondary-color); 
    border-radius: 50%; 
    margin: 0 auto 20px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}
.step-icon i { 
    width: 32px; 
    height: 32px; 
    color: var(--primary-color); 
}
.step h4 { 
    font-size: 1.3rem; 
    margin-bottom: 10px; 
    color: var(--dark-color); 
}
.step-arrow { 
    flex-shrink: 0; 
    align-self: center; 
    margin: 0 20px; 
    margin-top: -50px; 
}
.step-arrow i { 
    color: var(--secondary-color); 
    width: 32px; 
    height: 32px; 
}
.faq-section { 
    max-width: 800px; 
    margin: 0 auto; 
}
.faq-item { 
    border-bottom: 1px solid #eee; 
    padding: 20px 0; 
}
.faq-item h3 { 
    font-size: 1.2rem; 
    color: var(--dark-color); 
}

/* --- AUTH PAGES (LOGIN, JOIN) --- */
.auth-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 60px 0; 
}
.auth-card { 
    background: var(--white); 
    padding: 40px; 
    border-radius: var(--border-radius); 
    box-shadow: var(--box-shadow); 
    width: 100%; 
    max-width: 800px; 
    text-align: left; 
    box-sizing: border-box;
}
.auth-card h1 { 
    font-size: 2rem; 
    color: var(--dark-color); 
    margin-bottom: 30px; 
}
.form-group { 
    margin-bottom: 20px; 
    text-align: left; 
    width: 100%;
    box-sizing: border-box;
}
.form-group label { 
    display: block; 
    font-weight: 500; 
    margin-bottom: 5px; 
}
.form-input { 
    width: 100% !important; 
    padding: 12px 14px; 
    border: 1px solid #e5e7eb; 
    border-radius: 8px; 
    font-size: 1rem; 
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: block;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-input[required] {
    border-left: 3px solid #dc2626;
}
.auth-card .btn { 
    width: 100%; 
    margin-top: 10px; 
}
.auth-link { 
    margin-top: 20px; 
}
.auth-link a { 
    color: var(--primary-color); 
    text-decoration: none; 
    font-weight: 500; 
}
.auth-link a:hover { 
    text-decoration: underline; 
}

/* --- FOOTER --- */
.footer { 
    background-color: #263238; 
    color: #cfd8dc; 
    padding: 60px 0 20px; 
}
.footer-grid { 
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr 1fr; 
    gap: 40px; 
}
.footer .logo { 
    color: var(--white); 
}
.footer-col p { 
    margin-top: 15px; 
}
.footer-col h4 { 
    color: var(--white); 
    font-size: 1.1rem; 
    margin-bottom: 15px; 
}
.footer-col ul { 
    list-style: none; 
}
.footer-col ul li { 
    margin-bottom: 10px; 
}
.footer-col ul a { 
    color: #cfd8dc; 
    text-decoration: none; 
    transition: color 0.3s ease; 
    cursor: pointer; 
}
.footer-col ul a:hover { 
    color: var(--accent-color); 
}
.social-links { 
    margin-top: 20px; 
    display: flex; 
    gap: 15px; 
}
.social-links a { 
    color: #cfd8dc; 
    transition: color 0.3s ease; 
}
.social-links a:hover { 
    color: var(--accent-color); 
}
.footer-bottom { 
    text-align: center; 
    padding-top: 20px; 
    border-top: 1px solid #455a64; 
    font-size: 0.9rem; 
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        z-index: 1002;
    }
    
    .dashboard-sidebar.mobile-active {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .stat-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .nav-links { 
        position: fixed;
        top: 128px; /* Top bar + header height */
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .nav-links.mobile-active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links li {
        margin: 10px 0;
    }
    
    .nav-links a {
        display: block;
        padding: 12px 0;
        font-size: 1.1rem;
    }
    
    .nav-actions .btn-secondary { 
        display: none; 
    }
    .mobile-menu-toggle { 
        display: block; 
    }
    .steps-container { 
        flex-direction: column; 
        align-items: center; 
    }
    .step { 
        margin-bottom: 30px; 
    }
    .step-arrow { 
        transform: rotate(90deg); 
        margin: -10px 0 10px 0; 
    }
    .footer-grid { 
        grid-template-columns: 1fr 1fr; 
    }
    .hero-title { 
        font-size: 3.2rem; 
    }
    
    .header-with-topbar {
        top: 68px; /* Adjusted for mobile top bar height (10px padding * 2 + content) */
    }
    
    .page {
        padding-top: 148px; /* Adjusted for mobile: top bar (68px) + header (80px) */
    }
    
    .nav-links {
        top: 148px; /* Adjusted for mobile */
    }
}

@media (max-width: 576px) {
    .dashboard-main {
        padding: 20px 15px;
    }
    
    .dashboard-header {
        padding: 15px 20px;
        margin: -20px -15px 20px;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sidebar-user-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .hero-title { 
        font-size: 2.8rem; 
    }
    .hero-cta { 
        flex-direction: column; 
    }
    .footer-grid { 
        grid-template-columns: 1fr; 
    }
    .filter-bar { 
        flex-direction: column; 
    }
    
    .header-with-topbar {
        top: 76px; /* Adjusted for small mobile top bar height (8px padding * 2 + content) */
    }
    
    .page {
        padding-top: 156px; /* Adjusted for small mobile: top bar (76px) + header (80px) */
    }
    
    .nav-links {
        top: 156px; /* Adjusted for small mobile */
    }
} 
/* Main content scrollbar styling */
.dashboard-main::-webkit-scrollbar { height: 10px; width: 10px; }
.dashboard-main::-webkit-scrollbar-track { background: #fafafa; }
.dashboard-main::-webkit-scrollbar-thumb { background-color: #d9d9d9; border-radius: 8px; border: 2px solid #fafafa; }
.dashboard-main::-webkit-scrollbar-thumb:hover { background-color: #c5c5c5; }
.dashboard-main { scrollbar-width: thin; scrollbar-color: #c5c5c5 #fafafa; }
