/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.1);

    /* Dark Mode Variables */
    --dark-bg: #111827;
    --dark-surface: #1f2937;
    --dark-border: #374151;
    --dark-text-primary: #f9fafb;
    --dark-text-secondary: #9ca3af;
    --dark-glass-bg: rgba(31, 41, 55, 0.25);
    --dark-glass-border: rgba(55, 65, 81, 0.5);
    --dark-shadow-light: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" width="60" height="60"><defs><pattern id="dotPattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23f1f5f9" opacity="0.5"/></pattern></defs><rect width="100%" height="100%" fill="url(%23dotPattern)"/></svg>') repeat;
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating particles animation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: #000000;
    color: white;
    padding: 0.75rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
}

.header::before {
    content: '';
    display: none;
}

.header::after {
    content: '';
    display: none;
}

@keyframes headerGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-30%, -30%) scale(1.1); }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-toggle {
    display: none;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: rgba(255,255,255,0.28);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.user-preferences {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.role-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-label {
    font-size: 0.9rem;
}

#role-select {
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: #111827;
    color: #f9fafb;
    cursor: pointer;
}

.theme-toggle-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.22);
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Search and Filters */
.search-filters {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.search-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

#search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters select {
    padding: 0.6rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filters select:focus {
    outline: none;
    border-color: #667eea;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.filter-checkbox:hover {
    background-color: #f1f5f9;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Jobs Grid */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Better responsive grid for tablets */
@media (max-width: 1024px) {
    .jobs-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

.job-card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.8rem;
    box-shadow: var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    z-index: -1;
    transition: opacity 0.4s ease;
}

.job-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, 
        transparent, 
        rgba(102, 126, 234, 0.1), 
        transparent, 
        rgba(118, 75, 162, 0.1), 
        transparent);
    animation: cardRotate 6s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -2;
}

@keyframes cardRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.job-card:hover {
    transform: translateY(-8px) rotateX(5deg) rotateY(-5deg);
    box-shadow: 
        var(--shadow-heavy),
        0 25px 50px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.job-card:hover::before {
    opacity: 0.8;
}

.job-card:hover::after {
    opacity: 1;
}

.job-card:active {
    transform: translateY(-6px) rotateX(2deg) rotateY(-2deg);
    transition: all 0.1s ease;
}

.job-card .save-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
    padding: 0.5rem;
}
.job-card .save-btn:hover {
    transform: scale(1.2);
}
.job-card .save-btn.saved {
    color: #667eea;
}

.job-header {
    margin-bottom: 1rem;
}

.job-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 0.3rem;
}

