/* Motor Drive SaaS - Industrial Dark Theme with Mechanic Workshop Aesthetic */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

/* Root Variables for Adaptive Orientation */
:root {
    --bg-portrait: url('images/backgrounds/mobile_1.jpg');
    --bg-landscape: url('images/backgrounds/desktop_1.jpg');
}

/* Default Dark Theme: Vertical (Portrait) */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0f172a;
    background-image:
        linear-gradient(to bottom, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.94)),
        var(--bg-portrait);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overscroll-behavior: none;
    color: #f1f5f9;
    transition: background-image 0.35s ease-in-out, background-color 0.3s ease, color 0.3s ease;
}

/* Horizontal (Landscape Orientation on Phone, Tablet or PC) */
@media (orientation: landscape) {
    body {
        background-image:
            linear-gradient(to bottom, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.94)),
            var(--bg-landscape);
    }
}

/* Light Theme: Vertical (Portrait) */
body.theme-light {
    background-color: #f8fafc;
    background-image:
        linear-gradient(to bottom, rgba(248, 250, 252, 0.86), rgba(241, 245, 249, 0.95)),
        var(--bg-portrait);
    color: #0f172a;
}

/* Light Theme: Horizontal (Landscape) */
@media (orientation: landscape) {
    body.theme-light {
        background-image:
            linear-gradient(to bottom, rgba(248, 250, 252, 0.86), rgba(241, 245, 249, 0.95)),
        var(--bg-landscape);
    }
}

body.theme-light .header-bg {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(226, 232, 240, 0.9);
}

body.theme-light .vehicle-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

body.theme-light .vehicle-card h3 {
    color: #0f172a !important;
}

body.theme-light .modal-content {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.theme-light .bottom-nav {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(226, 232, 240, 0.9);
}

body.theme-light .finance-card,
body.theme-light .stat-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: #e2e8f0;
}

/* Safe area padding for notched mobile devices */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

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

.header-bg {
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ============ SPLASH SCREEN ============ */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #0f172a;
    background-image:
        linear-gradient(to bottom, rgba(15, 23, 42, 0.70), rgba(15, 23, 42, 0.90)),
        url('images/backgrounds/desktop_1.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: splashFadeOut 0.5s ease-out 2.8s forwards;
}

.splash-content {
    text-align: center;
    padding: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.splash-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: contain;
    background-color: #000;
    border: 3px solid #f97316;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.5);
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes splashFadeOut {
    0% {
        opacity: 1;
        pointer-events: all;
    }
    100% {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }
}

.app-hidden {
    opacity: 0;
    animation: appFadeIn 0.4s ease-out 2.8s forwards;
}

@keyframes appFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ============ GLOW EFFECTS ============ */
.glow-orange {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.35), 0 0 40px rgba(249, 115, 22, 0.15);
}

.glow-green {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.35);
}

.glow-blue {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.35);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.35);
}

/* ============ ANIMATIONS ============ */
.card-hover {
    transition: all 0.25s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.card-hover:active {
    transform: scale(0.98);
}

.spinner {
    border: 3px solid rgba(249, 115, 22, 0.2);
    border-top-color: #f97316;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.25s ease-out;
}

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

/* ============ STATUS BADGES ============ */
.status-pagado {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.status-pendiente {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.status-abonado {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.status-presupuesto {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

/* ============ SCREENS ============ */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast {
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-out 2.8s forwards;
}

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

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

/* ============ ACTION BUTTONS ============ */
.action-btn {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.action-btn:active {
    transform: scale(0.95);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E, #075E54);
}

.btn-paid {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.btn-abono {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ============ CARDS ============ */
.vehicle-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.25s ease;
}

.vehicle-card:hover {
    border-color: rgba(249, 115, 22, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.work-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(71, 85, 105, 0.35);
    border-radius: 16px;
    padding: 16px;
}

.finance-card {
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(71, 85, 105, 0.4);
    transition: all 0.25s ease;
}

.finance-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(59, 130, 246, 0.35);
}

.finance-green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(34, 197, 94, 0.35);
}

.finance-red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(239, 68, 68, 0.35);
}

.finance-purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(168, 85, 247, 0.35);
}

.finance-amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(245, 158, 11, 0.35);
}

/* ============ MODAL ============ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}

.modal.active {
    display: block;
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 24px 24px 0 0;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 640px) {
    .modal-content {
        max-width: 540px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 24px;
        bottom: 30px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    }
}

/* ============ STATUS FILTER CHIPS & UTILS ============ */
.filter-tab {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-tab:active {
    transform: scale(0.96);
}

.scrollbar-none::-webkit-scrollbar {
    display: none;
}

.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

