* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #e63946 0%, #0f3460 50%, #3498db 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 3px solid #f4d03f;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='30' cy='30' r='14' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='2'/%3E%3Cline x1='16' y1='30' x2='44' y2='30' stroke='rgba(255,255,255,0.08)' stroke-width='2'/%3E%3Ccircle cx='30' cy='30' r='4' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='2'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-nav {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.nav-link.active {
    color: #1a1a2e;
    background: #f4d03f;
    border-color: #f4d03f;
}

/* Main */
.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Hero */
.guide-hero {
    text-align: center;
    padding: 2rem 1rem;
}

.guide-hero h2 {
    font-size: 1.8rem;
    color: #f4d03f;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* Filter Controls */
.guide-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: rgba(15, 52, 96, 0.4);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.filter-group {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    background: #3498db;
    color: #fff;
}

/* Section Headers */
.section-header {
    font-size: 1.2rem;
    color: #3498db;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
    margin-bottom: 1rem;
}

/* Best Days Table */
.best-days-section {
    margin-bottom: 2rem;
}

.best-days-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.best-days-grid thead {
    background: rgba(0, 0, 0, 0.3);
}

.best-days-grid th {
    text-align: center;
    padding: 0.6rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
}

.best-days-grid th:first-child,
.best-days-grid th:last-child {
    text-align: left;
}

.best-days-grid td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.best-days-grid tr:hover {
    background: rgba(52, 152, 219, 0.08);
}

.best-days-grid tbody tr:nth-child(even) {
    background: rgba(22, 33, 62, 0.3);
}

.best-days-grid tbody tr:nth-child(even):hover {
    background: rgba(52, 152, 219, 0.08);
}

.retailer-name-cell {
    text-align: left !important;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    padding-left: 0.75rem !important;
}

.day-cell {
    width: 40px;
}

.day-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.notes-cell {
    text-align: left !important;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.table-disclaimer {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    font-style: italic;
}

/* Product Matrix */
.matrix-section {
    margin-bottom: 2rem;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.matrix-table thead {
    background: rgba(0, 0, 0, 0.3);
}

.matrix-table th {
    text-align: center;
    padding: 0.6rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
}

.matrix-table th:first-child {
    text-align: left;
}

.matrix-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.matrix-table tr:hover {
    background: rgba(52, 152, 219, 0.08);
}

.matrix-table tbody tr:nth-child(even) {
    background: rgba(22, 33, 62, 0.3);
}

.matrix-table tbody tr:nth-child(even):hover {
    background: rgba(52, 152, 219, 0.08);
}

.matrix-cell {
    width: 60px;
}

.matrix-check {
    font-size: 1rem;
    font-weight: 700;
}

.matrix-dash {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
}

/* Retailer Cards */
.cards-section {
    margin-bottom: 2rem;
}

.retailer-card {
    background: rgba(22, 33, 62, 0.6);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 1rem;
    border: 1px solid rgba(52, 152, 219, 0.15);
    border-left: 4px solid #3498db;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.retailer-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.retailer-card.expanded {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.retailer-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.retailer-card-header:hover {
    background: rgba(52, 152, 219, 0.05);
}

.retailer-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.retailer-card-title h4 {
    font-size: 1.1rem;
    color: #fff;
}

.retailer-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.retailer-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.confidence-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conf-high {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.conf-moderate {
    background: rgba(244, 208, 63, 0.2);
    color: #f4d03f;
    border: 1px solid rgba(244, 208, 63, 0.4);
}

.conf-low {
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
    border: 1px solid rgba(230, 126, 34, 0.4);
}

.conf-unpredictable {
    background: rgba(230, 57, 70, 0.2);
    color: #e63946;
    border: 1px solid rgba(230, 57, 70, 0.4);
}

.expand-arrow {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease;
}

.expand-arrow.expanded {
    transform: rotate(180deg);
}

/* Card Summary */
.retailer-card-summary {
    padding: 0 1.25rem 1rem;
}

.restock-days-visual {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.day-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.day-circle.active {
    border-color: currentColor;
}

.day-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.day-circle.active .day-label {
    color: #fff;
}

.summary-details {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.summary-item {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.summary-item strong {
    color: rgba(255, 255, 255, 0.9);
}

/* Card Details (expandable) */
.retailer-card-details {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid rgba(52, 152, 219, 0.15);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h5 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #3498db;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-section p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 0.25rem;
}

.detail-note {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic;
}

.detail-meta {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Product Tags */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.product-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: rgba(244, 208, 63, 0.1);
    color: #f4d03f;
    border: 1px solid rgba(244, 208, 63, 0.3);
    border-radius: 12px;
    font-weight: 600;
}

/* Pro Tips */
.pro-tips-list {
    list-style: none;
    padding: 0;
}

.pro-tips-list li {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    padding: 0.3rem 0 0.3rem 1.2rem;
    position: relative;
}

.pro-tips-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: #f4d03f;
    font-size: 1.1rem;
    line-height: 1.4;
}


/* No retailers message */
.no-retailers {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

/* Disclaimer */
.guide-disclaimer {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(230, 57, 70, 0.08);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.guide-disclaimer strong {
    color: #e63946;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-nav {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .guide-hero h2 {
        font-size: 1.4rem;
    }

    .guide-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        justify-content: center;
    }

    .best-days-grid,
    .matrix-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .restock-days-visual {
        gap: 0.25rem;
    }

    .day-circle {
        width: 30px;
        height: 30px;
    }

    .day-label {
        font-size: 0.5rem;
    }

    .retailer-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .retailer-card-meta {
        align-self: flex-end;
    }

    .summary-details {
        flex-direction: column;
        gap: 0.25rem;
    }


    .retailer-card-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 1rem 0.75rem;
    }

    .retailer-card-header {
        padding: 1rem;
    }

    .retailer-card-summary {
        padding: 0 1rem 0.75rem;
    }

    .retailer-card-details {
        padding: 0 1rem 1rem;
    }

    .filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    margin-left: auto;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
}
@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .header-nav { display: none; width: 100%; flex-direction: column; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.2); }
    .header-nav.active { display: flex; }
    .nav-link { text-align: center; padding: 0.75rem 1rem; font-size: 1rem; }
    .header-content { flex-wrap: wrap; }
    .app-title { font-size: 1.4rem; }
}
@media (max-width: 480px) {
    .app-header { padding: 1rem; }
    .app-title { font-size: 1.2rem; }
    .nav-link { font-size: 0.9rem; padding: 0.6rem 0.75rem; }
}
