/* Modern UI Enhancements for Thuong Motor Website */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* Modern CSS Variables & Design System */
:root {
    /* Brand Colors */
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Typography */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-secondary: 'Playfair Display', Georgia, serif;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    --gradient-success: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
    --gradient-warning: linear-gradient(135deg, var(--warning-color) 0%, #fbbf24 100%);
    --gradient-danger: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
    --gradient-dark: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-700) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

/* Global Enhancements */
* {
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: var(--font-family-primary);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Default Light Theme */
body {
    background-color: #ffffff;
    color: #000000;
}

/* Light Theme */
[data-theme="light"] {
    /* Light Theme Color Variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

[data-theme="light"] body {
    background-color: #ffffff;
    color: #1e293b;
}

[data-theme="light"] .header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .navbar-light .navbar-nav .nav-link {
    color: #1e293b !important;
    font-weight: 500;
}

[data-theme="light"] .navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

[data-theme="light"] .bg-light {
    background-color: #f8fafc !important;
}

[data-theme="light"] .bg-white {
    background-color: #ffffff !important;
}

[data-theme="light"] .news-section {
    background-color: #f8fafc !important;
}

[data-theme="light"] .news-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .contact-section {
    background-color: #f8fafc !important;
}

/* Light theme text colors */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
    color: #1e293b !important;
}

[data-theme="light"] p,
[data-theme="light"] span,
[data-theme="light"] div {
    color: #475569;
}

[data-theme="light"] .text-muted {
    color: #64748b !important;
}

[data-theme="light"] .text-dark {
    color: #1e293b !important;
}

[data-theme="light"] .text-secondary {
    color: #475569 !important;
}

[data-theme="light"] .section-title {
    color: #1e293b !important;
}

[data-theme="light"] .lead {
    color: #1e293b !important;
}

/* Featured News section - White text for light theme */
[data-theme="light"] .featured-news-content h3 {
    color: #ffffff !important;
    font-weight: 700;
}

[data-theme="light"] .featured-news-content p {
    color: #ffffff !important;
    font-weight: 600;
}

/* Light theme cards */
[data-theme="light"] .card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

[data-theme="light"] .service-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .footer {
    background-color: #1e293b !important;
    color: #ffffff;
}

/* Light theme toggle button */
[data-theme="light"] .theme-toggle {
    border-color: #e2e8f0;
    color: #475569;
}

[data-theme="light"] .theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Selection Styling */
::selection {
    background-color: var(--primary-color);
    color: white;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modern Button Styles */
.btn-modern {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-family-primary);
    font-weight: 500;
    font-size: var(--text-sm);
    line-height: 1.5;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    overflow: hidden;
    z-index: 1;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    z-index: -1;
}

.btn-modern:hover::before {
    transform: translateX(100%);
}

.btn-primary-modern {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* Glass Morphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

/* Modern Product Cards */
.product-card-modern {
    position: relative;
    background: white;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--gray-200);
}

.product-card-modern:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-color);
}

.product-card-modern .product-image-modern {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.product-card-modern .product-image-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card-modern:hover .product-image-modern img {
    transform: scale(1.1);
}

.product-badge-modern {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    padding: var(--space-2) var(--space-3);
    background: var(--gradient-primary);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

.product-info-modern {
    padding: var(--space-6);
}

.product-title-modern {
    font-family: var(--font-family-secondary);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
    line-height: 1.3;
}

.product-specs-modern {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.product-specs-modern span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.product-specs-modern i {
    color: var(--primary-color);
}

.product-price-modern {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--danger-color);
    margin-bottom: var(--space-4);
}

.product-actions-modern {
    display: flex;
    gap: var(--space-3);
}

/* Floating Action Button */
.fab-modern {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-xl);
    text-decoration: none;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-base);
    z-index: 1000;
}

.fab-modern:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-2xl);
    color: white;
}

/* Modern Navigation */
.navbar-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

.navbar-modern.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

/* Hero Section Modern */
.hero-modern {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    overflow: hidden;
}

.hero-modern::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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content-modern {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
}

.hero-title-modern {
    font-family: var(--font-family-secondary);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-6);
    background: linear-gradient(135deg, white 0%, var(--gray-300) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle-modern {
    font-size: var(--text-xl);
    color: var(--gray-300);
    margin-bottom: var(--space-8);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Animated Background */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-color) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s ease-in-out infinite;
    opacity: 0.1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Loading Animation */
.loading-modern {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Pulse Animation */
.pulse-modern {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Bounce Animation */
.bounce-modern {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0, 0, 0); }
    40%, 43% { transform: translate3d(0, -30px, 0); }
    70% { transform: translate3d(0, -15px, 0); }
    90% { transform: translate3d(0, -4px, 0); }
}

/* Enhanced Search Styles */
.search-enhanced {
    position: relative;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-family: var(--font-family-primary);
    background: white;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.search-enhanced:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.search-enhanced::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

/* Search Results Container */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: var(--space-2);
    display: none;
    animation: fadeInUp 0.3s ease-out;
}

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

/* Search Result Items */
.search-result-item {
    border-bottom: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-item a {
    display: block;
    padding: var(--space-4);
    text-decoration: none;
    color: inherit;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.result-type {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    background: var(--primary-color);
    color: white;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
    margin-bottom: var(--space-1);
}

.result-title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.result-description {
    font-size: var(--text-xs);
    color: var(--gray-600);
    line-height: 1.4;
}

/* No Results */
.no-results {
    padding: var(--space-6);
    text-align: center;
    color: var(--gray-500);
    font-size: var(--text-sm);
}

.no-results i {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2);
    color: var(--gray-400);
}

/* Search More */
.search-more {
    padding: var(--space-3) var(--space-4);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--gray-500);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    font-style: italic;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--gray-600);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

.theme-toggle.rotating {
    animation: rotate360 0.3s ease-in-out;
}

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

/* Dark theme styles removed - Light theme only */



/* Toast Notifications */
.toast {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--info-color);
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-danger {
    border-left-color: var(--danger-color);
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--gray-800);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    font-size: var(--text-lg);
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    margin-left: var(--space-3);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--gray-600);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 9999;
    transition: width var(--transition-fast);
}

/* Responsive Design */
@media (max-width: 768px) {
    .btn-modern {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-xs);
    }

    .product-info-modern {
        padding: var(--space-4);
    }

    .fab-modern {
        width: 50px;
        height: 50px;
        bottom: var(--space-4);
        right: var(--space-4);
        font-size: var(--text-lg);
    }

    .search-enhanced {
        width: 200px !important;
        font-size: var(--text-xs);
    }

    .search-results {
        max-height: 300px;
    }

    .toast {
        min-width: 280px;
        right: var(--space-2);
        top: var(--space-2);
    }

    .theme-toggle {
        width: 35px;
        height: 35px;
    }
}
