/* General Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background-color: #f8f9fa;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero-section h1 {
    color: white;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.9);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* QR Code Display */
.qr-code-container {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.qr-placeholder {
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

/* Input Forms */
.input-form {
    animation: fadeIn 0.3s ease;
}

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

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-check:checked + .btn-outline-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary {
    transition: all 0.2s ease;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Accordion */
.accordion-button {
    border-radius: 8px;
    font-weight: 500;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Steps */
.step-number {
    width: 60px;
    height: 60px;
    line-height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Badges */
.badge {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
}

/* Navbar */
.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
    
    .btn-group-vertical .btn {
        text-align: left;
    }
    
    /* Better spacing on mobile */
    .card-body {
        padding: 1rem;
    }
    
    /* Larger touch targets for mobile */
    .btn {
        min-height: 44px;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Stack columns on mobile */
    .row {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-section {
        padding: 2rem 0 !important;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    /* Optimize QR code display for small screens */
    .qr-code-container {
        padding: 15px;
        max-width: 100%;
    }
    
    #qrcode canvas, #qrcode img {
        max-width: 100%;
        height: auto !important;
        width: auto !important;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 991px) {
    .col-lg-7, .col-lg-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
    }
    
    .form-check-input {
        width: 1.5em;
        height: 1.5em;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* QR Code Canvas Styling */
#qrcode canvas, #qrcode img {
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* Success Message */
.alert {
    border-radius: 8px;
    border: none;
}

/* Color Picker Enhancement */
.form-control-color {
    height: 45px;
    cursor: pointer;
}

/* Range Slider Enhancement */
.form-range {
    height: 8px;
}

.form-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
}

/* Feature Cards Animation */
#features .card {
    transition: all 0.3s ease;
}

#features .card:hover {
    transform: translateY(-5px);
}

/* Shadow Utilities */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Radio Button Group Enhancement */
.btn-check + .btn {
    margin-bottom: 0.5rem;
}

/* Ensure QR code container is centered */
#qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Empty state styling */
#qrcode:empty + #qrPlaceholder {
    display: block;
}

#qrcode:not(:empty) ~ #qrPlaceholder {
    display: none !important;
}
