/* Modern Orange Job Portal Styles - SearchJob Platform */
/* Inspired by Fiverr, Upwork, Work.ua */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* SearchJob Brand Colors */
    --primary-orange: #eaa850;
    --primary-dark: #d4922a;
    --primary-light: #f4c272; /* Used for dark theme orange accents */
    --primary-color: #eaa850;
    --primary-hover: #d4922a;
    --secondary-color: #f97316;
    --accent-color: #fb923c;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Text Colors */
    --text-primary: #2c3e50; /* MODIFIED from #1e293b */
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    /* Background Colors */
    --background-primary: #ffffff; /* Default body bg for light theme */
    --background-secondary: #f8fafc; /* For sections in light theme */
    --background-light: #f1f5f9;
    
    /* Border Colors */
    --border-color: #e2e8f0; /* Light theme default border */
    --border-light: #f1f5f9;
    --border-dark: #334155; /* Original dark border */

    /* Shadow Definitions */
    --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-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* NEW Dark Theme Variables */
    --dark-bg-primary: #1e293b; /* Body background */
    --dark-bg-secondary: #161e2b; /* Section backgrounds */
    --dark-text-primary: #e2e8f0; /* Primary text */
    --dark-text-secondary: #cbd5e1; /* Secondary text */
    --dark-border-color: #4a5568; /* Default border in dark theme */
    --dark-card-bg: #2c3e50; /* Card/input backgrounds */
    --dark-nav-bg: rgba(30, 41, 59, 0.95); /* Navbar background */
    --dark-theme-toggle-border: #4a5568;
    --dark-theme-nav-link-hover-bg: rgba(244, 194, 114, 0.1); /* Uses --primary-light for color part */

    /* NEW Variable for nav link hover */
    --primary-orange-hover-bg: rgba(234, 168, 80, 0.1);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-primary); /* MODIFIED from --background-secondary */
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative; /* ADDED */
}

/* NEW Dark theme base for body */
body.dark-theme {
    background-color: var(--dark-bg-primary);
    color: var(--dark-text-primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Modern Card Component */
.card {
    background: var(--background-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.card-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Modern Form Components */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Form Input Components */
.form-input,
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"],
input[type="tel"],
textarea, 
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition-normal);
    background: var(--background-primary);
    color: var(--text-primary);
    font-family: inherit;
}

.form-input:focus,
input:focus, 
textarea:focus, 
select:focus {
    outline: none;
    border-color: var(--primary-orange); /* MODIFIED from --ukraine-blue */
    background: var(--background-primary);
    box-shadow: 0 0 0 3px rgba(234, 168, 80, 0.1); /* MODIFIED to orange theme */
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-light);
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

/* Modern Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--ukraine-blue);
    color: var(--text-white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-white);
}

.btn-secondary:hover:not(:disabled) {
    background: #5855eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-white);
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--ukraine-blue);
    border: 2px solid var(--ukraine-blue);
}

.btn-outline:hover:not(:disabled) {
    background: var(--ukraine-blue);
    color: var(--text-white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Modern Navigation - Assuming .main-navigation is the primary navbar */
.main-navigation,
.navbar {
    position: fixed; /* MODIFIED from sticky */
    top: 0;
    width: 100%; /* ADDED */
    background: rgba(255, 255, 255, 0.95); /* MODIFIED for light theme navbar */
    backdrop-filter: blur(10px); /* ADDED */
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease; /* MODIFIED */
    box-shadow: 0 2px 20px rgba(0,0,0,0.1); /* MODIFIED */
    border-bottom: none; /* REMOVED border */
}

/* Main content spacing for fixed navbar */
.main-content,
body {
    padding-top: 80px; /* Add space for fixed navbar */
}

.nav-container {
    max-width: 1400px; /* MODIFIED from 1200px */
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-xl); /* MODIFIED to 1rem 2rem using variables */
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* height: 70px; */ /* REMOVED fixed height */
    background: transparent; /* ADDED to ensure transparency */
}

.nav-brand,
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-orange);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: var(--transition-fast);
}

.nav-brand:hover,
.logo:hover {
    transform: scale(1.05);
}

/* Logo icon styles */
.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-orange);
    color: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    list-style: none;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast); /* MODIFIED */
    position: relative;
}

.nav-link:hover {
    color: var(--primary-orange);
    background-color: var(--primary-orange-hover-bg); /* MODIFIED */
    transform: translateY(-2px); /* MODIFIED */
}

.nav-link.active {
    color: var(--primary-orange);
    background-color: var(--primary-orange-hover-bg); /* MODIFIED */
}

/* Navigation actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.theme-toggle,
.mobile-menu-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.theme-toggle:hover,
.mobile-menu-btn:hover {
    background-color: var(--primary-orange-hover-bg);
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}

.mobile-menu-btn {
    display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease-out;
    color: var(--text-white);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-center {
    align-items: center;
    justify-content: center;
}

.flex-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

 /* Message Components */
.message {
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
}

.message.info {
    background-color: #dbeafe;
    border-color: var(--ukraine-blue);
    color: #1e40af;
}

.message.success {
    background-color: #dcfce7;
    border-color: var(--success-color);
    color: #166534;
}

