/* ============================================
   Mobile UX Enhancements
   Bottom Nav, FAB, Compact Cards, Dark Mode
   ============================================ */

/* ============================================
   1. BOTTOM NAVIGATION BAR
   ============================================ */

.bottom-nav {
    display: none;
    /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    /* iPhone X+ notch */
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #9e9e9e;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.bottom-nav-item .nav-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
    transition: transform 0.3s ease;
}

.bottom-nav-item.active {
    color: #e91e63;
}

.bottom-nav-item.active .nav-icon {
    transform: scale(1.1);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: #e91e63;
    border-radius: 0 0 4px 4px;
}

.bottom-nav-item:active {
    background: rgba(233, 30, 99, 0.1);
}

/* ============================================
   2. FLOATING ACTION BUTTON (FAB)
   ============================================ */

.fab-container {
    display: none;
    /* Hidden on desktop */
    position: fixed;
    bottom: 80px;
    /* Above bottom nav */
    right: 20px;
    z-index: 1001;
}

.fab-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: white;
    border: none;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(233, 30, 99, 0.5);
}

.fab-button:active {
    transform: scale(0.95);
}

.fab-button.open {
    transform: rotate(45deg);
}

/* FAB Menu */
.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.fab-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s;
}

.fab-menu-item:hover {
    background: #fce4ec;
    transform: translateX(-5px);
}

.fab-menu-item .fab-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    border-radius: 50%;
    font-size: 1rem;
}

/* ============================================
   3. COMPACT DASHBOARD CARDS (Mobile)
   ============================================ */

/* Will be activated with @media query below */

/* ============================================
   4. DARK MODE
   ============================================ */

body.dark-mode {
    --bg-light: #121212;
    --bg-white: #1e1e1e;
    --text-dark: #e0e0e0;
    --text-light: #9e9e9e;
    --border-color: #333;
    --gray-100: #2a2a2a;
    --gray-50: #1a1a1a;
    --gray-900: #ffffff;
    --gray-600: #b0b0b0;
    --gray-500: #9e9e9e;
}

body.dark-mode .bottom-nav {
    background: #1e1e1e;
    border-top-color: #333;
}

body.dark-mode .fab-menu-item {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .action-card {
    background: #1e1e1e;
    border-color: #333;
}

body.dark-mode .quick-actions {
    background: linear-gradient(180deg, #121212 0%, #1a1a1a 100%);
}

body.dark-mode .legal-container,
body.dark-mode .legal-section {
    background: #1e1e1e;
    border-color: #333;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    transition: all 0.3s;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   5. TOUCH ANIMATIONS
   ============================================ */

.tap-effect {
    position: relative;
    overflow: hidden;
}

.tap-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.tap-effect:active::after {
    width: 200%;
    height: 200%;
    opacity: 1;
}

/* ============================================
   MOBILE ONLY STYLES
   ============================================ */

@media (max-width: 768px) {

    /* Show bottom nav and FAB on mobile */
    .bottom-nav {
        display: block;
    }

    .fab-container {
        display: block;
    }

    /* Add padding to body to account for bottom nav */
    body {
        padding-bottom: 64px;
    }

    /* Hide top nav on mobile (use bottom nav instead) */
    /* Keep header but make it minimal */

    /* Compact quick stats */
    .quick-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .quick-stat {
        padding: 16px 12px !important;
    }

    .quick-stat-value {
        font-size: 1.8rem !important;
    }

    .quick-stat-label {
        font-size: 0.75rem !important;
    }

    /* Reduce dashboard header height */
    .dashboard-welcome {
        padding: 70px 16px 30px !important;
        min-height: auto !important;
    }

    .welcome-title {
        font-size: 1.4rem !important;
    }

    /* Add badge to action cards */
    .action-badge {
        display: inline-block;
        background: #e91e63;
        color: white;
        font-size: 0.7rem;
        padding: 2px 8px;
        border-radius: 20px;
        margin-left: 8px;
    }
}

/* Very small phones */
@media (max-width: 390px) {
    .bottom-nav {
        height: 56px;
    }

    .bottom-nav-item .nav-icon {
        font-size: 1.3rem;
    }

    .bottom-nav-item {
        font-size: 0.65rem;
    }

    .fab-container {
        bottom: 72px;
        right: 16px;
    }

    .fab-button {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    body {
        padding-bottom: 56px;
    }
}