/* Ham Radio Dude Store - Clean, Readable Design for Ham Radio Operators */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #1f2940;
    --text-primary: #f5f5f5;
    --text-secondary: #b0b0b0;
    --accent: #f77f00;
    --accent-hover: #ff9500;
    --success: #00b894;
    --danger: #e74c3c;
    --warning: #f39c12;
    --border: #2d3a52;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 18px;
}

/* Header */
.header {
    background: var(--bg-secondary);
    padding: 20px 0;
    border-bottom: 3px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--accent);
}

.logo h1 {
    font-size: 28px;
    color: var(--text-primary);
    font-weight: 700;
}

.logo h1 span {
    color: var(--accent);
}

/* Navigation */
.nav {
    display: flex;
    gap: 10px;
}

.nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s;
    background: var(--bg-card);
}

.nav a:hover, .nav a.active {
    background: var(--accent);
    color: white;
}

/* Shop Status Banner */
.shop-status {
    background: var(--warning);
    color: #1a1a1a;
    padding: 15px 20px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.shop-status.vacation {
    background: #e67e22;
}

/* Announcements Banner */
.announcements-ticker {
    background: linear-gradient(90deg, #f77f00, #ff9500, #f77f00);
    padding: 14px 20px;
    text-align: center;
}

.ticker-content {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

/* Main Content */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 32px;
    color: var(--text-primary);
    border-left: 5px solid var(--accent);
    padding-left: 15px;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Product Card */
.product-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    border: 2px solid var(--border);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    border-color: var(--accent);
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: var(--bg-secondary);
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* SOLD OUT Badge - Top Right Corner */
.sold-out-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.sold-out-badge {
    background: var(--danger);
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.5);
    border: 2px solid white;
    letter-spacing: 1px;
    border-radius: 4px;
}

/* Low Stock Badge */
.low-stock-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--warning);
    color: #1a1a1a;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    z-index: 5;
}

/* Product Info */
.product-info {
    padding: 20px;
}

.product-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.product-stock {
    font-size: 16px;
    color: var(--text-secondary);
}

.product-stock.in-stock {
    color: var(--success);
}

.product-stock.low-stock {
    color: var(--warning);
}

.product-stock.out-of-stock {
    color: var(--danger);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.modal-close:hover {
    background: var(--danger);
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
    }
}

.modal-image {
    position: relative;
}

.modal-image img {
    width: 100%;
    height: auto;
    border-radius: 12px 0 0 12px;
}

@media (max-width: 768px) {
    .modal-image img {
        border-radius: 12px 12px 0 0;
    }
}

.modal-details {
    padding: 30px;
    padding-left: 0;
}

@media (max-width: 768px) {
    .modal-details {
        padding: 20px;
    }
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 15px;
}

.modal-stock {
    font-size: 20px;
    margin-bottom: 20px;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
}

.modal-stock.in-stock {
    background: rgba(0, 184, 148, 0.2);
    color: var(--success);
}

.modal-stock.out-of-stock {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.modal-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 25px;
    max-height: 350px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.buy-button {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 18px 50px;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.3s, transform 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.buy-button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.buy-button.disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    pointer-events: none;
}

.notify-button {
    display: inline-block;
    background: #00b894;
    color: white;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.3s, transform 0.2s;
    text-align: center;
    margin-top: 10px;
}

.notify-button:hover {
    background: #00a383;
    transform: scale(1.05);
}

/* Announcements */
.announcements {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    border-left: 5px solid var(--accent);
}

.announcement {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.announcement:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.announcement:first-child {
    padding-top: 0;
}

.announcement-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.announcement-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.announcement-content {
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Charts Section */
.charts-section {
    margin-top: 50px;
}

.chart-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.chart-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 30px;
    text-align: center;
    margin-top: 50px;
    border-top: 3px solid var(--border);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Products Message */
.no-products {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 12px;
}

.no-products h3 {
    font-size: 28px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.no-products p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Filter Buttons */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.filter-btn {
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo h1 {
        font-size: 22px;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .sold-out-badge {
        font-size: 24px;
        padding: 15px 25px;
    }

    .product-title {
        font-size: 18px;
    }

    .product-price {
        font-size: 24px;
    }
}

/* Last Updated */
.last-updated {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 20px;
}
