/* ========== Mobile Styles (< 768px) ========== */

/* Typography for Mobile */
body {
    font-size: 14px;
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 18px;
}

/* ========== Navigation Mobile ========== */
.navbar-collapse {
    background: rgba(13, 26, 63, 0.98);
    backdrop-filter: blur(20px);
    padding: 1rem;
    border-radius: 15px;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Mobile Hamburger Menu - Slide In Drawer */
@media (max-width: 767px) {
    .navbar-collapse {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: calc(100vh - 70px);
        margin-top: 0;
        border-radius: 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        transition: left 0.3s ease-in-out;
        z-index: 999;
        padding-top: 1.5rem;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .navbar-collapse.show {
        left: 0;
    }

    /* Overlay when menu is open */
    .navbar-collapse.show::before {
        content: '';
        position: fixed;
        top: 70px;
        right: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }

    .nav-link {
        padding: 1rem !important;
        margin: 0.25rem 0;
        font-size: 16px;
    }

    .navbar-nav {
        flex-direction: column;
    }

    .navbar-nav .btn {
        width: 100%;
        margin: 0.5rem 0;
        justify-content: center;
    }
}

/* ========== Cards Mobile ========== */
.card {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
}

.card-body {
    padding: 1rem;
}

/* ========== Forms Mobile ========== */
.form-row,
.row.g-3,
.row.g-4 {
    margin-left: 0;
    margin-right: 0;
}

.form-row > *,
.row.g-3 > *,
.row.g-4 > * {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 1rem;
}

/* Stack form elements vertically on mobile */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Sticky submit button on mobile forms */
.mobile-sticky-submit {
    position: sticky;
    bottom: 0;
    background: var(--dark-bg);
    padding: 1rem;
    margin: 0 -1rem -1rem;
    border-top: 1px solid var(--border-glow);
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.mobile-sticky-submit .btn {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
    font-weight: 600;
}

/* ========== Hero Section Mobile ========== */
.hero-section {
    padding: 4rem 0 3rem !important;
    text-align: center;
}

.hero-section h1 {
    font-size: 28px;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 16px;
    margin-bottom: 1.5rem;
}

.hero-section .btn {
    width: 100%;
    margin-bottom: 0.75rem;
    min-height: 48px;
}

.hero-section .btn:last-child {
    margin-bottom: 0;
}

/* ========== Grid Layouts Mobile ========== */
.row.g-3,
.row.g-4 {
    margin-left: 0;
    margin-right: 0;
}

.row.g-3 > *,
.row.g-4 > * {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 1rem;
}

[class*="col-"] {
    width: 100%;
    margin-bottom: 1rem;
}

/* Single column layout on mobile */
@media (max-width: 767px) {
    .col-md-6,
    .col-md-4,
    .col-md-3,
    .col-lg-4,
    .col-lg-3,
    .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========== Section Padding Mobile ========== */
.section-padding {
    padding: 3rem 0;
}

.section-title {
    font-size: 24px;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 14px;
    margin-bottom: 2rem;
}

/* ========== Buttons Mobile ========== */
.btn-group-vertical {
    width: 100%;
}

.btn-group-vertical .btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Stack buttons on mobile */
.d-flex.d-sm-flex .btn {
    width: 100%;
    margin-bottom: 0.75rem;
}

@media (max-width: 575px) {
    .d-grid.gap-3.d-sm-flex {
        display: grid !important;
    }

    .d-grid.gap-3.d-sm-flex .btn {
        width: 100%;
    }
}

/* ========== Tables Mobile ========== */
@media (max-width: 767px) {
    /* Convert table to card layout on mobile */
    .table-mobile-card {
        display: block;
    }

    .table-mobile-card thead {
        display: none;
    }

    .table-mobile-card tbody,
    .table-mobile-card tr,
    .table-mobile-card td {
        display: block;
        width: 100%;
    }

    .table-mobile-card tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-glow);
        border-radius: 12px;
        padding: 1rem;
        background: var(--card-glass);
    }

    .table-mobile-card td {
        padding: 0.5rem 0;
        border: none;
        text-align: left !important;
    }

    .table-mobile-card td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--neon-cyan);
        display: inline-block;
        min-width: 120px;
    }

    /* Alternative: Horizontal scroll */
    .table-scroll {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

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

    .table-scroll thead th:first-child {
        position: sticky;
        left: 0;
        background: var(--card-glass);
        z-index: 11;
    }

    .table-scroll tbody td:first-child {
        position: sticky;
        left: 0;
        background: var(--card-glass);
        z-index: 10;
    }
}

/* ========== Footer Mobile ========== */
.footer {
    padding: 3rem 0 2rem;
    text-align: center;
}

.footer .row > div {
    margin-bottom: 2rem;
}

.footer h5 {
    font-size: 18px;
    margin-bottom: 1rem;
}

.footer ul {
    text-align: center;
}

/* ========== Modals Mobile ========== */
.modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
}

.modal-content {
    border-radius: 16px;
    border: 1px solid var(--border-glow);
}

.modal-header,
.modal-body,
.modal-footer {
    padding: 1.25rem;
}

.modal-footer .btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

.modal-footer .btn:last-child {
    margin-bottom: 0;
}

/* ========== Dropdowns Mobile ========== */
.dropdown-menu {
    width: calc(100% - 2rem);
    max-width: 100%;
    margin: 0.5rem 1rem;
    border-radius: 12px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.dropdown-item {
    padding: 1rem;
    font-size: 16px;
    min-height: 48px;
}

/* ========== Badge Mobile ========== */
.badge {
    font-size: 11px;
    padding: 0.35rem 0.65rem;
}

/* ========== Bottom Navigation (Optional) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13, 26, 63, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glow);
    padding: 0.5rem 0;
    z-index: 1000;
    display: none;
}

.bottom-nav.show {
    display: flex;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
    min-height: 60px;
    transition: all 0.3s ease;
}

.bottom-nav-item.active {
    color: var(--neon-cyan);
}

.bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 0.25rem;
}

/* Add padding to main content when bottom nav is visible */
body.has-bottom-nav main {
    padding-bottom: 70px;
}

/* ========== Touch Optimizations ========== */
/* Remove hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .btn:hover,
    .nav-link:hover {
        transform: none;
    }

    .card:active,
    .btn:active,
    .nav-link:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* ========== Spacing Mobile ========== */
.mb-mobile-3 {
    margin-bottom: 1rem;
}

.p-mobile-3 {
    padding: 1rem;
}

/* ========== Images Mobile ========== */
img {
    border-radius: 8px;
}

/* ========== Container Mobile ========== */
.container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ========== Animations Mobile (Reduced Motion) ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