.message.warning {
    background-color: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.message.error {
    background-color: #fecaca;
    border-color: var(--error-color);
    color: #b91c1c;
}

/* Badge Component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--ukraine-blue);
    color: var(--text-white);
}

.badge-secondary {
    background-color: var(--background-light);
    color: var(--text-secondary);
}

.badge-success {
    background-color: var(--success-color);
    color: var(--text-white);
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--text-white);
}

/* Modal Component */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--background-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Legacy Navigation Support */
.nav {
    text-align: center;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
}

.nav a {
    color: var(--text-white);
    text-decoration: none;
    margin: 0 var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
    display: inline-block;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Сообщения */
.message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Список вакансий */
.vacancy-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.vacancy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.vacancy-title {
    color: #667eea;
    text-decoration: none;
    font-size: 1.4em;
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

.vacancy-title:hover {
    color: #764ba2;
}

.vacancy-meta {
    color: #666;
    margin: 10px 0;
    font-size: 0.9em;
}

.salary {
    color: #28a745;
    font-weight: 600;
    font-size: 1.1em;
}

.company {
    color: #6c757d;
    font-weight: 500;
}

.location {
    color: #6c757d;
}

/* Профиль */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2em;
    color: white;
    font-weight: bold;
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.info-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.info-value {
    color: #495057;
}

/* Действия в профиле */
.profile-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.action-card {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.action-card h4 {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.action-card p {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Поиск */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    align-items: center;
}

.search-form input {
    flex: 1;
    margin-bottom: 0;
}

.search-form .btn {
    margin: 0;
}

/* Дополнительные стили для управления вакансиями */
.vacancy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.vacancy-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.vacancy-count {
    color: #666;
    font-size: 0.9em;
    align-self: center;
    font-weight: 500;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 15px;
    color: #495057;
}

.empty-state p {
    margin-bottom: 25px;
    font-size: 1.1em;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.search-result {
    margin-top: 15px;
    color: #666;
    font-style: italic;
}

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.info-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    display: block;
}

.info-value {
    color: #495057;
    font-size: 1.1em;
}

.content {
    line-height: 1.6;
    color: #495057;
    font-size: 1.05em;
}

.error-card {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
}

.error-card h2 {
    color: #dc3545;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .nav-menu {
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 var(--spacing-md);
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: var(--spacing-md);
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        padding: var(--spacing-lg);
    }
}

@media (max-width: 576px) {
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-sm);
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .card {
        padding: var(--spacing-lg);
    }
    
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--ukraine-blue);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --background-primary: #1e293b;
        --background-secondary: #0f172a;
        --border-color: #334155;
    }
}

/* Print Styles */
@media print {
    .nav,
    .main-navigation,
    .hero,
    .btn {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Loading States */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--ukraine-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modern Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-lg);
    background: var(--background-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--background-light);
    font-weight: 600;
    color: var(--text-primary);
}

.table tr:hover {
    background: var(--background-light);
}

/* Form Validation Styles */
.form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    display: block;
}

.form-success {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    display: block;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* NEW Theme Toggle Button Styles */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color); 
    color: var(--text-primary); 
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    transform: scale(1.1);
}

/* NEW Dark Theme Overrides */
body.dark-theme .main-navigation { /* Or .navbar if class name changes in HTML */
    background: var(--dark-nav-bg); 
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

body.dark-theme .nav-link {
    color: var(--dark-text-primary);
}

body.dark-theme .nav-link:hover,
body.dark-theme .nav-link.active {
    color: var(--primary-light); /* #f4c272 */
    background-color: var(--dark-theme-nav-link-hover-bg); 
}

body.dark-theme .theme-toggle {
    border-color: var(--dark-theme-toggle-border); 
    color: var(--dark-text-primary);
}

body.dark-theme .theme-toggle:hover {
    border-color: var(--primary-light); 
    color: var(--primary-light);
}

/* Dark theme for cards */
body.dark-theme .card {
    background: var(--dark-card-bg);
    border-color: var(--dark-border-color);
    /* color: var(--dark-text-primary); Ensure text inside card inherits or is set */
}
body.dark-theme .card-title,
body.dark-theme .card-header h1, /* Assuming titles in headers */
body.dark-theme .card-header h2,
body.dark-theme .card-header h3,
body.dark-theme .card-header h4,
body.dark-theme .card-header h5,
body.dark-theme .card-header h6,
body.dark-theme .form-label {
    color: var(--dark-text-primary);
}
body.dark-theme .card-description {
    color: var(--dark-text-secondary);
}
body.dark-theme .card-header {
    border-bottom-color: var(--dark-border-color);
}

/* Dark theme for form elements */
body.dark-theme .form-input,
body.dark-theme input[type="text"], 
body.dark-theme input[type="email"], 
body.dark-theme input[type="password"], 
body.dark-theme input[type="number"],
body.dark-theme input[type="tel"],
body.dark-theme textarea, 
body.dark-theme select {
    background: var(--dark-card-bg);
    border-color: var(--dark-border-color);
    color: var(--dark-text-primary);
}

body.dark-theme .form-input:focus,
body.dark-theme input:focus, 
body.dark-theme textarea:focus, 
body.dark-theme select:focus {
    border-color: var(--primary-light); /* Dark theme accent orange */
    background: var(--dark-card-bg); 
    box-shadow: 0 0 0 3px var(--dark-theme-nav-link-hover-bg); /* Similar to nav link hover bg for consistency */
}

body.dark-theme .form-input::placeholder,
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: var(--dark-text-secondary);
}

/* Ensure headings also adopt dark theme colors if not inheriting */
body.dark-theme h1, 
body.dark-theme h2, 
body.dark-theme h3, 
body.dark-theme h4, 
body.dark-theme h5, 
body.dark-theme h6 {
    color: var(--dark-text-primary);
}

/* Ensure .nav-brand text color is appropriate in dark mode */
body.dark-theme .nav-brand {
    color: var(--primary-orange); /* Keep brand color consistent or use --primary-light if preferred for dark */
}
