/* 
  JR Dream - Modern Mobile-First Theme & Responsive Utilities
  Standardized Design System & Mobile UX Polish
*/

:root {
    --primary: #FF6B00;
    --primary-hover: #E05D00;
    --primary-light: #FFF0E6;
    --primary-gradient: linear-gradient(135deg, #FF6B00 0%, #FF8533 100%);
    --dark-bg: #0F172A;
    --dark-surface: #1E293B;
    --light-bg: #F8FAFC;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #0F172A;
    --text-sub: #475569;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 30px -10px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 8px 20px rgba(255, 107, 0, 0.22);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-backdrop: blur(12px);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --touch-min: 44px;
}

/* Global Reset & Box Sizing Polish */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Glassmorphic Container Utility */
.glass-panel {
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Touch Target Optimization */
button,
.btn,
input,
select,
textarea,
.nav-link,
.dropdown-item {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary,
.btn-go {
    background: var(--primary-gradient) !important;
    border: none !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-go:hover {
    box-shadow: var(--shadow-glow) !important;
    filter: brightness(1.05);
}

/* Form Polish */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.15);
}

/* Responsive Table Container */
.table-responsive,
.mobile-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.table-responsive::-webkit-scrollbar,
.mobile-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb,
.mobile-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 0.85rem 1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
    white-space: nowrap;
}

.table tbody tr:hover {
    background-color: rgba(255, 107, 0, 0.03);
}

/* Nav Links Chip Scroller on Mobile */
.nav-links,
.nav-chips {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar,
.nav-chips::-webkit-scrollbar {
    display: none;
}

.nav-links a,
.nav-chips a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    background: #ffffff;
    color: var(--text-sub);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    text-decoration: none;
}

.nav-links a:hover,
.nav-chips a:hover,
.nav-links a.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

/* Card Improvements */
.card {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Badge Styling */
.badge {
    padding: 0.4em 0.75em;
    font-weight: 600;
    border-radius: 30px;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

/* Floating Action / Mobile Bottom Nav Bar */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1040;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.mobile-bottom-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.72rem;
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease;
}

.mobile-bottom-bar a i {
    font-size: 1.25rem;
}

.mobile-bottom-bar a.active,
.mobile-bottom-bar a:hover {
    color: var(--primary);
}

/* Responsive Viewport Breakpoint Adjustments */
@media (max-width: 991.98px) {
    :root {
        --touch-min: 48px;
    }

    body {
        padding-bottom: 70px !important;
    }

    .mobile-bottom-bar {
        display: flex;
    }

    .container,
    .container-fluid {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    /* Modal Responsive Bottom Sheet behavior */
    .modal-dialog {
        margin: 0.5rem;
        max-width: 100% !important;
    }

    .modal-content {
        border-radius: var(--radius-md) !important;
    }

    /* Header Cards Responsive Stack */
    .header,
    .header-card,
    .card-header-swap {
        padding: 16px 18px !important;
        border-radius: var(--radius-md) !important;
    }

    .header h1,
    .header-card h1,
    .card-header-swap h1 {
        font-size: 1.4rem !important;
    }

    .stat-number {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 575.98px) {
    .btn {
        width: 100%;
        margin-bottom: 6px;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        border-radius: var(--radius-sm) !important;
    }
}