/* ==============================================
   KALENDAR HIJRAH-MASIHI 2025
   Islamic-inspired color scheme with modern, minimalist design
   ============================================== */

/* Root Variables - Deep Green & Gold Color Palette */
:root {
    /* Primary Colors - Deep Islamic Green */
    --color-primary: #0A5C4A;          /* Deep Islamic Green */
    --color-primary-light: #0D7C66;     /* Light Green */
    --color-primary-lighter: #D4F1E8;   /* Very Light Green */
    --color-primary-dark: #065A4B;      /* Dark Green */

    /* Secondary Colors - Gold */
    --color-secondary: #D4AF37;         /* Gold */
    --color-secondary-light: #F4C542;   /* Light Gold */
    --color-secondary-lighter: #FFF4D6; /* Very Light Gold */
    --color-secondary-dark: #B8941F;    /* Dark Gold */

    /* Accent Colors - Complementary tones */
    --color-accent: #C17817;            /* Bronze/Copper */
    --color-accent-light: #D89C3F;      /* Light Bronze */

    /* Neutral Colors */
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;

    /* Shadows - Soft and subtle with green tint */
    --shadow-sm: 0 1px 2px 0 rgba(10, 92, 74, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(10, 92, 74, 0.15), 0 2px 4px -1px rgba(10, 92, 74, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(10, 92, 74, 0.2), 0 4px 6px -2px rgba(10, 92, 74, 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Base Typography */
body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.islamic-title {
    font-family: 'Amiri', 'Tajawal', serif;
    letter-spacing: -0.025em;
}

.islamic-subtitle {
    font-family: 'Tajawal', sans-serif;
    font-weight: 400;
}

/* Header Styling */
.islamic-header {
    background: linear-gradient(135deg,
        rgba(212, 241, 232, 0.95) 0%,
        rgba(255, 244, 214, 0.95) 50%,
        rgba(212, 241, 232, 0.95) 100%);
    border-bottom: 2px solid var(--color-secondary);
    box-shadow: 0 4px 12px rgba(13, 124, 102, 0.1);
}

/* Calendar Day Cell */
.calendar-day {
    position: relative;
    min-height: 100px;
    padding: 0.5rem;
    border: 1.5px solid var(--color-primary-lighter);
    border-radius: var(--radius-md);
    background: linear-gradient(to bottom, #ffffff, #f9fffe);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    background: linear-gradient(to bottom, #ffffff, var(--color-primary-lighter));
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

/* Today's Date Highlighting */
.calendar-day.today {
    background: linear-gradient(135deg, var(--color-secondary-lighter), var(--color-primary-lighter));
    border: 2px solid var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.calendar-day.today:hover {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3), var(--shadow-md);
}

/* Masihi Date */
.masihi-date {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-slate-800);
    line-height: 1.2;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hijri Date */
.hijri-date {
    font-size: 0.8rem;
    color: var(--color-primary-dark);
    font-weight: 600;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--color-secondary-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hijri-month-name {
    font-size: 0.65rem;
    color: var(--color-slate-600);
    margin-top: 0.125rem;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Show full month name by default, hide abbreviated */
.hijri-month-full {
    display: inline;
}

.hijri-month-abbr {
    display: none;
}

/* Month Change Indicator */
.month-change {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
}

/* Weekend Styling */
.calendar-day.weekend {
    background: linear-gradient(to bottom, var(--color-secondary-lighter), #fffef5);
}

.calendar-day.weekend:hover {
    background: linear-gradient(to bottom, var(--color-secondary-lighter), #fffaeb);
}

/* Islamic Month Badge */
.islamic-month-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    color: #065A4B;
    margin: 0.25rem;
    font-size: 0.95rem;
}

/* Decorative Elements */
.decorative-pattern {
    background-image:
        radial-gradient(circle at 20px 20px, rgba(20, 184, 166, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 80px 80px, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 100px 100px;
    background-position: 0 0, 50px 50px;
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-primary-lighter);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
    border-radius: var(--radius-md);
    border: 1px solid var(--color-secondary-light);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calendar-day {
        min-height: 90px;
        padding: 0.45rem;
    }

    .masihi-date {
        font-size: 1.25rem;
    }

    .hijri-date {
        font-size: 0.7rem;
    }

    .hijri-month-name {
        font-size: 0.6rem;
    }
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 80px;
        padding: 0.35rem;
    }

    .masihi-date {
        font-size: 1.1rem;
    }

    .hijri-date {
        font-size: 0.65rem;
    }

    .hijri-month-name {
        font-size: 0.55rem;
    }

    /* Switch to abbreviated month names on tablets */
    .hijri-month-full {
        display: none;
    }

    .hijri-month-abbr {
        display: inline;
    }

    .islamic-month-badge {
        font-size: 0.85rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 640px) {
    .calendar-day {
        min-height: 70px;
        padding: 0.3rem;
    }

    .masihi-date {
        font-size: 1rem;
    }

    .hijri-date {
        font-size: 0.6rem;
        margin-top: 0.2rem;
        padding-top: 0.2rem;
    }

    .hijri-month-name {
        font-size: 0.55rem;
        margin-top: 0.1rem;
    }

    /* Ensure abbreviated names are shown */
    .hijri-month-full {
        display: none;
    }

    .hijri-month-abbr {
        display: inline;
    }

    .islamic-month-badge {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }

    .month-change {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 68px;
        padding: 0.25rem;
    }

    .masihi-date {
        font-size: 0.95rem;
    }

    .hijri-date {
        font-size: 0.55rem;
        margin-top: 0.15rem;
        padding-top: 0.15rem;
    }

    .hijri-month-name {
        font-size: 0.5rem;
        margin-top: 0.08rem;
    }

    /* Ensure abbreviated names are shown */
    .hijri-month-full {
        display: none;
    }

    .hijri-month-abbr {
        display: inline;
    }

    .islamic-month-badge {
        font-size: 0.7rem;
        padding: 0.1rem 0.2rem;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-day {
    animation: fadeIn 0.3s ease-out;
}

/* Focus States for Accessibility */
select:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.3);
    border-color: var(--color-primary) !important;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .calendar-day {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    footer {
        display: none;
    }
}

/* ============================================== */
/* New Styles for Redesigned Layout */
/* ============================================== */

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Day Header Responsive Text */
@media (max-width: 480px) {
    .grid.grid-cols-7 > div[style*="background: linear-gradient"] {
        font-size: 0.65rem !important;
        padding: 0.4rem 0.2rem !important;
    }
}

@media (max-width: 360px) {
    .grid.grid-cols-7 > div[style*="background: linear-gradient"] {
        font-size: 0.55rem !important;
        padding: 0.3rem 0.1rem !important;
    }
}

/* Particles.js Container */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Fade-in Animation */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 1s ease-out;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}
