/* ===================================
   DealTender Global Styles
   Applied to all pages for consistent look
   =================================== */

/* Import mobile-app.css for base styles */
@import url('mobile-app.css');

/* ===================================
   Enhanced Header Styles
   =================================== */

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.page-header nav {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.page-header nav a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    font-weight: 500;
}

.page-header nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }

    .page-header-content h1 {
        font-size: 20px;
    }

    .page-header nav {
        display: none;
    }
}

/* ===================================
   Stats Bar
   =================================== */

.stats-bar {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: 1px solid #eee;
}

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

.stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.last-update {
    font-size: 13px;
    color: #999;
}

/* ===================================
   Container & Layout
   =================================== */

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.page-container.with-sidebar {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

/* ===================================
   Sidebar
   =================================== */

.sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.filter-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.filter-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.filter-section select,
.filter-section input[type="number"],
.filter-section input[type="text"],
.filter-section input[type="email"],
.filter-section input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.filter-section select:focus,
.filter-section input:focus {
    outline: none;
    border-color: #667eea;
}

/* ===================================
   Buttons
   =================================== */

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

/* ===================================
   Cards
   =================================== */

.content-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* ===================================
   Toolbar
   =================================== */

.toolbar {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.search-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* ===================================
   Sort Tabs
   =================================== */

.sort-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-tabs a {
    color: #666;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.sort-tabs a:hover {
    background: #f0f0f0;
}

.sort-tabs a.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ===================================
   Deal Cards
   =================================== */

.deals-grid {
    display: grid;
    gap: 15px;
}

.deal-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.deal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.deal-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
}

.deal-info {
    flex: 1;
}

.deal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.source-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Source-specific badge colors */
.source-badge.slickdeals { background: #fd8024; color: white; }
.source-badge.amazon { background: #ff9900; color: white; }
.source-badge.walmart { background: #0071ce; color: white; }
.source-badge.target { background: #cc0000; color: white; }
.source-badge.homedepot { background: #f96302; color: white; }
.source-badge.lowes { background: #004990; color: white; }
.source-badge.harborfreight { background: #e21b23; color: white; }
.source-badge.bestbuy { background: #0046be; color: white; }

.store-name {
    font-size: 12px;
    color: #999;
}

.deal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.deal-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.deal-title a:hover {
    color: #667eea;
}

.deal-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
}

.deal-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 13px;
    color: #999;
    flex-wrap: wrap;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 12px;
    font-size: 12px;
}

.deal-pricing {
    text-align: right;
}

.current-price {
    font-size: 32px;
    font-weight: 700;
    color: #e21b23;
    line-height: 1;
}

.original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
}

.discount-badge {
    display: inline-block;
    background: #22c55e;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.deal-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.2s;
}

.deal-btn:hover {
    background: #5568d3;
}

/* ===================================
   Badges
   =================================== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ===================================
   Alerts & Messages
   =================================== */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===================================
   Empty States
   =================================== */

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
}

.no-results h2 {
    font-size: 24px;
    color: #999;
    margin-bottom: 10px;
}

.no-results p {
    color: #666;
    margin-bottom: 20px;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
    .page-container.with-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .deal-card {
        grid-template-columns: 100px 1fr;
    }

    .deal-pricing {
        grid-column: 2;
        text-align: left;
        margin-top: 10px;
    }

    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

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

    .deal-image {
        width: 100%;
        height: 200px;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }

    .sort-tabs {
        font-size: 12px;
    }

    .page-header h1 {
        font-size: 22px;
    }
}

/* ===================================
   Dark Mode Support
   =================================== */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: #3a3a3a;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --text-tertiary: #808080;
        --border-color: #404040;
        --divider-color: #404040;
    }

    :root:not([data-theme="light"]) .page-header {
        background: linear-gradient(135deg, #5568d3 0%, #6b51a6 100%);
    }

    :root:not([data-theme="light"]) .stats-bar {
        background: var(--bg-secondary);
        border-bottom-color: var(--border-color);
    }

    :root:not([data-theme="light"]) .content-card,
    :root:not([data-theme="light"]) .deal-card,
    :root:not([data-theme="light"]) .filter-section,
    :root:not([data-theme="light"]) .toolbar {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    :root:not([data-theme="light"]) .deal-title {
        color: var(--text-primary);
    }
}

/* ===================================
   Utility Classes
   =================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
