:root {
    --primary-color: #047857;
    --primary-dark: #064e3b;
    --accent-color: #b45309;
    --accent-light: #f59e0b;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
    line-height: 1.5;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23065f46' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
}

.main-container {
    width: 100%;
    max-width: 1280px;
    background: transparent;
    animation: fadeIn 0.8s ease-out;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-light), var(--primary-color));
}

header h1 {
    color: var(--primary-dark);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.controls {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: #f3f4f6;
    padding: 8px 16px 8px 8px;
    border-radius: 50px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.toggle-switch:hover {
    background: #e5e7eb;
}

.toggle-label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1rem;
}

.home-button {
    display: inline-block;
    padding: 12px 20px;
    margin-right: 20px;
    background-color: rgba(4, 120, 87, 0.15);
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.home-button:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(4, 120, 87, 0.3);
}

.slider {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: #d1d5db;
    border-radius: 34px;
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.table-wrapper {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    overflow-x: auto;
    max-height: 80vh;
    border: 2px solid rgba(4, 120, 87, 0.1);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

thead {
    background: var(--primary-dark);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th {
    padding: 1.5rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid var(--accent-color);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

th:last-child {
    border-right: none;
}

td {
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--text-main);
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

/* تخصيص عمود اليوم */
td:first-child {
    background-color: rgba(251, 146, 60, 0.2);
    color: #9a3412;
    font-weight: 700;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

tbody tr:hover {
    background-color: #ecfdf5 !important;
    box-shadow: 0 0 0 2px #10b981 inset;
    transform: scale(1.005);
    cursor: pointer;
}

tbody tr:hover td {
    color: var(--primary-dark);
    font-weight: 700;
}

.highlight-row {
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.2), rgba(245, 158, 11, 0.3)) !important;
    border-left: 5px solid var(--accent-color);
    border-right: 5px solid var(--accent-color);
    box-shadow: 0 4px 10px -1px rgba(217, 119, 6, 0.2), 0 0 15px rgba(245, 158, 11, 0.15) !important;
    position: relative;
    animation: pulse-highlight 2s infinite;
}

.highlight-row td {
    color: var(--accent-color) !important;
    font-weight: 800;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

@keyframes pulse-highlight {
    0% {
        box-shadow: 0 4px 10px -1px rgba(217, 119, 6, 0.2), 0 0 15px rgba(245, 158, 11, 0.15);
    }
    50% {
        box-shadow: 0 4px 10px -1px rgba(217, 119, 6, 0.3), 0 0 20px rgba(245, 158, 11, 0.25);
    }
    100% {
        box-shadow: 0 4px 10px -1px rgba(217, 119, 6, 0.2), 0 0 15px rgba(245, 158, 11, 0.15);
    }
}

.month-header {
    background: #8b5cf6 !important;
}

tbody .month-header {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
}

table tbody tr.month-header {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
}

tbody tr.month-header:hover {
    transform: none !important;
    box-shadow: none !important;
    cursor: default !important;
}

.month-header td {
    color: white !important;
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    padding: 1.75rem !important;
    text-align: center !important;
    border: none !important;
    letter-spacing: 1.5px !important;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4) !important;
    background: transparent !important;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    th,
    td {
        padding: 1rem 0.5rem;
        font-size: 0.9rem;
    }
}