/**
 * eBay Deal Monitor - Main Stylesheet
 * Navy Blue and Gold Theme
 */

/* CSS Variables */
:root {
    --navy-primary: #001f3f;
    --navy-dark: #002a5c;
    --navy-light: #003366;
    --gold-primary: #ffd700;
    --gold-light: #ffed4a;
    --gold-dark: #ccac00;
    --green-accent: #90ee90;
    --green-dark: #27ae60;
    --green-light: #c8f7c8;
    --red-danger: #dc3545;
    --red-light: #f8d7da;
    --gray-light: #f8f9fa;
    --gray-border: #dee2e6;
    --gray-text: #6c757d;
    --white: #ffffff;
    --black: #000000;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: var(--gray-light);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-dark) 100%);
    color: var(--gold-primary);
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: shimmer 10s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

header h1 {
    font-size: 2.5rem;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card h2 {
    color: var(--navy-primary);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--gold-primary);
    padding-bottom: 0.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-border);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray-text);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--gold-primary);
    color: var(--navy-primary);
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

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

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

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

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: var(--green-dark);
    color: var(--white);
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

.alert.success {
    background-color: var(--green-light);
    color: #155724;
    border: 1px solid var(--green-accent);
}

.alert.error {
    background-color: var(--red-light);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-dark) 100%);
    color: var(--gold-primary);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 60%);
    transition: var(--transition);
}

.stat-card:hover::before {
    top: -150%;
    left: -150%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background-color: var(--navy-primary);
    color: var(--gold-primary);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-border);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: rgba(255, 215, 0, 0.05);
}

/* Search Table Styles */
.searches-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.search-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.search-status.active {
    background-color: var(--green-light);
    color: var(--green-dark);
}

.search-status.inactive {
    background-color: var(--red-light);
    color: var(--red-danger);
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--gray-light);
    border-radius: 5px;
}

/* Tags (for exclusion terms) */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--navy-primary);
    color: var(--gold-primary);
    border-radius: 20px;
    font-size: 0.875rem;
    margin: 0.25rem;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-border);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card h2 {
        font-size: 1.5rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-text); }
.text-success { color: var(--green-dark); }
.text-danger { color: var(--red-danger); }
.text-gold { color: var(--gold-primary); }

.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-inline-block { display: inline-block; }
.d-flex { display: flex; }

.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Print Styles */
@media print {
    header, .btn, .bulk-actions {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}