/* ============================================================
   VD Darshan Timings Widget — darshan-timings.css
   Perfected Responsive Centered Modal & Sticky Tab
   ============================================================ */

/* ── STICKY SIDE TAB BUTTON ── */
.vd-dt-sticky-btn {
    position: fixed;
    right: 0;
    top: 40% !important;
    z-index: 90000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: linear-gradient(180deg, #7A191A 0%, #5e1112 100%);
    color: #fff;
    padding: 16px 10px;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    box-shadow: -4px 0 20px rgba(122,25,26,0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: 'Baloo Bhai 2', cursive;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    user-select: none;
}
.vd-dt-sticky-btn:hover {
    padding-right: 15px;
    box-shadow: -6px 0 28px rgba(122,25,26,0.55);
    background: linear-gradient(180deg, #5e1112 0%, #3d0c0d 100%);
}
.vd-dt-sticky-btn i {
    font-size: 18px;
    writing-mode: horizontal-tb;
    color: #E9B855;
    margin-bottom: 4px;
    animation: vd-dt-pulse 2s infinite;
}
@keyframes vd-dt-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.vd-dt-sticky-btn span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.vd-dt-sticky-btn::after {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    background: linear-gradient(to bottom, transparent, #E9B855, transparent);
    border-radius: 3px;
}

/* ── BACKDROP ── */
.vd-dt-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 100001;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.vd-dt-backdrop.active {
    display: block;
    opacity: 1;
}

/* ── CENTERED MODAL DIALOG (Responsive on All Devices) ── */
.vd-dt-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: min(92vw, 440px);
    max-height: 86vh;
    max-height: 86dvh;
    background: #fff;
    z-index: 100002;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.vd-dt-modal.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* ── HIDE FLOATING ELEMENTS WHEN MODAL IS OPEN ── */
body.vd-dt-no-scroll .vd-floating-lang-switcher,
body.vd-dt-no-scroll .vd-dt-sticky-btn {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease !important;
}

/* ── MODAL HEADER ── */
.vd-dt-modal-header {
    background: linear-gradient(135deg, #7A191A 0%, #5e1112 60%, #3d0c0d 100%);
    padding: 20px 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.vd-dt-modal-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 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='%23ffffff' fill-opacity='0.04'%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");
    opacity: 0.5;
}
.vd-dt-header-content {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}
.vd-dt-header-icon {
    width: 44px;
    height: 44px;
    background: rgba(233,184,85,0.2);
    border: 2px solid #E9B855;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: #E9B855;
}
.vd-dt-modal-title {
    color: #E9B855;
    font-size: 21px;
    font-weight: 800;
    margin: 0 0 2px;
    font-family: 'Baloo Bhai 2', cursive;
    line-height: 1.2;
}
.vd-dt-modal-subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    margin: 0;
    font-family: 'Baloo Bhai 2', cursive;
}
.vd-dt-close {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.vd-dt-close:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

/* ── MODAL BODY ── */
.vd-dt-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #fdfaf6;
}
.vd-dt-modal-body::-webkit-scrollbar { width: 4px; }
.vd-dt-modal-body::-webkit-scrollbar-track { background: transparent; }
.vd-dt-modal-body::-webkit-scrollbar-thumb { background: #e0c89a; border-radius: 2px; }

/* ── TIMING SECTIONS ── */
.vd-dt-section {
    padding: 16px 18px 6px;
}
.vd-dt-section + .vd-dt-section {
    border-top: 6px solid #f5ece0;
}
.vd-dt-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.vd-dt-sun-icon {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.vd-dt-section-title {
    font-size: 17px;
    font-weight: 800;
    color: #7A191A;
    margin: 0;
    font-family: 'Baloo Bhai 2', cursive;
}

/* ── TIMING ITEMS ── */
.vd-dt-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.vd-dt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #f0e6d2;
    gap: 10px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.vd-dt-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 12px rgba(122,25,26,0.08);
}
.vd-dt-item--closed {
    background: #fff8ee;
    border-color: #f5d9a8;
    border-style: dashed;
    font-style: italic;
}
.vd-dt-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.vd-dt-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d1a0e;
    font-family: 'Baloo Bhai 2', cursive;
    line-height: 1.3;
}
.vd-dt-item--closed .vd-dt-item-name {
    color: #8B5E3C;
    font-style: italic;
}
.vd-dt-item-note {
    font-size: 11px;
    color: #9e7040;
    font-style: italic;
    font-family: 'Baloo Bhai 2', cursive;
}
.vd-dt-item-time {
    font-size: 14px;
    font-weight: 800;
    color: #7A191A;
    white-space: nowrap;
    font-family: 'Baloo Bhai 2', cursive;
    flex-shrink: 0;
    background: #fdf3e7;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #f0d9b0;
    min-width: 48px;
    text-align: center;
}
.vd-dt-item--closed .vd-dt-item-time {
    color: #8B5E3C;
    background: #fff0db;
}

/* ── MODAL FOOTER ── */
.vd-dt-modal-footer {
    padding: 14px 18px;
    border-top: 1px solid #f0e6d2;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}
.vd-dt-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #7A191A, #5e1112);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    font-family: 'Baloo Bhai 2', cursive;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(122,25,26,0.35);
    letter-spacing: 0.3px;
}
.vd-dt-footer-btn:hover {
    background: linear-gradient(135deg, #5e1112, #3d0c0d);
    color: #E9B855;
    box-shadow: 0 6px 24px rgba(122,25,26,0.5);
    transform: translateY(-2px);
}
.vd-dt-footer-btn i {
    font-size: 15px;
    color: #E9B855;
}

/* ── BODY SCROLL LOCK ── */
.vd-dt-no-scroll {
    overflow: hidden !important;
}

/* ── RESPONSIVE MEDIA QUERIES ── */
@media (max-width: 768px) {
    .vd-dt-modal {
        width: min(94vw, 420px);
        max-height: 84vh;
        max-height: 84dvh;
        border-radius: 18px;
    }
    .vd-dt-sticky-btn {
        top: 40% !important;
        right: 0;
        padding: 14px 8px;
        border-radius: 10px 0 0 10px;
    }
    .vd-dt-sticky-btn i { font-size: 16px; }
    .vd-dt-sticky-btn span { font-size: 11px; letter-spacing: 0.5px; }
    .vd-dt-modal-title { font-size: 19px; }
    .vd-dt-modal-header { padding: 16px 16px 14px; }
    .vd-dt-section { padding: 14px 16px 6px; }
    .vd-dt-item { padding: 9px 12px; }
    .vd-dt-item-name { font-size: 13px; }
    .vd-dt-item-time { font-size: 13px; padding: 3px 8px; }
    .vd-dt-footer-btn { font-size: 13px; padding: 11px 20px; width: 100%; }
    .vd-dt-modal-footer { padding: 12px 16px; }
}

@media (max-width: 480px) {
    .vd-dt-modal {
        width: 95vw;
        max-height: 86vh;
        max-height: 86dvh;
        border-radius: 16px;
    }
    .vd-dt-sticky-btn {
        top: 38% !important;
        padding: 12px 7px;
    }
    .vd-dt-sticky-btn i { font-size: 15px; }
    .vd-dt-sticky-btn span { font-size: 10px; }
    .vd-dt-header-icon { width: 38px; height: 38px; font-size: 18px; }
    .vd-dt-modal-title { font-size: 18px; }
    .vd-dt-close { width: 30px; height: 30px; font-size: 18px; }
    .vd-dt-section-title { font-size: 16px; }
    .vd-dt-item { padding: 8px 10px; gap: 8px; }
    .vd-dt-item-name { font-size: 12px; }
    .vd-dt-item-note { font-size: 10px; }
    .vd-dt-item-time { font-size: 12px; padding: 2px 7px; min-width: 42px; }
}
