/* ====================================
   HEADER ENHANCEMENTS - Prayer Times & Store Status
   Top Bar Pink Background Version
   ==================================== */

/* Header Layout Update */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #212121;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.logo .tagline {
    font-size: 12px;
    color: #666;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

/* Legacy header widgets container (deprecated - widgets now in top bar) */
.header-widgets {
    display: none;
}

/* ====================================
   PRAYER TIMES WIDGET - Top Bar Pink Background
   ==================================== */

.prayer-times-widget {
    position: relative;
    z-index: 1000; /* Ensure dropdown appears above all content */
}

.prayer-times-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    color: white;
}

.prayer-times-compact:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.prayer-times-compact .icon {
    font-size: 14px;
}

.prayer-info {
    display: flex;
    flex-direction: column;
    min-width: 65px;
}

.prayer-name {
    font-weight: 600;
    color: white;
    font-size: 11px;
}

.prayer-time {
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
}

.prayer-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    padding: 0 4px;
    transition: transform 0.2s;
}

.prayer-toggle:active {
    transform: rotate(180deg);
}

/* Prayer Times Dropdown */
.prayer-dropdown {
    position: fixed; /* Use fixed to escape all parent containers */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000; /* Very high z-index to appear above everything */
    min-width: 200px;
    padding: 8px 0;
    animation: slideDown 0.2s ease;
    max-height: 400px;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prayer-list {
    display: flex;
    flex-direction: column;
}

.prayer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.prayer-item:last-child {
    border-bottom: none;
}

.prayer-item:hover {
    background: #f9f9f9;
}

.prayer-item.done {
    opacity: 0.6;
}

.prayer-item.next {
    background: #f0f8ff;
    font-weight: 500;
}

.prayer-item .name {
    font-weight: 500;
    color: #212121;
    min-width: 60px;
}

.prayer-item .time {
    color: #666;
    text-align: right;
    font-size: 12px;
}

.prayer-item .status {
    color: #999;
    font-size: 12px;
    margin-left: 8px;
}

.prayer-date {
    display: block;
    text-align: center;
    padding: 8px;
    color: #999;
    font-size: 11px;
}

/* ====================================
   STORE STATUS WIDGET - Top Bar Pink Background
   ==================================== */

.store-status-widget {
    position: relative;
    display: flex;
    align-items: center;
}

.status-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
}

.status-text {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-hours {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.status-dot.open {
    background: #4caf50;
}

.status-dot.closed {
    background: #f44336;
    animation: none;
}

.status-dot.emergency {
    background: #ff9800;
    animation: pulse-orange 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-orange {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}


/* ====================================
   MOBILE RESPONSIVE - Top Bar Widgets
   ==================================== */

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        padding: 8px 0;
    }

    .prayer-times-compact,
    .status-display {
        padding: 5px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .prayer-info {
        min-width: 55px;
    }

    .prayer-name {
        font-size: 10px;
    }

    .prayer-time {
        font-size: 9px;
    }

    .prayer-dropdown {
        right: auto;
        left: -60px;
        width: 280px;
    }

    .status-modal {
        right: auto;
        left: -80px;
        width: 240px;
    }
}

@media (max-width: 480px) {
    .prayer-times-compact,
    .status-display {
        font-size: 10px;
        padding: 4px 6px;
    }

    .prayer-times-compact .icon {
        font-size: 12px;
    }

    .prayer-info {
        min-width: 50px;
    }

    .prayer-name {
        font-size: 9px;
    }

    .prayer-time {
        font-size: 8px;
    }

    /* Hide part of status text on very small screens */
    .status-text {
        max-width: 45px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }
}

/* ====================================
   TOP SELLERS SECTION
   ==================================== */

.top-sellers-section {
    padding: 24px 0;
}

.section-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    padding: 0 0 8px 0;
    border-bottom: 2px solid #e0e0e0;
}

.section-header-compact h3 {
    font-size: 18px;
    font-weight: 600;
    color: #212121;
    margin: 0;
}

.section-header-compact .refresh-info {
    font-size: 11px;
    color: #999;
}

/* Top Sellers Grid */
.top-sellers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.seller-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.seller-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #d0d0d0;
}

.rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e91e63;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
}

.rank-badge.new {
    background: #ff9800;
}

.product-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin: 20px 0 8px 0;
}

.product-quick-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-size: 12px;
    font-weight: 600;
    color: #212121;
    margin: 0;
    line-height: 1.3;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    color: #666;
}

.sales-badge {
    background: #fff3e0;
    padding: 2px 4px;
    border-radius: 3px;
    color: #e65100;
    font-weight: 500;
}

