/* Custom CSS for Autohinnastaja.ee */

:root {
    /* Custom color variables for automotive theme */
    --automotive-blue: 210 100% 50%;  /* #0066FF */
    --automotive-dark: 210 15% 15%;   /* #1F2937 */
    --automotive-light: 210 11% 98%;  /* #F5F7FA */
    --success-green: 142 76% 36%;     /* #16A34A */
    --warning-orange: 45 93% 47%;     /* #EA580C */
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: var(--bs-body-bg);
    padding: 3rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 500px;
    margin: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--bs-border-color);
}

.loading-spinner {
    animation: pulse 2s infinite;
}

.trivia-container {
    background: var(--bs-light);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    border-left: 4px solid hsl(var(--automotive-blue));
}

.trivia-text {
    transition: opacity 0.3s ease;
    font-size: 1.1rem;
    margin: 0;
    color: var(--bs-body-color);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Body and general styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: var(--bs-body-bg);
}

/* Navigation styling */
.navbar {
    background: linear-gradient(135deg, hsl(var(--automotive-blue)), #ff8c00) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

/* Card styling */
.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* Form styling */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid var(--bs-border-color);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: hsl(var(--automotive-blue));
    box-shadow: 0 0 0 0.2rem hsla(var(--automotive-blue), 0.25);
}

/* Button styling */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background: linear-gradient(135deg, hsl(var(--automotive-blue)), hsl(var(--automotive-blue) / 0.8));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, hsl(var(--automotive-blue) / 0.9), hsl(var(--automotive-blue) / 0.7));
    transform: translateY(-1px);
}

/* Display utilities */
.display-4 {
    font-weight: 300;
    color: var(--bs-body-color);
}

/* Icon styling */
.fa-3x {
    font-size: 3rem;
}

/* Alert styling */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-info {
    background-color: hsla(var(--automotive-blue), 0.1);
    color: hsl(var(--automotive-blue));
    border-left: 4px solid hsl(var(--automotive-blue));
}

.alert-success {
    background-color: hsla(var(--success-green), 0.1);
    color: hsl(var(--success-green));
    border-left: 4px solid hsl(var(--success-green));
}

.alert-warning {
    background-color: hsla(var(--warning-orange), 0.1);
    color: hsl(var(--warning-orange));
    border-left: 4px solid hsl(var(--warning-orange));
}

.alert-danger {
    background-color: hsla(0, 84%, 60%, 0.1);
    color: hsl(0, 84%, 60%);
    border-left: 4px solid hsl(0, 84%, 60%);
}

/* Price display styling */
.text-success {
    color: hsl(var(--success-green)) !important;
    font-weight: bold;
}

/* Code blocks styling */
pre {
    background-color: var(--bs-dark) !important;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

code {
    background-color: hsla(var(--automotive-dark), 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

/* Accordion styling */
.accordion-button {
    border-radius: 8px !important;
}

.accordion-button:not(.collapsed) {
    background-color: hsla(var(--automotive-blue), 0.1);
    color: hsl(var(--automotive-blue));
}

/* Loading state styling */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Print styles */
@media print {
    .navbar, .btn, footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .text-success {
        color: #198754 !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Dark mode specific adjustments */
[data-bs-theme="dark"] {
    --bs-body-bg: hsl(var(--automotive-dark));
}

[data-bs-theme="dark"] .card {
    background-color: hsla(210, 15%, 20%, 1);
    border: 1px solid hsla(210, 15%, 25%, 1);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: hsla(210, 15%, 25%, 1);
    border-color: hsla(210, 15%, 30%, 1);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: hsla(210, 15%, 25%, 1);
    border-color: hsl(var(--automotive-blue));
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

/* Utility classes */
.text-primary {
    color: hsl(var(--automotive-blue)) !important;
}

.bg-primary {
    background-color: hsl(var(--automotive-blue)) !important;
}

.border-primary {
    border-color: hsl(var(--automotive-blue)) !important;
}

/* Custom spacing */
.py-6 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

.my-6 {
    margin-top: 4rem !important;
    margin-bottom: 4rem !important;
}
