/* Design System & Core Styles */
:root {
    --primary: #c5a021; /* Royal Gold */
    --primary-light: #eab308; /* Yellow 600 */
    --secondary: #854d0e; /* Darker Gold */
    --bg-light: #f8fafc; /* Slate 50 */
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-dark: #1e293b; /* Slate 800 */
    --text-light: #64748b; /* Slate 500 */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-light: #0f172a; /* Slate 900 */
    --card-bg: rgba(30, 41, 59, 0.8);
    --text-dark: #f8fafc;
    --text-light: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: var(--transition);
    overflow-x: hidden;
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

/* Layout Utilities */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

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

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-content: center;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 70px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--primary);
    color: white;
}

/* Hero Slider */
.hero {
    height: 85vh;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
    background: #000;
}

.slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide.active {
    opacity: 1;
}

.slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    color: white;
    padding: 20px;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s ease-out 0.5s;
    text-align: center;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slide.active .hero-content {
    transform: translateY(0);
    opacity: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: white;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 35px;
    text-shadow: 0 1px 5px rgba(0,0,0,0.3);
}

.slider-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 15px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.dot.active {
    background: var(--primary-light);
    transform: scale(1.2);
    border-color: white;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.slider-arrow:hover {
    background: var(--primary);
}

.prev-arrow { left: 20px; }
.next-arrow { right: 20px; }

[dir="rtl"] .prev-arrow { left: auto; right: 20px; transform: translateY(-50%) rotate(180deg); }
[dir="rtl"] .next-arrow { right: auto; left: 20px; transform: translateY(-50%) rotate(180deg); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.4);
}

/* Worker Card */
.worker-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

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

.worker-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.worker-info {
    padding: 20px;
}

.worker-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.worker-nationality {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.worker-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-available { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.badge-hired { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.badge-reserved { background: rgba(245, 158, 11, 0.1); color: #f59e11; }

/* Sidebar Filter */
.sidebar {
    position: sticky;
    top: 90px;
    height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 20px;
    border-radius: var(--radius);
}

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

.filter-group h4 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-dark);
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.9rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 2000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: var(--transition);
}

#modalBody {
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 10px;
}

/* Custom modern scrollbar for modal body */
#modalBody::-webkit-scrollbar {
    width: 6px;
}
#modalBody::-webkit-scrollbar-track {
    background: transparent;
}
#modalBody::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
#modalBody::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Admin Dashboard */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: 100vh;
}

.admin-sidebar {
    background: var(--text-dark);
    color: white;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Custom scrollbar for admin sidebar */
.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}
.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.admin-nav {
    list-style: none;
    margin-top: 30px;
}

.admin-nav li a {
    display: block;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: var(--transition);
}

.admin-nav li a:hover, .admin-nav li a.active {
    background: var(--primary);
    color: white;
}

.admin-main {
    padding: 30px;
    overflow-y: auto;
    background: #f1f5f9;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-dark);
}

/* RTL Support */
[dir="rtl"] .data-table th, [dir="rtl"] .data-table td {
    text-align: right;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; } /* Hamburger needed in real app */
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; } /* Need toggle */
}

/* Workers Carousel */
.workers-carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 20px 0;
}

.workers-carousel {
    display: flex;
    gap: 20px;
    padding: 10px 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.workers-carousel::-webkit-scrollbar {
    display: none;
}

.workers-carousel .worker-card {
    flex: 0 0 calc(33.333% - 14px); /* 3 cards visible */
    min-width: 300px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

@media (max-width: 1000px) {
    .workers-carousel .worker-card {
        flex: 0 0 calc(50% - 10px); /* 2 cards */
    }
}

@media (max-width: 600px) {
    .workers-carousel .worker-card {
        flex: 0 0 100%; /* 1 card */
    }
}

.workers-carousel .worker-card:hover {
    transform: translateY(-5px);
}

/* Footer Styles */
.footer {
    padding: 80px 0 20px;
    background: var(--bg-dark);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-logo {
    height: 60px;
    width: auto;
}

.footer-col h4 {
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
}

.social-links {
    margin-top: 10px;
}

.social-item {
    width: 40px;
    height: 40px;
    background: #fdfaf5; /* Light Beige background */
    color: #b8860b;      /* Royal Gold icon color */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.05);
}

.social-item:hover {
    background: #b8860b; /* Gold background on hover */
    color: #ffffff;      /* White icon on hover */
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.3);
}

/* Option for small logo inside circle */
.social-item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transition: filter 0.4s ease;
}

.social-item:hover img {
    filter: brightness(0) invert(1); /* Turns black/colored logo to white */
}

/* Admin Form Enhancements */
.admin-form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-form-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select,
.admin-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    color: var(--text-dark);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

[data-theme="dark"] .admin-form-group input,
[data-theme="dark"] .admin-form-group textarea,
[data-theme="dark"] .admin-form-group select,
[data-theme="dark"] .admin-input {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus,
.admin-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(197, 160, 33, 0.15);
    outline: none;
}

[data-theme="dark"] .admin-form-group input:focus,
[data-theme="dark"] .admin-form-group textarea:focus,
[data-theme="dark"] .admin-form-group select:focus,
[data-theme="dark"] .admin-input:focus {
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(197, 160, 33, 0.3);
}

.admin-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.file-upload-box {
    border: 2px dashed rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.file-upload-box:hover {
    border-color: var(--primary);
    background: #fff;
}

.preview-container {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}
