/*
 * Ally Motors BD - Custom CSS (no @apply, works with Tailwind Play CDN)
 * Load this AFTER the Tailwind CDN script so utility classes take precedence.
 */

/* ========================================
   THEME VARIABLES
   ======================================== */
:root {
    --primary: #16a34a;       /* green-600 */
    --primary-dark: #15803d;  /* green-700 */
    --primary-light: #22c55e; /* green-500 */
    --accent: #ef4444;        /* red-500 */
    --bg: #ffffff;
    --fg: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
}

/* ========================================
   BASE STYLES
   ======================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #ffffff;
    color: #111827;
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; }

/* ========================================
   ANIMATIONS (match framer-motion)
   ======================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInLeft { from { transform: translateX(-30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bounceSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.fade-in { animation: fadeIn 0.5s ease-in; }
.slide-up { animation: slideUp 0.5s ease-out; }
.slide-down { animation: slideDown 0.4s ease-out; }
.slide-in-left { animation: slideInLeft 0.5s ease-out; }
.slide-in-right { animation: slideInRight 0.5s ease-out; }
.scale-in { animation: scaleIn 0.4s ease-out; }
.animate-bounce-slow { animation: bounceSlow 3s ease-in-out infinite; }
.pulse-ring { animation: pulse-ring 2s infinite; }
.stat-value { animation: countUp 0.5s ease-out; }

/* ========================================
   SCROLLBAR UTILITIES
   ======================================== */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
    background-color: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary:hover { background-color: var(--primary-dark); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

.btn-danger {
    background-color: #dc2626; color: #fff; font-weight: 600;
    padding: 0.625rem 1.25rem; border-radius: 0.5rem; transition: background-color 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border: 0; cursor: pointer; text-decoration: none;
}
.btn-danger:hover { background-color: #b91c1c; }

.btn-outline {
    border: 2px solid #d1d5db; color: #374151; font-weight: 600;
    padding: 0.625rem 1.25rem; border-radius: 0.5rem; transition: all 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: transparent; cursor: pointer; text-decoration: none;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-secondary {
    background-color: #f3f4f6; color: #1f2937; font-weight: 500;
    padding: 0.625rem 1.25rem; border-radius: 0.5rem; transition: background-color 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border: 0; cursor: pointer; text-decoration: none;
}
.btn-secondary:hover { background-color: #e5e7eb; }

.btn-white {
    background-color: #fff; color: var(--primary-dark); font-weight: 700;
    padding: 0.75rem 1.5rem; border-radius: 0.75rem; transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); display: inline-flex;
    align-items: center; justify-content: center; gap: 0.5rem;
    border: 0; cursor: pointer; text-decoration: none;
}
.btn-white:hover { background-color: #f0fdf4; }

.btn-red {
    background-color: var(--accent); color: #fff; font-weight: 600;
    padding: 0.625rem 1.25rem; border-radius: 0.5rem; transition: background-color 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border: 0; cursor: pointer; text-decoration: none;
}
.btn-red:hover { background-color: #dc2626; }

/* ========================================
   CARDS & Hovers
   ======================================== */
.card-hover {
    transition: all 0.3s;
}
.card-hover:hover {
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    transform: translateY(-4px);
}

/* ========================================
   BADGES
   ======================================== */
.badge-active {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.125rem 0.625rem; border-radius: 9999px;
    font-size: 0.75rem; font-weight: 500;
    background-color: #dcfce7; color: #166534;
}
.badge-inactive {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.125rem 0.625rem; border-radius: 9999px;
    font-size: 0.75rem; font-weight: 500;
    background-color: #f3f4f6; color: #4b5563;
}

/* ========================================
   FORM INPUTS
   ======================================== */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s;
    background: #fff;
    color: #111827;
    font-size: 0.95rem;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.2);
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.2);
}

/* ========================================
   SECTION PADDING
   ======================================== */
.section-pad { padding-top: 4rem; padding-bottom: 4rem; }
@media (min-width: 768px) { .section-pad { padding-top: 5rem; padding-bottom: 5rem; } }
@media (min-width: 1024px) { .section-pad { padding-top: 6rem; padding-bottom: 6rem; } }

.section-pad-sm { padding-top: 2.5rem; padding-bottom: 2.5rem; }
@media (min-width: 768px) { .section-pad-sm { padding-top: 3.5rem; padding-bottom: 3.5rem; } }
@media (min-width: 1024px) { .section-pad-sm { padding-top: 4rem; padding-bottom: 4rem; } }

/* ========================================
   ADMIN TABLE
   ======================================== */
.admin-table-container {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.admin-table-container table {
    min-width: 100%;
    border-collapse: collapse;
}
.admin-table-container thead {
    background: #f9fafb;
}
.admin-table-container thead th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}
.admin-table-container tbody tr { transition: background-color 0.15s; }
.admin-table-container tbody tr:hover { background: #f9fafb; }
.admin-table-container tbody td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
}
.admin-table-container tbody tr:last-child td { border-bottom: 0; }

.admin-scroll::-webkit-scrollbar { width: 6px; }
.admin-scroll::-webkit-scrollbar-track { background: transparent; }
.admin-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.admin-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========================================
   BIKE CARD
   ======================================== */
.bike-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s;
}
.bike-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    transform: translateY(-4px);
}
.bike-card-image {
    aspect-ratio: 4/3;
    background: #f3f4f6;
    overflow: hidden;
    position: relative;
}
.bike-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.bike-card:hover .bike-card-image img { transform: scale(1.1); }

/* ========================================
   HERO BANNER SLIDER
   ======================================== */
.hero-slider { position: relative; width: 100%; overflow: hidden; }
.hero-slide { position: relative; width: 100%; height: 500px; }
@media (min-width: 768px) { .hero-slide { height: 600px; } }
@media (min-width: 1024px) { .hero-slide { height: 640px; } }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide-content {
    position: absolute; inset: 0;
    display: flex; align-items: center;
    background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.3), transparent);
}

/* ========================================
   BRAND BADGE
   ======================================== */
.brand-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    text-decoration: none;
}
.brand-badge:hover { border-color: var(--primary); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

/* ========================================
   TABLE RESPONSIVE
   ======================================== */
.table-responsive {
    overflow-x: auto;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 768px) {
    .table-responsive { margin: 0; padding: 0; }
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    header, footer, .no-print { display: none !important; }
    main { padding: 0 !important; }
}

/* ========================================
   LINE CLAMP UTILITY (for bike card titles)
   ======================================== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
