/* Custom CSS for RMA Tools - Mensch Digital Solutions Inspired */

/* CSS Variables for theming */
:root {
    /* Light theme colors */
    --primary-color: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #06b6d4;
    --secondary-color: #059669;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* RGB values for rgba() usage */
    --primary-color-rgb: 8, 145, 178;
    --secondary-color-rgb: 5, 150, 105;
    --accent-color-rgb: 6, 182, 212;
    
    /* Light theme backgrounds */
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --surface-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    
    /* Light theme text colors */
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    
    /* Shadows and borders */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-color: #e2e8f0;
    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
    
    /* Animations */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Dark theme colors */
[data-bs-theme="dark"] {
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --surface-color: #1e293b;
    --glass-bg: rgba(15, 23, 42, 0.8);
    --navbar-bg: rgba(15, 23, 42, 0.95);
    
    --text-color: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --border-color: #334155;
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #ffffff;
    color: #1e293b;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
    position: relative;
}

/* Dark theme - explicit override */
[data-bs-theme="dark"] body {
    background: #0f172a !important;
    color: #f8fafc !important;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

.display-3 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navbar */
.navbar-brand {
    color: #1e293b !important;
    font-weight: 700;
    font-size: 1.5rem;
}

[data-bs-theme="dark"] .navbar-brand {
    color: #f8fafc !important;
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

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

.btn-modern-secondary {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    font-weight: 600;
    transition: all var(--transition-normal);
}

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

/* Glass Effects */
.liquid-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

[data-bs-theme="dark"] .liquid-glass {
    background: var(--glass-bg) !important;
    border-color: var(--border-color) !important;
}

/* Form Controls */
.form-control,
.form-select {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-fast);
    color: var(--text-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
    background: var(--surface-color);
    color: var(--text-color);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: var(--bg-tertiary) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background: var(--bg-tertiary) !important;
    color: var(--text-color) !important;
    border-color: var(--primary-color) !important;
}

.form-label {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Alert Styles */
.alert-modern-info {
    background: rgba(var(--primary-color-rgb), 0.1);
    border: 1px solid rgba(var(--primary-color-rgb), 0.3);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Theme Toggle Switch */
.theme-toggle-container {
    position: relative;
    display: inline-block;
}

.theme-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-label {
    display: inline-block;
    width: 60px;
    height: 30px;
    background: #f1f5f9;
    border-radius: 30px;
    cursor: pointer;
    transition: background var(--transition-normal);
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

[data-bs-theme="dark"] .theme-toggle-label {
    background: #334155;
    border-color: #334155;
}

.theme-toggle-track {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: #0891b2;
    border-radius: 50%;
    transition: transform var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.theme-icon {
    display: none;
    font-size: 10px;
}

.theme-icon-light {
    display: block;
}

.theme-toggle-input:checked + .theme-toggle-label .theme-toggle-thumb {
    transform: translateX(30px);
}

.theme-toggle-input:checked + .theme-toggle-label .theme-icon-light {
    display: none;
}

.theme-toggle-input:checked + .theme-toggle-label .theme-icon-dark {
    display: block;
}

/* Background Animation for Light Theme */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background-image: 
        linear-gradient(90deg, rgba(8, 145, 178, 0.1) 1px, transparent 1px),
        linear-gradient(0deg, rgba(8, 145, 178, 0.1) 1px, transparent 1px),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='20' fill='%23#{encode('0891b2')}' opacity='0.1'%3E🚗%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='20' fill='%23#{encode('059669')}' opacity='0.1'%3E🚙%3C/text%3E%3C/svg%3E");
    background-position: 
        0 0,
        0 0,
        0% 50%,
        100% 50%;
    background-size: 
        50px 50px,
        50px 50px,
        200px 100px,
        200px 100px;
    background-repeat: repeat, repeat, repeat-x, repeat-x;
    animation: car-drive-1 30s infinite linear, car-drive-2 25s infinite linear;
}

[data-bs-theme="dark"] body::before {
    display: none;
}

@keyframes car-drive-1 {
    0% { background-position: 0 0, 0 0, 0% 50%, 100% 50%; }
    100% { background-position: 50px 50px, 50px 50px, 100% 50%, 0% 50%; }
}

@keyframes car-drive-2 {
    0% { background-position: 0 0, 0 0, 100% 50%, 0% 50%; }
    100% { background-position: 50px 50px, 50px 50px, 0% 50%, 100% 50%; }
}

/* Floating Graphics */
.floating-graphics {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    opacity: 0.1;
    transition: all var(--transition-normal);
    animation: float-rotate 20s infinite linear;
}

.floating-shape:hover {
    opacity: 0.3;
    transform: scale(1.2) rotate(45deg);
    animation-play-state: paused;
}

[data-bs-theme="dark"] .floating-shape {
    opacity: 0.03;
}

[data-bs-theme="dark"] .floating-shape:hover {
    opacity: 0.08;
}

.shape-circle {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    animation-duration: 25s;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 52px solid var(--secondary-color);
    animation-duration: 30s;
}

.shape-square {
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    animation-duration: 22s;
}

.shape-hexagon {
    width: 60px;
    height: 34px;
    background: var(--primary-color);
    position: relative;
    animation-duration: 28s;
}

.shape-hexagon:before,
.shape-hexagon:after {
    content: "";
    position: absolute;
    width: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
}

.shape-hexagon:before {
    bottom: 100%;
    border-bottom: 17px solid var(--primary-color);
}

.shape-hexagon:after {
    top: 100%;
    border-top: 17px solid var(--primary-color);
}

.shape-diamond {
    width: 50px;
    height: 50px;
    background: var(--warning-color);
    transform: rotate(45deg);
    animation-duration: 35s;
}

.shape-pentagon {
    width: 54px;
    height: 51px;
    background: var(--success-color);
    position: relative;
    animation-duration: 32s;
}

.shape-pentagon:before {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    top: -35px;
    left: 7px;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid var(--success-color);
}

[data-bs-theme="dark"] .shape-circle {
    background: #67e8f9;
}

[data-bs-theme="dark"] .shape-triangle {
    border-bottom-color: #6ee7b7;
}

[data-bs-theme="dark"] .shape-square {
    background: #93c5fd;
}

[data-bs-theme="dark"] .shape-hexagon,
[data-bs-theme="dark"] .shape-hexagon:before,
[data-bs-theme="dark"] .shape-hexagon:after {
    background: #67e8f9;
    border-bottom-color: #67e8f9;
    border-top-color: #67e8f9;
}

[data-bs-theme="dark"] .shape-diamond {
    background: #fbbf24;
}

[data-bs-theme="dark"] .shape-pentagon,
[data-bs-theme="dark"] .shape-pentagon:before {
    background: #6ee7b7;
    border-bottom-color: #6ee7b7;
}

@keyframes float-rotate {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
    100% {
        transform: translateY(0px) rotate(360deg);
    }
}

/* Main Content Area */
.main-container {
    min-height: 100vh;
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
}

/* Section Dividers */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 3rem 0;
    border-radius: 1px;
}

/* Footer */
.liquid-footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .liquid-footer {
    background: var(--glass-bg) !important;
    border-color: var(--border-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-3 {
        font-size: 2.5rem;
    }
    
    .main-container {
        padding: 1rem 0;
    }
    
    .theme-toggle-label {
        width: 50px;
        height: 25px;
    }
    
    .theme-toggle-thumb {
        width: 19px;
        height: 19px;
    }
    
    .theme-toggle-input:checked + .theme-toggle-label .theme-toggle-thumb {
        transform: translateX(25px);
    }
    
    .floating-shape {
        transform: scale(0.7);
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before {
        animation: none;
    }
    
    .floating-shape {
        animation: none;
    }
}

/* Focus styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body::before,
    .floating-graphics {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}