/**
 * Main CSS File - SafeQuote Traditional Theme
 * Custom styles that complement Tailwind CSS
 */

/* CSS Variables from React App - EXACT MATCH */
:root {
    --background: 0 0% 100%;
    --foreground: 224 71.4% 4.1%;
    --card: 0 0% 100%;
    --card-foreground: 224 71.4% 4.1%;
    --popover: 0 0% 100%;
    --popover-foreground: 224 71.4% 4.1%;
    --primary: 195 90% 40%; /* Teal */
    --primary-foreground: 210 20% 98%;
    --secondary: 35 85% 90%; /* Warm Sand */
    --secondary-foreground: 224 71.4% 4.1%;
    --muted: 210 20% 94%;
    --muted-foreground: 215 25% 27%;
    --accent: 210 20% 94%;
    --accent-foreground: 224 71.4% 4.1%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 20% 98%;
    --border: 215 28% 90%;
    --input: 215 28% 85%;
    --ring: 195 90% 45%;
    --radius: 0.75rem;

    /* Converted colors for CSS usage */
    --color-primary: hsl(195, 90%, 40%); /* Teal */
    --color-secondary: hsl(35, 85%, 90%); /* Warm Sand */
    --color-primary-foreground: hsl(210, 20%, 98%);
    --color-secondary-foreground: hsl(224, 71.4%, 4.1%);
    --color-background: hsl(0, 0%, 100%);
    --color-border: hsl(215, 28%, 90%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: rgb(17 24 39); /* text-gray-900 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* React app uses bg-gray-50 in App.jsx */
    background-color: rgb(249 250 251); /* bg-gray-50 */
    min-height: 100vh;
}

/* WordPress Admin Bar Adjustment */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

/* Custom Component Styles */

/* Vehicle Cards */
.vehicle-card {
    transition: all 0.3s ease;
}

.vehicle-card:hover {
    transform: translateY(-4px);
}

.vehicle-card-image {
    object-fit: cover;
}

/* Safety Rating Stars */
.safety-star svg {
    width: 20px;
    height: 20px;
}

.safety-star-filled {
    color: #fbbf24;
    fill: currentColor;
}

.safety-star-empty {
    color: #d1d5db;
    fill: currentColor;
}

/* Form Elements */
.form-input,
.form-select {
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px hsla(195, 90%, 40%, 0.1); /* Teal focus ring */
}

.is-invalid {
    border-color: #ef4444 !important;
}

.is-valid {
    border-color: #10b981 !important;
}

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

/* Navigation */
.nav-link {
    transition: all 0.2s ease;
}

/* Mobile Menu */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Modals */
.modal {
    display: none;
}

.modal.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.modal-backdrop {
    animation: fadeIn 0.3s ease;
}

/* Notifications */
.notification {
    animation: slideInRight 0.3s ease;
    margin-bottom: 1rem;
}

.notification-success {
    background: #10b981;
    color: white;
}

.notification-error {
    background: #ef4444;
    color: white;
}

.notification-warning {
    background: #f59e0b;
    color: white;
}

.notification-info {
    background: hsl(195, 90%, 40%); /* Teal instead of blue */
    color: white;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

.slide-in-up {
    animation: slideInUp 0.3s ease;
}

.slide-in-down {
    animation: slideInDown 0.3s ease;
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

.spin {
    animation: spin 1s linear infinite;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Loading Spinner */
.spinner {
    border: 3px solid hsla(195, 90%, 40%, 0.1); /* Teal */
    border-left-color: hsl(195, 90%, 40%); /* Teal */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* WordPress Specific Styles */
.wp-block {
    max-width: 100%;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
}

/* Pagination */
.page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.page-numbers:hover {
    background-color: #f3f4f6;
}

.page-numbers.current {
    background-color: hsl(195, 90%, 40%); /* Teal */
    color: white;
    border-color: hsl(195, 90%, 40%); /* Teal */
}

/* Screen Reader Only */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .navigation,
    .btn,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .container {
        width: 100%;
        max-width: none;
    }
}