/* FlipFinder Main Stylesheet */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-error {
    color: var(--danger-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.form-error.show {
    display: block;
}

/* Landing Page */
.landing-container {
    min-height: 100vh;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 1rem;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.features {
    padding: 4rem 1rem;
    background-color: var(--surface-color);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--background-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.auth-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover {
    background-color: var(--background-color);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.nav-text {
    flex: 1;
}

.nav-badge {
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    display: none;
}

.nav-badge.show {
    display: inline-block;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    margin-bottom: 0.75rem;
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

#page-header {
    margin-bottom: 2rem;
}

#page-title {
    font-size: 1.75rem;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 3px 0;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

/* Deal Cards */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.deal-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.deal-card:hover {
    box-shadow: var(--shadow-md);
}

.deal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--border-color);
}

.deal-content {
    padding: 1rem;
}

.deal-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.deal-brand {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.deal-prices {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.deal-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.deal-msrp {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.deal-metrics {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.deal-metric {
    font-size: 0.875rem;
}

.deal-metric strong {
    color: var(--success-color);
}

.deal-score {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.deal-score.high {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.deal-score.medium {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.deal-score.low {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.deal-store {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Watchlist Items */
.watchlist-item {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.watchlist-info {
    flex: 1;
}

.watchlist-keyword {
    font-weight: 600;
}

.watchlist-upc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.watchlist-actions {
    display: flex;
    gap: 0.5rem;
}

/* Notifications */
.notification-item {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary-color);
}

.notification-item.unread {
    background: rgba(37, 99, 235, 0.05);
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu-overlay.show {
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}
