/* HeartAfrika - Global Mobile Responsive Styles */
/* Apply to all pages for consistent mobile experience */

/* ============================================
   HeartAfrika Brand Colors
   ============================================ */
:root {
    --ha-primary: #DC3545;
    --ha-primary-dark: #B82D3C;
    --ha-black: #1a1a1a;
    --ha-charcoal: #2d2d2d;
    --ha-dark-gray: #404040;
}

/* ============================================
   Mobile Base Styles
   ============================================ */
@media (max-width: 768px) {

    /* Reduce padding on containers */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Override default card hover effects on mobile (they can cause issues) */
    .card:hover {
        transform: none;
    }

    /* Smaller font sizes on mobile */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    h4 {
        font-size: 1.1rem !important;
    }

    /* Better button sizing on mobile */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.65rem 1.25rem;
        font-size: 1rem;
    }

    /* Forms on mobile */
    .form-control,
    .form-select {
        font-size: 16px !important;
        /* Prevents iOS zoom on focus */
    }
}

@media (max-width: 576px) {

    /* Extra small screens */
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.35rem !important;
    }

    h3 {
        font-size: 1.15rem !important;
    }

    h4 {
        font-size: 1rem !important;
    }

    .btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }

    /* Stack buttons on very small screens */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-wrap: wrap;
    }
}

/* ============================================
   Header Mobile Styles
   ============================================ */
@media (max-width: 768px) {

    .ha-header,
    header.navbar {
        padding: 0.5rem 0.75rem !important;
    }

    .navbar-nav {
        flex-direction: row;
        align-items: center;
    }

    /* Language selector on mobile */
    .language-selector-container .btn {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
}

@media (max-width: 480px) {

    .ha-header,
    header.navbar {
        padding: 0.4rem 0.5rem !important;
    }
}

/* ============================================
   Footer Mobile Styles  
   ============================================ */
@media (max-width: 768px) {
    footer.footer {
        padding: 2rem 0 !important;
    }

    footer .row>[class*="col-"] {
        margin-bottom: 1.5rem;
    }

    footer h5,
    footer h6 {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    footer .d-flex.gap-3 {
        gap: 0.75rem !important;
    }

    footer .social-icon {
        width: 36px !important;
        height: 36px !important;
    }
}

@media (max-width: 576px) {
    footer.footer {
        padding: 1.5rem 0 !important;
        text-align: center;
    }

    footer .row>[class*="col-"] {
        margin-bottom: 1.25rem;
        text-align: center !important;
    }

    footer ul.list-unstyled {
        padding-left: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    footer ul.list-unstyled li {
        text-align: center;
    }

    footer .d-flex.flex-column.flex-md-row {
        text-align: center;
        align-items: center;
        justify-content: center;
    }

    footer h5,
    footer h6,
    footer .fw-bold {
        text-align: center !important;
    }

    footer p {
        text-align: center !important;
    }

    footer .input-group {
        justify-content: center;
    }

    footer .d-flex {
        justify-content: center !important;
    }
}

/* ============================================
   Dashboard & Cards Mobile Styles
   ============================================ */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .card {
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
    }

    .card-body {
        padding: 1rem !important;
    }

    .card-header {
        padding: 0.75rem 1rem !important;
    }

    /* Stats cards */
    .stat-card,
    .stats-card {
        padding: 0.75rem !important;
    }

    .stat-card h2,
    .stats-card h2 {
        font-size: 1.5rem !important;
    }
}

/* ============================================
   Tables Mobile Styles
   ============================================ */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
        overflow: hidden;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.4rem !important;
        white-space: nowrap;
    }
}

/* ============================================
   Assessment Form Mobile Styles
   ============================================ */
@media (max-width: 768px) {
    .form-progress {
        padding: 1rem 0.5rem !important;
        overflow-x: auto;
    }

    .form-step {
        min-width: 60px;
    }

    .step-circle {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
    }

    .step-label {
        font-size: 0.7rem !important;
        max-width: 60px;
    }

    .section-card {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .section-card h5 {
        font-size: 1rem !important;
    }
}

@media (max-width: 576px) {
    .form-progress {
        padding: 0.75rem 0.25rem !important;
    }

    .step-circle {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.8rem !important;
    }

    .step-label {
        display: none;
        /* Hide labels on very small screens */
    }

    .section-card {
        padding: 0.75rem !important;
        border-radius: 10px !important;
    }

    .input-group-text {
        padding: 0.5rem 0.75rem !important;
        min-width: 40px !important;
    }
}

/* ============================================
   Assessment Results Mobile Styles
   ============================================ */
@media (max-width: 768px) {
    .risk-gauge-container {
        max-width: 250px;
        margin: 0 auto;
    }

    .result-card {
        padding: 1rem !important;
    }

    .recommendation-item {
        padding: 0.75rem !important;
    }

    /* Professional tabs on mobile */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   Modal Mobile Styles
   ============================================ */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 16px;
    }

    .modal-header,
    .modal-footer {
        padding: 0.75rem 1rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* ============================================
   Dropdown Menu Mobile Styles
   ============================================ */
@media (max-width: 576px) {
    .dropdown-menu {
        max-width: calc(100vw - 1rem);
        border-radius: 12px !important;
    }

    .dropdown-item {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Sidebar Mobile Styles
   ============================================ */
@media (max-width: 991px) {

    .sidebar,
    .offcanvas {
        max-width: 280px;
    }

    .sidebar .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Alert & Toast Mobile Styles
   ============================================ */
@media (max-width: 576px) {
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .toast {
        min-width: auto;
        max-width: calc(100vw - 2rem);
    }
}

/* ============================================
   Fix for iOS Input Zoom
   ============================================ */
@media (max-width: 768px) {

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ============================================
   Touch-Friendly Improvements
   ============================================ */
@media (max-width: 768px) {

    /* Larger touch targets */
    .form-check-input {
        width: 1.25em;
        height: 1.25em;
    }

    .btn-close {
        width: 1.25em;
        height: 1.25em;
    }

    /* Remove hover effects on touch devices */
    @media (hover: none) {

        .card:hover,
        .btn:hover {
            transform: none !important;
            box-shadow: inherit !important;
        }
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .no-print,
    header,
    footer,
    .sidebar,
    .btn,
    .form-progress {
        display: none !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}