.job-company {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.job-location {
    color: #718096;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.job-tag {
    background: #e2e8f0;
    color: #2d3748;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.job-tag.remote {
    background: #c6f6d5;
    color: #22543d;
}

.job-tag.salary {
    background: #fed7d7;
    color: #742a2a;
}

.job-description {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: #2d3748;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-danger {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(245, 101, 101, 0.4);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Pulse animation for primary buttons */
.btn-primary {
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.5), 0 0 20px rgba(102, 126, 234, 0.2);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-btn {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #718096;
    cursor: pointer;
    z-index: 1001;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.close-btn:hover {
    color: #2d3748;
    background: #f7fafc;
}

.modal-body {
    padding: 2rem;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-location {
    color: #718096;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.qualifications-list {
    list-style: none;
    padding: 0;
}

.qualifications-list li {
    padding: 0.3rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.qualifications-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: bold;
}

.modal-footer-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.save-toggle-btn.saved {
    background: #e9eafc;
    color: #667eea;
    border: 1px solid #c3c8f5;
}

/* Forms */
.job-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    max-width: 800px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Applications List */
.applications-list,
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.application-item,
.manage-job-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
}

/* Status Badges */
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-transform: capitalize;
}
.status-pending { background: #a0aec0; }
.status-reviewed { background: #4299e1; }
.status-interviewing { background: #ed8936; }
.status-hired { background: #48bb78; }
.status-rejected { background: #f56565; }

/* Applicant item in modal */
.applicant-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fdfdff;
}
.applicant-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.applicant-item-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #2d3748;
}
.applicant-item-header span {
    font-size: 0.8rem;
    color: #718096;
}
.applicant-item p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.applicant-item a {
    color: #667eea;
    text-decoration: none;
}
.applicant-item a:hover {
    text-decoration: underline;
}
.applicant-item details {
    font-size: 0.9rem;
}
.applicant-item details summary {
    cursor: pointer;
    font-weight: 600;
    color: #4a5568;
}
.applicant-item details p {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 4px;
    border-left: 3px solid #e2e8f0;
}
.applicant-item-footer {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.applicant-status-select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #2d3748;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.pagination-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.pagination-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.3);
}

.pagination-btn:disabled {
    background: #f1f5f9;
    color: #a0aec0;
    cursor: not-allowed;
}

.view-description {
    color: #718096;
    margin-bottom: 1.5rem;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Dark Mode Styles */
body.dark-mode {
    background: var(--dark-bg);
    color: var(--dark-text-secondary);
}

body.dark-mode::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" width="60" height="60"><defs><pattern id="dotPattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23374151" opacity="0.3"/></pattern></defs><rect width="100%" height="100%" fill="url(%23dotPattern)"/></svg>') repeat;
}

/* Search and Filters */
body.dark-mode .search-filters {
    background: var(--dark-glass-bg);
    border: 1px solid var(--dark-glass-border);
    box-shadow: var(--dark-shadow-light);
}

body.dark-mode .search-filters::before {
    background: rgba(31, 41, 55, 0.1);
}

body.dark-mode #search-input,
body.dark-mode .filters select {
    background: var(--dark-surface);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

body.dark-mode #search-input:focus,
body.dark-mode .filters select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

body.dark-mode .search-bar i {
    color: var(--dark-text-secondary);
}

body.dark-mode .filter-checkbox {
    color: var(--dark-text-primary);
}

body.dark-mode .filter-checkbox:hover {
    background-color: #374151;
}

/* Job Card */
body.dark-mode .job-card {
    background: var(--dark-glass-bg);
    border: 1px solid var(--dark-glass-border);
    box-shadow: var(--dark-shadow-light);
}

body.dark-mode .job-card .job-title {
    color: var(--dark-text-primary);
}

body.dark-mode .job-card .job-description {
    color: var(--dark-text-secondary);
}

body.dark-mode .job-card .job-tag {
    background: #374151;
    color: #d1d5db;
}

body.dark-mode .job-card .job-tag.remote {
    background: #064e3b;
    color: #a7f3d0;
}

body.dark-mode .job-card .job-tag.salary {
    background: #7f1d1d;
    color: #fecaca;
}

body.dark-mode .job-card .save-btn {
    color: #6b7280;
}

body.dark-mode .job-card .save-btn.saved {
    color: #818cf8;
}

/* Buttons */
body.dark-mode .btn-secondary {
    background: var(--dark-glass-bg);
    border: 1px solid var(--dark-glass-border);
    color: var(--dark-text-primary);
}

body.dark-mode .btn-secondary:hover {
    background: rgba(55, 65, 81, 0.7);
}

/* Modal */
body.dark-mode .modal-content {
    background: var(--dark-surface);
}

body.dark-mode .close-btn {
    color: var(--dark-text-secondary);
    background: var(--dark-surface);
}

body.dark-mode .close-btn:hover {
    color: var(--dark-text-primary);
    background: #374151;
}

body.dark-mode .modal-title,
body.dark-mode .modal-section h4,
body.dark-mode #saved-jobs-view h2 {
    color: var(--dark-text-primary);
}

body.dark-mode .modal-location,
body.dark-mode .view-description {
    color: var(--dark-text-secondary);
}

body.dark-mode .save-toggle-btn.saved {
    background: #3730a3;
    color: #e0e7ff;
    border: 1px solid #4338ca;
}

/* Forms */
body.dark-mode .job-form {
    background: var(--dark-surface);
}

body.dark-mode .form-group label {
    color: var(--dark-text-primary);
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: var(--dark-bg);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Lists */
body.dark-mode .application-item,
body.dark-mode .manage-job-item {
    background: var(--dark-surface);
    border-left-color: #818cf8;
}

body.dark-mode .application-info h3,
body.dark-mode .manage-job-info h3 {
    color: var(--dark-text-primary);
}

body.dark-mode .application-info p,
body.dark-mode .manage-job-info p,
body.dark-mode .application-date,
body.dark-mode .manage-job-date {
    color: var(--dark-text-secondary);
}

/* Applicant Item */
body.dark-mode .applicant-item {
    background: var(--dark-bg);
    border-color: var(--dark-border);
}

body.dark-mode .applicant-item-header h5 {
    color: var(--dark-text-primary);
}

body.dark-mode .applicant-item-header span:not(.status-badge) {
    color: var(--dark-text-secondary);
}

body.dark-mode .applicant-item details summary {
    color: var(--dark-text-secondary);
}

body.dark-mode .applicant-item details p {
    background: #111827;
    border-left-color: var(--dark-border);
}

body.dark-mode .applicant-status-select {
    background: var(--dark-surface);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

/* Pagination */
body.dark-mode .pagination-btn {
    background: var(--dark-surface);
    border-color: var(--dark-border);
    color: var(--dark-text-primary);
}

body.dark-mode .pagination-btn:hover:not(:disabled) {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode .pagination-btn:disabled {
    background: #1f2937;
    color: #4b5563;
}

/* Empty State */
body.dark-mode .empty-state {
    color: var(--dark-text-secondary);
}

body.dark-mode .empty-state h3 {
    color: var(--dark-text-primary);
}

#saved-jobs-view h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.application-header,
.manage-job-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.application-info h3,
.manage-job-info h3 {
    color: #2d3748;
    margin-bottom: 0.3rem;
}

.application-info p,
.manage-job-info p {
    color: #718096;
    font-size: 0.9rem;
}

.application-status {
    margin-top: 1rem;
}

.application-date,
.manage-job-date {
    color: #718096;
    font-size: 0.8rem;
}

/* Loading Spinner */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.loading.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #2d3748;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        row-gap: 0.75rem;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: rgba(255,255,255,0.12);
        border: 1px solid rgba(255,255,255,0.15);
        color: #fff;
        padding: 0.45rem 0.75rem;
        border-radius: 8px;
        cursor: pointer;
        width: max-content;
    }

    .nav {
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        order: 99; /* Ensure nav appears after logo/toggle */
    }

    .nav.open {
        display: flex;
    }

    .nav-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .jobs-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters > * {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .application-header,
    .manage-job-header {
        flex-direction: column;
        gap: 1rem;
    }

    .user-preferences {
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        order: 100; /* Ensure preferences appear last */
    }
}
@media (max-width: 480px) {
    .main {
        padding: 1rem 0;
    }
    
    .search-filters,
    .job-form,
    .modal-body {
        padding: 1rem;
    }
    
    .job-card {
        padding: 1rem;
    }
    
    .job-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .job-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    /* Ensure buttons are always visible and properly sized */
    .btn-small {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch-friendly minimum height */
    }
    
    /* Better spacing for mobile */
    .job-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .job-tag {
        margin-bottom: 0.25rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.hidden {
    display: none !important;
}
