/**
 * Dial Wizard - Mobile-First Responsive Styles
 */

/* ============================================
   MOBILE NAVIGATION (Bottom Bar)
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--primary);
    padding: var(--space-2) 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    min-height: 56px;
    transition: all 0.2s;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item svg,
.nav-item i {
    width: 24px;
    height: 24px;
    margin-bottom: var(--space-1);
    font-size: 24px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* Hide bottom nav on desktop */
@media (min-width: 1024px) {
    .bottom-nav {
        display: none;
    }
}

/* ============================================
   DESKTOP SIDEBAR
============================================ */

.sidebar {
    width: 240px;
    height: 100vh;
    background: var(--primary-dark);
    position: fixed;
    left: 0;
    top: 0;
    padding: var(--space-5) 0;
    display: none;
}

.sidebar-logo {
    padding: 0 var(--space-5) var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: var(--font-xl);
    font-weight: 700;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    gap: var(--space-3);
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.sidebar-item.active {
    background: rgba(255, 214, 10, 0.1);
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.sidebar-item svg,
.sidebar-item i {
    width: 20px;
    font-size: 20px;
}

/* Show sidebar on desktop */
@media (min-width: 1024px) {
    .sidebar {
        display: block;
    }

    .main-content {
        margin-left: 240px;
    }
}

/* ============================================
   MOBILE HEADER
   ============================================ */

.mobile-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--space-4);
    position: sticky;
    top: 0;
    z-index: 999;
}

.mobile-header-title {
    font-size: var(--font-xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.mobile-header-subtitle {
    font-size: var(--font-sm);
    opacity: 0.9;
}

/* ============================================
   CONTENT SPACING (Mobile Bottom Nav)
   ============================================ */

.main-content {
    padding-bottom: 80px;
    /* Space for bottom nav */
}

@media (min-width: 1024px) {
    .main-content {
        padding-bottom: 0;
    }
}

/* ============================================
   MOBILE CARDS
   ============================================ */

@media (max-width: 767px) {
    .card {
        margin: 0 var(--space-2) var(--space-4);
        padding: var(--space-4);
    }

    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }
}

/* ============================================
   RESPONSIVE TABLES
   ============================================ */

@media (max-width: 767px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }
}

/* ============================================
   TOUCH-FRIENDLY FORMS
   ============================================ */

@media (max-width: 767px) {
    .form-control {
        font-size: 16px;
        /* Prevents iOS zoom */
        height: 48px;
        padding: 14px 16px;
    }

    .btn {
        min-height: 48px;
        padding: 14px 24px;
    }
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
    display: grid;
    gap: var(--space-4);
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   MODAL (Mobile Friendly)
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--space-4);
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: var(--space-4);
}

.modal-title {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--primary);
}

.modal-footer {
    margin-top: var(--space-4);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* ============================================
   IMPERSONATION BANNER
   ============================================ */

.impersonation-banner {
    background: var(--warning);
    color: white;
    padding: var(--space-3) var(--space-4);
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.impersonation-banner strong {
    font-weight: 600;
}

/* ============================================
   STAT WIDGETS
   ============================================ */

.stat-widget {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow);
}

.stat-widget-value {
    font-size: var(--font-3xl);
    font-weight: 700;
    color: var(--accent);
}

.stat-widget-label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: var(--space-2);
}

/* ============================================
   TIMELINE (Activity History)
   ============================================ */

.timeline {
    position: relative;
    padding-left: var(--space-6);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-4);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
}

.timeline-content {
    background: white;
    padding: var(--space-3);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.timeline-time {
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-4);
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    color: var(--border);
    margin-bottom: var(--space-4);
}

.empty-state-title {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    margin-bottom: var(--space-4);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin: var(--space-6) 0;
}

.pagination-btn {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--primary);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--background);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   SAVE INDICATOR
   ============================================ */

.save-indicator {
    position: fixed;
    top: 70px;
    right: var(--space-4);
    background: var(--success);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius);
    font-size: var(--font-sm);
    box-shadow: var(--shadow-md);
    z-index: 1001;
    display: none;
}

.save-indicator.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}