/* ============================================
   MICRO-INTERACTIONS - Prime Motors v3
   Full coverage of ALL interactive elements
   ============================================ */

/* ===== SHARED INTERACTIVE BASE ===== */
/* Every tappable element gets: smooth transition, no tap highlight, relative+overflow for ripple */

.btn,
.back-btn, .header-back,
.modal-close,
.settings-item,
.switch-link,
.home-user-btn, .notif-btn, .notification-bell,
.card, .stat-card, .req-card, .lead-item, .pr-card, .pipeline-card,
.tab-btn,
.nav-btn, .lp-nav-btn,
.filter-pill, .filter-chip, .purpose-box, .stage-btn, .checkin-btn,
.lp-toggle-btn, .lp-lb-tab, .lp-duration-btn, .lp-type-pill, .lp-history-tab, .lp-week-today-btn, .lp-month-selector-arrow, .lp-badge-popup-close,
.toggle-btn, .filter-btn, .admin-tab, .ytd-admin-btn,
.pill,
.petrol-btn, .mileage-btn, .vehicle-select-btn, .add-btn, .archive-btn, .trip-type-btn,
.doc-capture,
.photo-fullscreen-close,
.radio-opt,
.add-item-btn, .line-item-remove, .pr-clear-btn, .req-header,
.followup-done-btn,
.clear-btn, .submit-btn {
    position: relative !important;
    overflow: hidden !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.2s ease,
                background 0.2s ease,
                color 0.2s ease,
                border-color 0.2s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    will-change: transform;
}

/* ===== PRESS STATE (all elements) ===== */
.btn.pressing, .btn:active,
.back-btn.pressing, .back-btn:active,
.header-back.pressing, .header-back:active,
.modal-close.pressing, .modal-close:active,
.settings-item.pressing, .settings-item:active,
.fab.pressing, .fab:active,
.home-user-btn.pressing, .home-user-btn:active,
.notif-btn.pressing, .notif-btn:active,
.notification-bell.pressing, .notification-bell:active,
.switch-link.pressing, .switch-link:active,
.lp-toggle-btn.pressing, .lp-toggle-btn:active,
.lp-lb-tab.pressing, .lp-lb-tab:active,
.lp-duration-btn.pressing, .lp-duration-btn:active,
.lp-type-pill.pressing, .lp-type-pill:active,
.lp-history-tab.pressing, .lp-history-tab:active,
.lp-week-today-btn.pressing, .lp-week-today-btn:active,
.lp-month-selector-arrow.pressing, .lp-month-selector-arrow:active,
.lp-badge-popup-close.pressing, .lp-badge-popup-close:active,
.toggle-btn.pressing, .toggle-btn:active,
.filter-btn.pressing, .filter-btn:active,
.admin-tab.pressing, .admin-tab:active,
.ytd-admin-btn.pressing, .ytd-admin-btn:active,
.pill.pressing, .pill:active,
.petrol-btn.pressing, .petrol-btn:active,
.mileage-btn.pressing, .mileage-btn:active,
.vehicle-select-btn.pressing, .vehicle-select-btn:active,
.add-btn.pressing, .add-btn:active,
.archive-btn.pressing, .archive-btn:active,
.trip-type-btn.pressing, .trip-type-btn:active,
.doc-capture.pressing, .doc-capture:active,
.photo-fullscreen-close.pressing, .photo-fullscreen-close:active,
.radio-opt.pressing, .radio-opt:active,
.add-item-btn.pressing, .add-item-btn:active,
.line-item-remove.pressing, .line-item-remove:active,
.pr-clear-btn.pressing, .pr-clear-btn:active,
.req-header.pressing, .req-header:active,
.followup-done-btn.pressing, .followup-done-btn:active,
.clear-btn.pressing, .clear-btn:active,
.submit-btn.pressing, .submit-btn:active {
    transform: scale(0.94) !important;
}

/* Cards scale less aggressively */
.card.pressing, .card:active,
.stat-card.pressing, .stat-card:active,
.req-card.pressing, .req-card:active,
.lead-item.pressing, .lead-item:active,
.pr-card.pressing, .pr-card:active,
.pipeline-card.pressing, .pipeline-card:active {
    transform: scale(0.97) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
}

