/* css/style.css */

/*
  NOTE ON @apply DIRECTIVES:
  For "@apply" to work, you MUST process this file through a Tailwind CSS build step.
  The Tailwind CSS CDN script will NOT process "@apply" rules in this file.
*/

/* --- Global Text Selection Rules --- */
/* REMOVED: The global user-select:none rule was here.
   It has been removed to allow users to copy text from the website, which is standard usability.
*/

/* Allow text selection on form inputs */
input, 
textarea, 
[contenteditable="true"],
input[type="text"], 
input[type="email"], 
input[type="tel"], 
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="date"] {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
}

/* --- Light & Dark Themes --- */
/* ... all other styles from your original file remain the same ... */
html.dark-theme {
    --bg-primary-dark: #0B1120;
    --text-primary-dark: #E0E0E0;
    --text-secondary-dark: #9CA3AF;
    --text-muted-dark: #6B7280;
    --accent-color-dark: #F6C927;
    --accent-hover-dark: #FFDE59;
    --card-bg-dark: #1E293B;
    --card-light-bg-dark: #111827;
    --border-light-dark: #374151;
    --border-medium-dark: #4B5563;
    --input-bg-dark: #2D3748;
    --input-border-dark: #4A5568;
    --input-text-dark: #E0E0E0;
    --input-placeholder-dark: #718096;
    --header-bg-dark: #1A202C;
    --header-text-dark: #CBD5E0;
}

html.dark-theme body {
    background-color: var(--bg-primary-dark);
    color: var(--text-primary-dark);
}

/* --- Button Styles --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-link {
    background: #3b82f6;
    color: white;
}

.btn-link:hover {
    background: #2563eb;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-outline-secondary {
    background: transparent;
    color: #6b7280;
    border: 1px solid #6b7280;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
}

/* --- Utility Classes for Layout --- */
.image-upload-group {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    background: #f9fafb;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-4 {
    gap: 1rem;
}

.flex-grow {
    flex-grow: 1;
}

.mt-4 {
    margin-top: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.h-4 {
    height: 1rem;
}

.w-4 {
    width: 1rem;
}

.h-5 {
    height: 1.25rem;
}

.w-5 {
    width: 1.25rem;
}

/* All other dark theme rules follow... */
.dealer-nav-group button {
    @apply bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-all;
}

/* Enhanced Navbar Button Effects */
.nav-link-enhanced {
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border-radius: 8px !important;
}

.nav-link-enhanced::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
    transition: left 0.5s ease !important;
    z-index: 1 !important;
    pointer-events: none !important;
    border-radius: 8px !important;
}

.nav-link-enhanced:hover::before {
    left: 100% !important;
}

.nav-link-enhanced:hover {
    transform: translateY(-1px) scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5) !important;
    background-color: rgba(59, 130, 246, 0.1) !important;
}

.nav-link-enhanced.active {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
    background-color: rgba(59, 130, 246, 0.2) !important;
}

.nav-link-enhanced.active:hover {
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.6) !important;
    background-color: rgba(59, 130, 246, 0.3) !important;
}

/* Mobile menu enhanced effects */
.nav-link-enhanced.block {
    position: relative !important;
    overflow: hidden !important;
    margin: 4px 0 !important;
}

/* Additional enhancement for better visibility */
.nav-link-enhanced:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5) !important;
}

/* Enhanced Mobile Menu Styles */
.mobile-menu {
    position: fixed;
    top: 64px; /* Adjust to match header height */
    right: -100%;
    width: 280px;
    height: calc(100vh - 64px);
    background: #111827;
    border-left: 1px solid #374151;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    padding-top: 20px;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-button {
    z-index: 1001;
}

.mobile-menu a {
    display: block;
    padding: 15px 25px;
    color: #d1d5db;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-bottom: 1px solid #1f2937;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu a:hover {
    background-color: #1f2937;
    color: #ffffff;
}

.mobile-menu a.active {
    background-color: #3b82f6;
    color: #ffffff;
    font-weight: 600;
}

/* Body scroll lock */
body.menu-open {
    overflow: hidden;
}

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

.tornado-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3));
}

.tornado-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: tornado-spin 1s linear infinite;
}

.tornado-outer {
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    border: 3px solid transparent;
    border-bottom: 3px solid #60a5fa;
    border-radius: 50%;
    animation: tornado-spin-reverse 1.5s linear infinite;
}

.tornado-loader::before,
.tornado-loader::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent;
}

.tornado-loader::before {
    width: 80px;
    height: 80px;
    border-top-color: #3b82f6;
    border-right-color: #3b82f6;
    border-bottom-color: transparent;
    border-left-color: transparent;
    animation: tornado-spin-outer 1.5s linear infinite;
}

.tornado-loader::after {
    width: 50px;
    height: 50px;
    top: 15px;
    left: 15px;
    border-top-color: transparent;
    border-right-color: transparent;
    border-bottom-color: #10b981;
    border-left-color: #10b981;
    animation: tornado-spin-inner 1s linear infinite reverse;
}

@keyframes tornado-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes tornado-spin-reverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes tornado-spin-outer {
    0% {
        transform: rotate(0deg) scale(1);
        border-width: 4px;
    }
    25% {
        transform: rotate(90deg) scale(1.1);
        border-width: 6px;
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        border-width: 4px;
    }
    75% {
        transform: rotate(270deg) scale(1.1);
        border-width: 6px;
    }
    100% {
        transform: rotate(360deg) scale(1);
        border-width: 4px;
    }
}

@keyframes tornado-spin-inner {
    0% {
        transform: rotate(0deg) scale(1);
        border-width: 4px;
    }
    25% {
        transform: rotate(-90deg) scale(0.9);
        border-width: 6px;
    }
    50% {
        transform: rotate(-180deg) scale(0.8);
        border-width: 4px;
    }
    75% {
        transform: rotate(-270deg) scale(0.9);
        border-width: 6px;
    }
    100% {
        transform: rotate(-360deg) scale(1);
        border-width: 4px;
    }
}

.loading-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 20px;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
