/* =========================================
   QU QR Reader - Custom Styles
   ========================================= */

/* ==================== ROOT VARIABLES ==================== */
:root {
    /* iOS Style Colors */
    --primary-color: #007AFF;
    --primary-dark: #0056CC;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --info-color: #5AC8FA;
    --secondary-color: #8E8E93;
    
    /* Background Colors */
    --bg-light: #F2F2F7;
    --bg-white: #FFFFFF;
    --bg-dark: #1C1C1E;
    
    /* Text Colors */
    --text-primary: #1D1D1F;
    --text-secondary: #6D6D80;
    --text-light: #8E8E93;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Spacing */
    --section-padding: 5rem 0;
    --card-padding: 2rem;
    
    /* Borders & Shadows */
    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
    --box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== GLOBAL STYLES ==================== */
* {
    box-sizing: border-box;
}

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

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Remove default margins */
h1, h2, h3, h4, h5, h6, p {
    margin: 0;
    padding: 0;
}

/* Links */
a {
    transition: var(--transition);
}

a:hover {
    text-decoration: none !important;
}

/* ==================== TYPOGRAPHY ==================== */
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
    line-height: 1.2;
}

.lead {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* ==================== NAVIGATION ==================== */
.navbar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary) !important;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    color: var(--text-primary) !important;
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(0, 122, 255, 0.1);
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    background: var(--gradient-hero);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="200" cy="200" r="2" fill="white" opacity="0.1"/><circle cx="800" cy="300" r="1.5" fill="white" opacity="0.15"/><circle cx="400" cy="600" r="1" fill="white" opacity="0.1"/><circle cx="900" cy="700" r="2.5" fill="white" opacity="0.1"/><circle cx="100" cy="800" r="1.5" fill="white" opacity="0.12"/></svg>');
    animation: float 20s ease-in-out infinite;
}

.hero-image-placeholder {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius-lg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ==================== GRADIENTS ==================== */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-hero {
    background: var(--gradient-hero) !important;
}

/* ==================== BUTTONS ==================== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
}

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

.btn-primary {
    background: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 122, 255, 0.4);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 149, 0, 0.3);
}

.btn-warning:hover {
    background: #e6850e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 149, 0, 0.4);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

/* ==================== CARDS ==================== */
.card {
    border-radius: var(--border-radius-lg);
    border: none;
    transition: var(--transition);
    overflow: hidden;
}

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

.card-body {
    padding: var(--card-padding);
}

/* Feature Cards */
.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== SECTIONS ==================== */
section {
    padding: var(--section-padding);
}

.section-header {
    margin-bottom: 4rem;
}

/* ==================== ACCORDION (FAQ) ==================== */
.accordion-item {
    border-radius: var(--border-radius) !important;
    overflow: hidden;
}

.accordion-button {
    font-weight: 600;
    padding: 1.5rem;
    background: var(--bg-white);
    border: none;
    box-shadow: none;
}

.accordion-button:not(.collapsed) {
    background: var(--primary-color);
    color: white;
    box-shadow: none;
}

.accordion-button::after {
    transition: var(--transition);
}

.accordion-body {
    padding: 1.5rem;
    background: var(--bg-light);
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--bg-dark) !important;
}

footer h5, footer h6 {
    color: white;
    font-weight: 600;
}

footer p, footer li {
    color: rgba(255, 255, 255, 0.8);
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

footer a:hover {
    color: white;
}

/* ==================== ALERTS & CALLOUTS ==================== */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1.25rem;
}

/* ==================== APP STORE BADGE ==================== */
.app-store-badge .btn {
    min-width: 200px;
    height: auto;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: #000;
    color: white;
}

.app-store-badge .btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ==================== ANIMATIONS ==================== */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Stagger animations for cards */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

/* ==================== RESPONSIVE DESIGN ==================== */

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .hero-section {
        padding: 0;
    }
    
    .section-header {
        margin-bottom: 5rem;
    }
    
    .card-body {
        padding: 2.5rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-section {
        min-height: 80vh;
        padding: 4rem 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-section {
        min-height: 70vh;
        padding: 3rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .hero-section {
        min-height: 60vh;
        padding: 2rem 0;
        text-align: center;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 0.95rem;
    }
    
    .btn-lg {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    section {
        padding: 2.5rem 0;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .feature-icon,
    .help-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i,
    .help-icon i {
        font-size: 1.5rem !important;
    }
    
    .navbar-brand {
        font-size: 1.125rem;
    }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus states for keyboard navigation */
.btn:focus,
.nav-link:focus,
.accordion-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        min-height: auto !important;
        padding: 2rem 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    * {
        background: white !important;
        color: black !important;
    }
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066CC;
        --text-primary: #000000;
        --text-secondary: #333333;
    }
    
    .card {
        border: 2px solid #000 !important;
    }
    
    .btn {
        border: 2px solid currentColor !important;
    }
}