/* Tabs and pills scale moderately */
.tab-btn.pressing, .tab-btn:active,
.filter-pill.pressing, .filter-pill:active,
.filter-chip.pressing, .filter-chip:active,
.purpose-box.pressing, .purpose-box:active,
.stage-btn.pressing, .stage-btn:active,
.checkin-btn.pressing, .checkin-btn:active {
    transform: scale(0.93) !important;
}

/* Nav buttons bounce bigger */
.nav-btn.pressing, .nav-btn:active,
.lp-nav-btn.pressing, .lp-nav-btn:active {
    transform: scale(0.85) !important;
}

/* Small icon buttons scale more */
.back-btn.pressing, .back-btn:active,
.header-back.pressing, .header-back:active,
.modal-close.pressing, .modal-close:active,
.lp-month-selector-arrow.pressing, .lp-month-selector-arrow:active,
.photo-fullscreen-close.pressing, .photo-fullscreen-close:active,
.line-item-remove.pressing, .line-item-remove:active,
.pr-clear-btn.pressing, .pr-clear-btn:active {
    transform: scale(0.8) !important;
}

/* FAB bounces */
.fab.pressing, .fab:active {
    transform: scale(0.88) !important;
}

/* Settings/module tiles */
.settings-item.pressing, .settings-item:active {
    transform: scale(0.96) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

/* Disabled buttons should not animate */
.btn:disabled,
button:disabled {
    transform: none !important;
    box-shadow: none !important;
}

/* ===== BUTTON GLOW SHADOWS ===== */
.btn-red:not(:disabled) {
    box-shadow: 0 4px 14px rgba(227,24,55,0.35) !important;
}

.btn-green:not(:disabled) {
    box-shadow: 0 4px 14px rgba(34,197,94,0.35) !important;
}

.btn-blue:not(:disabled) {
    box-shadow: 0 4px 14px rgba(59,130,246,0.35) !important;
}

.btn-grey {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.btn-red.pressing, .btn-red:active {
    box-shadow: 0 2px 6px rgba(227,24,55,0.2) !important;
}

.btn-green.pressing, .btn-green:active {
    box-shadow: 0 2px 6px rgba(34,197,94,0.2) !important;
}

.btn-blue.pressing, .btn-blue:active {
    box-shadow: 0 2px 6px rgba(59,130,246,0.2) !important;
}

/* ===== CARD SHADOWS ===== */
.card, .stat-card, .req-card, .lead-item, .pr-card, .pipeline-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
}

/* ===== FAB ===== */
.fab {
    position: fixed !important;
    overflow: hidden !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    will-change: transform;
    box-shadow: 0 4px 16px rgba(227,24,55,0.4) !important;
}

.fab.pressing, .fab:active {
    box-shadow: 0 2px 8px rgba(227,24,55,0.3) !important;
}

/* ===== TAB ACTIVE GLOW ===== */
.tab-btn.active,
.lp-toggle-btn.active,
.lp-lb-tab.active,
.admin-tab.active,
.toggle-btn.active,
.filter-btn.active,
.lp-history-tab.active {
    box-shadow: 0 2px 8px rgba(227,24,55,0.3) !important;
}

.filter-pill.active,
.filter-chip.active {
    box-shadow: 0 2px 8px rgba(227,24,55,0.3) !important;
}

/* ===== SETTINGS ITEMS (Module tiles on index) ===== */
.settings-item {
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}

/* ===== RIPPLE EFFECT ===== */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

/* Light ripple on light-bg elements */
.btn-grey .ripple-effect,
.btn-outline .ripple-effect,
.btn-red-outline .ripple-effect,
.card .ripple-effect,
.stat-card .ripple-effect,
.nav-btn .ripple-effect,
.lp-nav-btn .ripple-effect,
.tab-btn .ripple-effect,
.settings-item .ripple-effect,
.modal-close .ripple-effect,
.back-btn .ripple-effect,
.header-back .ripple-effect,
.filter-pill .ripple-effect,
.filter-chip .ripple-effect,
.toggle-btn .ripple-effect,
.filter-btn .ripple-effect,
.pill .ripple-effect,
.lp-toggle-btn .ripple-effect,
.lp-lb-tab .ripple-effect,
.lp-duration-btn .ripple-effect,
.lp-type-pill .ripple-effect,
.lp-history-tab .ripple-effect,
.admin-tab .ripple-effect,
.radio-opt .ripple-effect,
.req-header .ripple-effect {
    background: rgba(227,24,55,0.1);
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== MODAL TRANSITIONS ===== */
.modal-bg.micro-modal {
    display: flex !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.modal-bg.micro-modal.micro-visible {
    visibility: visible !important;
    opacity: 1 !important;
}

.modal-bg.micro-modal .modal {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease !important;
    transform: translateY(40px) scale(0.95) !important;
    opacity: 0 !important;
}

.modal-bg.micro-modal.micro-visible .modal {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
}

/* ===== NAV BAR ===== */
.nav-btn, .lp-nav-btn {
    position: relative !important;
    overflow: hidden !important;
}

/* ===== TOAST ===== */
.toast {
    transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.4s ease !important;
    opacity: 0 !important;
}

.toast.show {
    opacity: 1 !important;
}

/* ===== FORM INPUT FOCUS ===== */
.form-input,
.form-select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="tel"],
input[type="email"],
textarea,
select {
    transition: border-color 0.25s ease,
                box-shadow 0.25s ease !important;
}

.form-input:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: #E31837 !important;
    box-shadow: 0 0 0 4px rgba(227,24,55,0.15) !important;
    outline: none !important;
}

/* ===== TOGGLE SWITCH BOUNCE ===== */
.toggle-slider:before {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* ===== NOTIFICATION BADGE PULSE ===== */
.nav-badge:not(:empty) {
    animation: badgePulse 2s ease-in-out infinite !important;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 400px 100% !important;
    animation: shimmer 1.5s infinite !important;
    border-radius: 8px;
}

.skeleton-card {
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
}

.skeleton-line { height: 14px; margin-bottom: 10px; border-radius: 6px; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }

.skeleton-row { display: flex; gap: 12px; align-items: center; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skeleton-row .skeleton-lines { flex: 1; }

@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

/* ===== SCROLL REVEAL ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal.revealed:nth-child(1) { transition-delay: 0s; }
.scroll-reveal.revealed:nth-child(2) { transition-delay: 0.05s; }
.scroll-reveal.revealed:nth-child(3) { transition-delay: 0.1s; }
.scroll-reveal.revealed:nth-child(4) { transition-delay: 0.15s; }
.scroll-reveal.revealed:nth-child(5) { transition-delay: 0.2s; }
.scroll-reveal.revealed:nth-child(6) { transition-delay: 0.25s; }

/* ===== LIST ITEM ENTER ===== */
@keyframes listItemEnter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.list-enter {
    animation: listItemEnter 0.35s ease forwards;
}

.list-enter:nth-child(1) { animation-delay: 0s; }
.list-enter:nth-child(2) { animation-delay: 0.04s; }
.list-enter:nth-child(3) { animation-delay: 0.08s; }
.list-enter:nth-child(4) { animation-delay: 0.12s; }
.list-enter:nth-child(5) { animation-delay: 0.16s; }
.list-enter:nth-child(6) { animation-delay: 0.2s; }
.list-enter:nth-child(7) { animation-delay: 0.24s; }
.list-enter:nth-child(8) { animation-delay: 0.28s; }
.list-enter:nth-child(9) { animation-delay: 0.32s; }
.list-enter:nth-child(10) { animation-delay: 0.36s; }

/* ===== SUCCESS CHECKMARK ===== */
@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.success-checkmark {
    animation: successPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== COUNT-UP ===== */
.count-up {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.count-up.counting {
    transform: scale(1.15);
}

/* ===== SCREEN ENTER ===== */
@keyframes screenFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen-enter {
    animation: screenFadeIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== SCROLLABLE TABS HINT ===== */
.tabs.scrollable {
    position: relative !important;
}

.tabs.scrollable::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, rgba(245,245,245,0.9));
    pointer-events: none;
    border-radius: 0 12px 12px 0;
}
