:root {
    --primary-color: #1a5e1a;
    --secondary-color: #2d8b2d;
    --accent-color: #d4af37;
    --text-color: #2c3e50;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

.islamic-calendar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header Styles */
.calendar-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.calendar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" font-size="20" fill="rgba(255,255,255,0.1)" text-anchor="middle" dominant-baseline="middle">ﷲ</text></svg>');
    background-size: 200px;
}

.calendar-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.current-hijri-date {
    font-size: 1.3em;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    position: relative;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.2);
    padding: 12px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.control-group label {
    font-weight: 600;
    font-size: 0.95em;
}

.control-select, .calendar-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
}

.control-select {
    background: var(--white);
    color: var(--text-color);
    min-width: 180px;
    border: 2px solid transparent;
}

.control-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

.calendar-btn {
    background: var(--accent-color);
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-btn:hover {
    background: #c19b2c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Main Calendar View */
.calendar-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-top: 20px;
}

.calendar-main {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.calendar-nav h2 {
    font-size: 1.5em;
    font-weight: 600;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
}

.calendar-day-header {
    background: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 15px 10px;
    font-weight: 600;
    font-size: 1.1em;
}

.calendar-day {
    background: var(--white);
    padding: 15px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
    border: 1px solid #f0f0f0;
}

.calendar-day:hover {
    background: var(--light-bg);
    transform: scale(1.02);
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.hijri-date {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.gregorian-date {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.islamic-event {
    font-size: 0.75em;
    background: linear-gradient(135deg, var(--accent-color), #e6c158);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 5px;
    font-weight: 600;
}

.today {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    border: 2px solid var(--secondary-color);
}

.today .hijri-date {
    color: var(--secondary-color);
    font-weight: 800;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    transition: var(--transition);
}

.sidebar-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.sidebar-widget h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-bg);
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-widget h3::before {
    content: '●';
    color: var(--accent-color);
}

/* Prayer Times */
.prayer-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: 8px;
    transition: var(--transition);
}

.prayer-time:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.prayer-name {
    font-weight: 600;
    color: var(--text-color);
}

.prayer-time-value {
    font-weight: 700;
    color: var(--primary-color);
    background: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--secondary-color);
}

/* Special Dates */
.special-date {
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: var(--transition);
}

.special-date:hover {
    transform: translateX(5px);
    border-left-color: var(--primary-color);
}

.special-date h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1em;
}

.special-date p {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

/* Loading and Error States */
.loading, .error {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.1em;
}

.loading {
    color: var(--primary-color);
}

.error {
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .calendar-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        grid-template-columns: repeat(2, 1fr);
        display: grid;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .islamic-calendar-container {
        padding: 10px;
    }
    
    .calendar-header {
        padding: 20px 15px;
    }
    
    .calendar-header h1 {
        font-size: 2em;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-group {
        flex-direction: column;
        width: 100%;
        padding: 15px;
    }
    
    .control-select {
        width: 100%;
        min-width: auto;
    }
    
    .calendar-nav {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-buttons {
        display: flex;
        gap: 10px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 10px;
    }
    
    .calendar-day-header {
        padding: 10px 5px;
        font-size: 0.9em;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .calendar-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .calendar-day-header {
        display: none;
    }
    
    .calendar-day {
        min-height: auto;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .hijri-date, .gregorian-date {
        margin-bottom: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e9ecef;
        --light-bg: #2d3748;
        --white: #1a202c;
    }
    
    .calendar-day, .sidebar-widget {
        background: #2d3748;
        color: var(--text-color);
    }
    
    .prayer-time, .special-date {
        background: #4a5568;
    }
}

/* Print Styles */
@media print {
    .calendar-btn, .controls {
        display: none;
    }
    
    .calendar-main, .sidebar-widget {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Animation for today highlight */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.today {
    animation: pulse 2s infinite;
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    justify-content: center;
}