/**
 * NEWZEEFY TAMIL CALENDAR STYLESHEET (tamil-calendar.css)
 * Glassmorphism Calendar Model, Badges & Micro-Interactions
 * Full Dynamic Dark Mode & Light Mode Color System
 */

.tamil-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.tamil-cal-weekday-header {
    background: #dc2626;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    padding: 10px 4px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tamil-cal-weekday-header.sun-header {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
}

.tamil-cal-weekday-header.sat-header {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
}

.tamil-cal-day-cell {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px;
    min-height: 100px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
}

.tamil-cal-day-cell:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
    border-color: #dc2626 !important;
}

/* Distinct Weekend Color Block (Light Mode) */
.tamil-cal-day-cell.weekend {
    background: linear-gradient(145deg, #fff5f5 0%, #fef2f2 100%) !important;
    border: 1px solid #fecaca !important;
}

.tamil-cal-day-cell.today {
    border: 2px solid #dc2626 !important;
    background: linear-gradient(145deg, #ffffff, #fef2f2) !important;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.2) !important;
}

.tamil-cal-day-cell.selected {
    border: 2px solid #2563eb !important;
    background: linear-gradient(145deg, #ffffff, #eff6ff) !important;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.25) !important;
}

.tamil-cal-day-cell.empty {
    background: transparent;
    border: none;
    pointer-events: none;
    min-height: 70px;
}

.cal-eng-num {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.cal-tam-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.cal-tithi-tag {
    font-size: 0.7rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.cal-badge-pill {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 50px;
    font-weight: 600;
    max-width: 100%;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    display: inline-block;
    line-height: 1.2;
}

/* ==========================================================================
   RESPONSIVE OVERRIDES FOR SM AND XS DEVICES (Tablet & Mobile)
   Swiping Model with Smooth Touch-Scroll & 100% Aligned 7-Column Grid
   ========================================================================== */
@media (max-width: 767.98px) {
    .calendar-grid-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 8px;
        width: 100% !important;
    }
    .tamil-cal-grid {
        gap: 6px !important;
        grid-template-columns: repeat(7, minmax(95px, 1fr)) !important;
        min-width: 700px !important;
        width: 700px !important;
    }
    .tamil-cal-weekday-header {
        padding: 8px 4px !important;
        font-size: 0.72rem !important;
        border-radius: 8px !important;
        line-height: 1.2;
    }
    .tamil-cal-day-cell {
        padding: 6px 5px !important;
        min-height: 92px !important;
        border-radius: 10px !important;
    }
    .cal-eng-num {
        font-size: 1.1rem !important;
    }
    .cal-tam-num {
        font-size: 0.78rem !important;
        padding: 1px 5px !important;
        border-radius: 4px !important;
    }
    .cal-tithi-tag {
        font-size: 0.65rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .cal-badge-pill {
        font-size: 0.58rem !important;
        padding: 2px 4px !important;
        border-radius: 4px !important;
    }
}

@media (max-width: 575.98px) {
    .calendar-grid-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 8px;
        width: 100% !important;
    }
    .tamil-cal-grid {
        gap: 5px !important;
        grid-template-columns: repeat(7, minmax(90px, 1fr)) !important;
        min-width: 660px !important;
        width: 660px !important;
    }
    .tamil-cal-weekday-header {
        padding: 6px 3px !important;
        font-size: 0.68rem !important;
        border-radius: 6px !important;
        font-weight: 700;
    }
    .tamil-cal-day-cell {
        padding: 5px 4px !important;
        min-height: 85px !important;
        border-radius: 8px !important;
    }
    .tamil-cal-day-cell.empty {
        min-height: 50px !important;
    }

    .tamil-cal-day-cell > .d-flex {
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    .cal-eng-num {
        font-size: 1.05rem !important;
        line-height: 1 !important;
    }
    .cal-tam-num {
        font-size: 0.72rem !important;
        padding: 1px 4px !important;
        line-height: 1 !important;
        border-radius: 4px !important;
    }
    .cal-tithi-tag {
        font-size: 0.62rem !important;
        line-height: 1.1 !important;
        margin-top: 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .cal-badge-pill {
        font-size: 0.55rem !important;
        padding: 2px 4px !important;
        margin-right: 2px !important;
        border-radius: 4px !important;
        line-height: 1.1 !important;
    }
}

/* ==========================================================================
   DARK MODE OVERRIDES (body.dark-mode & [data-bs-theme="dark"])
   ========================================================================== */
body.dark-mode .tamil-cal-day-cell,
[data-bs-theme="dark"] .tamil-cal-day-cell {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Distinct Weekend Color Block (Dark Mode) */
body.dark-mode .tamil-cal-day-cell.weekend,
[data-bs-theme="dark"] .tamil-cal-day-cell.weekend {
    background: linear-gradient(145deg, #2d1215 0%, #1e1b4b 100%) !important;
    border-color: #451a1d !important;
}

body.dark-mode .tamil-cal-day-cell.today,
[data-bs-theme="dark"] .tamil-cal-day-cell.today {
    border: 2px solid #f87171 !important;
    background: linear-gradient(145deg, #1e293b, #450a0a) !important;
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.3) !important;
}

body.dark-mode .tamil-cal-day-cell.selected,
[data-bs-theme="dark"] .tamil-cal-day-cell.selected {
    border: 2px solid #60a5fa !important;
    background: linear-gradient(145deg, #1e293b, #172554) !important;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.3) !important;
}

body.dark-mode .cal-eng-num,
[data-bs-theme="dark"] .cal-eng-num {
    color: #f8fafc !important;
}

body.dark-mode .cal-tithi-tag,
[data-bs-theme="dark"] .cal-tithi-tag {
    color: #cbd5e1 !important;
}

body.dark-mode .tamil-cal-day-cell:hover,
[data-bs-theme="dark"] .tamil-cal-day-cell:hover {
    border-color: #f87171 !important;
    background: #334155 !important;
}
