/* ── Study Portal Custom Styles ──────────────────────── */

/* Base font size: 16px minimum on mobile (prevents iOS zoom) */
html {
    font-size: 16px;
}

/* ── Bottom navigation (mobile only) ─────────────────── */
.bottom-nav {
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1030;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    opacity: 0.85;
    transition: opacity 0.15s;
    /* Minimum touch target: 44×44px */
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
}

.bottom-nav a:hover,
.bottom-nav a:active {
    opacity: 1;
}

.bottom-nav .bi {
    font-size: 1.25rem;
}

/* Add bottom padding when bottom nav is visible */
@media (max-width: 767.98px) {
    main.container {
        padding-bottom: 80px;
    }
}

/* ── Touch-friendly buttons ──────────────────────────── */
.btn {
    /* Ensures 44px minimum on mobile */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm {
    min-height: 36px;
}

.btn-lg {
    min-height: 50px;
}

/* ── Cards ────────────────────────────────────────────── */
.card {
    border-radius: 0.5rem;
}

/* ── Progress bars ────────────────────────────────────── */
.progress {
    border-radius: 0.5rem;
    background-color: #e9ecef;
}

/* ── Avatar circle fallback ──────────────────────────── */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

/* ── Tables ───────────────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* ── Print styles ────────────────────────────────────── */
@media print {
    .navbar, .bottom-nav, footer, .btn, form {
        display: none !important;
    }
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* ── Chart containers ────────────────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
}

@media (max-width: 575.98px) {
    .chart-container {
        max-height: 250px;
    }
}

/* ── Spacing between adjacent action buttons ─────────── */
.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

/* ── Form control sizing on mobile ───────────────────── */
@media (max-width: 767.98px) {
    .form-control:not(.form-control-sm) {
        font-size: 16px; /* Prevent iOS zoom */
    }
}
