/**
 * HPS Panchang Frontend Styles
 * Fully Responsive, 12-Hour AM/PM Formatted
 * Built specifically for Hindu Priest Services
 */

/* Box Sizing Reset for Panchang Components */
.hps-widget-wrapper,
.hps-widget-wrapper *,
.hps-monthly-wrapper,
.hps-monthly-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   CITY SELECTOR BAR
   ========================================================================== */
.hps-city-selector-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    background: #f8fafc;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 100%;
}

.hps-city-selector-bar label {
    font-size: 14px;
    color: #334155;
    white-space: nowrap;
    margin: 0;
}

.hps-city-select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
    color: #1e293b;
    flex: 1;
    max-width: 100%;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hps-city-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

@media (max-width: 600px) {
    .hps-city-selector-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 10px 12px;
    }
    .hps-city-select {
        width: 100%;
    }
}

/* ==========================================================================
   DAILY WIDGET STYLES (User Design - Mobile Aligned)
   ========================================================================== */
.hps-widget-wrapper {
    max-width: 480px;
    margin: 0 auto 25px auto;
    width: 100%;
}

.details.hps-details {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    width: 100%;
}

.details.hps-details h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #e67e22;
    padding-bottom: 8px;
}

.details.hps-details ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.details.hps-details ul li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    line-height: 1.45;
    gap: 12px;
}

.details.hps-details ul li:last-child {
    border-bottom: none;
}

.details.hps-details ul li .hps-lbl {
    flex: 0 0 115px;
    color: #0f172a;
    font-weight: 600;
    text-align: left;
}

.details.hps-details ul li .hps-val {
    flex: 1;
    text-align: right;
    color: #1e293b;
    word-break: break-word;
}

.details.hps-details ul li.singleline .hps-val {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.details.hps-details .sun-img,
#calendar .sun-img {
    vertical-align: middle;
    margin-left: 4px;
    display: inline-block;
}

/* More Button */
.hps-more-container {
    text-align: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}

.hps-more-btn {
    display: inline-block;
    background: #e67e22;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.1s ease;
}

.hps-more-btn:hover {
    background: #d35400;
    color: #ffffff !important;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .details.hps-details {
        padding: 14px 14px;
    }
    .details.hps-details ul li {
        font-size: 13.5px;
        padding: 8px 0;
    }
    .details.hps-details ul li .hps-lbl {
        flex: 0 0 105px;
    }
}

/* ==========================================================================
   MONTHLY CALENDAR STYLES
   ========================================================================== */
.hps-monthly-wrapper {
    margin: 20px 0;
    width: 100%;
}

.hps-calendar-top-bar {
    margin-bottom: 15px;
}

#calendar {
    background: #ffffff;
    font-family: inherit;
    width: 100%;
}

/* Month Navigation Header */
#calendar .button-container.hps-month-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

#calendar .button-container .hps-month-heading {
    margin: 0;
    font-size: 24px;
    color: #1e293b;
    font-weight: 700;
}

.hps-nav-button {
    display: inline-block;
    background-color: #4169E1;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.hps-nav-button:hover {
    background-color: #3154b3;
    color: #ffffff !important;
}

.hps-attribution-block {
    margin: 10px 0 16px 0;
}

/* ==========================================================================
   DESKTOP 7-COLUMN TABLE VIEW (Default >= 768px)
   ========================================================================== */
.hps-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-top: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

#calendar table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
    background: #ffffff;
    table-layout: fixed;
}

#calendar th {
    background-color: #f8fafc;
    color: #1e293b;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    padding: 10px 6px;
    border: 1px solid #cbd5e1;
    width: 14.285%;
}

#calendar td {
    border: 1px solid #cbd5e1;
    padding: 8px 6px;
    vertical-align: top;
    font-size: 12.5px;
    line-height: 1.35;
    background: #ffffff;
    min-height: 150px;
    width: 14.285%;
    word-break: break-word;
}

#calendar td.hps-empty-cell {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

#calendar td div {
    margin-bottom: 3px;
}

/* ==========================================================================
   MOBILE VIEW: CONTROLS & DAY CARDS (< 768px)
   ========================================================================== */
.hps-mobile-controls {
    display: none;
    margin-bottom: 16px;
    gap: 10px;
    flex-direction: column;
}

.hps-jump-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.hps-jump-bar label {
    font-size: 13px;
    white-space: nowrap;
    color: #334155;
}

.hps-toggle-view-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hps-mobile-calendar {
    display: none;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.hps-mcard {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.hps-mcard-today {
    border: 2px solid #e67e22;
    background-color: #fffef8;
}

.hps-mcard-header {
    background: #f8fafc;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hps-mcard-today .hps-mcard-header {
    background: #fef9e7;
    border-bottom-color: #fdebd0;
}

.hps-mcard-date {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hps-mcard-num {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    background: #e2e8f0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hps-mcard-today .hps-mcard-num {
    background: #e67e22;
    color: #ffffff;
}

.hps-mcard-dayname {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.hps-mcard-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}

.hps-badge-today {
    background: #e67e22;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.hps-badge-festival {
    background: #f4ecf7;
    color: #8e44ad;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #d7bde2;
}

.hps-mcard-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
    line-height: 1.4;
}

.hps-mcard-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #f1f5f9;
    align-items: flex-start;
}

.hps-mcard-row:last-child {
    border-bottom: none;
}

.hps-mcard-row strong {
    flex: 0 0 115px;
}

.hps-mcard-row span {
    flex: 1;
    text-align: right;
    color: #0f172a;
    word-break: break-word;
}

.hps-mcard-sunrow {
    background: #f8fafc;
    border-radius: 5px;
    padding: 8px 10px !important;
    border-bottom: none !important;
    display: flex;
    justify-content: space-between;
}

.hps-sun-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   RESPONSIVE SWITCHING (At 768px Breakpoint)
   ========================================================================== */
@media (max-width: 768px) {
    #calendar .button-container.hps-month-nav-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    #calendar .button-container.hps-month-nav-header .hps-nav-button {
        font-size: 13px;
        padding: 6px 14px;
    }

    /* Show Mobile Controls & Day Cards by Default on Mobile */
    .hps-mobile-controls {
        display: flex;
    }
    .hps-mobile-calendar {
        display: flex;
    }
    .hps-desktop-calendar {
        display: none;
    }

    /* If user toggled to grid view on mobile */
    .hps-force-grid .hps-desktop-calendar {
        display: block !important;
    }
    .hps-force-grid .hps-mobile-calendar {
        display: none !important;
    }
}
