/**
 * Common Styles for Receipt Manager
 *
 * Extracted from inline styles across all templates.
 * This file contains shared CSS variables, base styles, and component styles
 * used throughout the application.
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --bs-primary-rgb: 13, 110, 253;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

/* ========================================
   Base Styles
   ======================================== */
html {
    /* Prevent smooth scrolling that could cause jump during scroll restoration */
    scroll-behavior: auto !important;
}

body {
    background-color: #f8f9fa;
    /* Prevent scroll anchor adjustments */
    overflow-anchor: none;
    transition: opacity 0.2s ease-in-out;
}

body.page-transition {
    opacity: 0;
}

/* ========================================
   Navigation Bar
   ======================================== */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

#auth-nav {
    transition: opacity 0.3s ease-in;
}

#auth-nav.loading {
    opacity: 0;
}

/* ========================================
   Cards and Components
   ======================================== */
.stats-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stats-header h3 {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in;
}

.stats-header.loading h3 {
    opacity: 0;
}

.upload-card {
    background: var(--gradient-success);
    color: white;
    border-radius: 15px;
    border: none;
}

.chart-card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chart-card canvas {
    transition: opacity 0.3s ease-in;
}

.chart-card.loading canvas {
    opacity: 0;
}

.receipts-card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.filters-card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.status-selector-card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.review-card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.content-card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ========================================
   Buttons
   ======================================== */
.btn-upload {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    color: white;
    transform: translateY(-2px);
}

.btn-receipts {
    background: rgba(255,255,255,0.9);
    border: 2px solid rgba(255,255,255,0.5);
    color: #28a745;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-receipts:hover {
    background: white;
    border-color: white;
    color: #1e7e34;
    transform: translateY(-2px);
}

.period-btn {
    border-radius: 20px;
    padding: 8px 20px;
    margin: 0 5px;
    font-weight: 500;
}

/* ========================================
   Icons and Visual Elements
   ======================================== */
.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.divider {
    height: 1px;
    background: rgba(255,255,255,0.3);
    margin: 1.5rem 0;
}

.loading-spinner {
    color: rgba(255,255,255,0.7);
}

/* ========================================
   Chart Styles
   ======================================== */
#spending-chart {
    border-radius: 10px;
}

/* ========================================
   Receipt Review / Items Styles
   ======================================== */
.item-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.item-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.item-number {
    background: var(--gradient-primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 2px;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
}

.item-category-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   Receipt List / Table Styles
   ======================================== */
.receipt-item {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.receipt-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.receipt-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-confirmed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-draft {
    background-color: #fff3cd;
    color: #856404;
}

.status-in-review {
    background-color: #cfe2ff;
    color: #084298;
}

/* ========================================
   Homepage / Hero Styles
   ======================================== */
.hero-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.hero-heading {
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.hero-tagline {
    font-size: 1.5rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.btn-hero {
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 1.125rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.feature-card {
    border: none;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

/* ========================================
   Responsive Utilities
   ======================================== */
@media (max-width: 768px) {
    .hero-heading {
        font-size: 2.5rem;
    }

    .hero-tagline {
        font-size: 1.125rem;
    }

    .stats-header h3 {
        font-size: 1.25rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }
}

/* ========================================
   Form Styles
   ======================================== */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ========================================
   Modal Styles
   ======================================== */
.modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-footer {
    border-top: none;
    padding-top: 0;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.shadow-medium {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.shadow-strong {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* ========================================
   Maintenance Banner
   ======================================== */
.maintenance-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-weight: 500;
}

.maintenance-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.maintenance-banner .bi {
    font-size: 1.2rem;
}

/* Push body content down when maintenance banner is visible */
body.maintenance-active {
    padding-top: 50px;
}

@media (max-width: 768px) {
    .maintenance-banner {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .maintenance-banner-content {
        flex-direction: column;
        gap: 4px;
    }
}