.rating {
    font-size: 11px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.price {
    font-size: 13px;
    font-weight: 700;
    color: #e91e63;
}

.btn-quick-add {
    background: #e91e63;
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-quick-add:hover {
    background: #c2185b;
}

.update-info {
    margin-top: 12px;
    text-align: center;
    font-size: 11px;
    color: #999;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .top-sellers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-thumb {
        height: 100px;
    }

    .product-name {
        font-size: 11px;
        min-height: 28px;
    }
}

@media (max-width: 480px) {
    .top-sellers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .seller-card {
        padding: 8px;
    }

    .product-thumb {
        height: 80px;
        margin: 16px 0 6px 0;
    }

    .product-name {
        font-size: 10px;
    }
}

/* ====================================
   QUICK SERVICES SECTION
   ==================================== */

.quick-services-section {
    padding: 16px 0;
}

.quick-services-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.quick-services-header:hover {
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
    transform: translateY(-2px);
}

.quick-services-header:active {
    transform: translateY(0);
}

.header-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-label .icon {
    font-size: 18px;
}

.toggle-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.quick-services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.quick-service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 80px;
    justify-content: center;
}

.service-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #d0d0d0;
    transform: translateY(-2px);
}

.service-btn:active {
    transform: translateY(0);
}

.service-icon {
    font-size: 24px;
}

.service-name {
    font-size: 12px;
    font-weight: 600;
    color: #212121;
    text-align: center;
}

@media (max-width: 768px) {
    .quick-services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }

    .service-btn {
        padding: 10px;
        min-height: 70px;
    }

    .service-icon {
        font-size: 20px;
    }

    .service-name {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .quick-services-header {
        padding: 10px 12px;
        font-size: 14px;
    }

    .quick-services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 6px;
        margin-top: 8px;
    }

    .service-btn {
        padding: 8px;
        min-height: 60px;
    }

    .service-icon {
        font-size: 18px;
    }

    .service-name {
        font-size: 10px;
    }
}

/* ====================================
   NEWS & ANNOUNCEMENTS SECTION
   ==================================== */

.news-section {
    padding: 20px 0;
}

.view-all-link {
    font-size: 12px;
    color: #e91e63;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #c2185b;
    text-decoration: underline;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #d0d0d0;
    transform: translateY(-2px);
}

.news-item.placeholder {
    cursor: default;
    padding: 24px 12px;
    text-align: center;
    background: #f9f9f9;
}

.news-item.placeholder:hover {
    box-shadow: none;
    border-color: #e0e0e0;
    transform: none;
}

.news-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1.5;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #212121;
    margin: 0;
    line-height: 1.4;
}

.news-excerpt {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-date {
    font-size: 11px;
    color: #999;
}

.news-item.placeholder h4 {
    color: #999;
    font-size: 13px;
}

.news-item.placeholder p {
    margin: 0;
    color: #bbb;
    font-size: 11px;
}

@media (max-width: 768px) {
    .section-header-compact {
        font-size: 14px;
    }

    .news-item {
        padding: 10px;
        gap: 10px;
    }

    .news-icon {
        font-size: 20px;
    }

    .news-content h4 {
        font-size: 13px;
    }

    .news-excerpt {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .news-item {
        padding: 8px;
        gap: 8px;
    }

    .news-icon {
        font-size: 18px;
    }

    .news-content h4 {
        font-size: 12px;
    }

    .news-excerpt {
        font-size: 10px;
    }

    .news-date {
        font-size: 10px;
    }
}

@media (prefers-color-scheme: dark) {
    /* Fix Logo Text */
    .logo h1 {
        color: var(--text-main) !important; /* Forces white text in dark mode */
    }
    
    /* Fix Tagline */
    .logo .tagline {
        color: var(--text-muted) !important;
    }

    /* Fix News/Prayer Widgets */
    .news-item.placeholder {
        background: var(--bg-input); /* Was #f9f9f9 */
        border-color: var(--border-color);
    }
    .news-content h4 {
        color: var(--text-main);
    }
}

/* =========================================================
   DARK MODE OVERRIDES (Must be in this file to work!)
   ========================================================= */

/* =========================================================
   DARK MODE OVERRIDES (TOGGLE COMPATIBLE)
   Add to bottom of frontend/css/header-enhancements.css
   ========================================================= */

/* 1. News & Announcements (Forces Dark Grey on Toggle) */
[data-theme="dark"] .news-item,
[data-theme="dark"] .news-item.placeholder {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    box-shadow: none !important;
}

[data-theme="dark"] .news-content h4 {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .news-excerpt,
[data-theme="dark"] .news-date,
[data-theme="dark"] .news-item.placeholder p {
    color: #a0a0a0 !important;
}

/* 2. Quick Services (The Icon Grid) */
[data-theme="dark"] .quick-services-grid {
    background-color: #2d2d2d !important;
    border-color: #333 !important;
}

[data-theme="dark"] .service-btn {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .service-name {
    color: #e0e0e0 !important;
}

/* 3. Top Sellers (Horizontal Scroll) */
[data-theme="dark"] .seller-card {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

[data-theme="dark"] .seller-card .product-name {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .section-header-compact h3 {
    color: #e0e0e0 !important;
}
