/* ==============================================
   EmergencyHelper.co.uk - Main Stylesheet
   Global Styles
   ============================================== */

:root {
    --eh-primary: #E8430A;
    --eh-primary-dark: #C13808;
    --eh-primary-light: #FF6B35;
    --eh-dark: #1A1A1A;
    --eh-gray: #6C757D;
    --eh-light: #F8F9FA;
    --eh-white: #FFFFFF;
    --eh-success: #28A745;
    --eh-warning: #FFC107;
    --eh-danger: #DC3545;
}

/* ===== Base ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--eh-dark);
    line-height: 1.6;
}

a {
    color: var(--eh-primary);
}

a:hover {
    color: var(--eh-primary-dark);
}

/* ===== Emergency Button Styles ===== */
.btn-emergency {
    background-color: var(--eh-primary);
    border-color: var(--eh-primary);
    color: #fff;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-emergency:hover,
.btn-emergency:focus {
    background-color: var(--eh-primary-dark);
    border-color: var(--eh-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 67, 10, 0.3);
}

.btn-outline-emergency {
    color: var(--eh-primary);
    border-color: var(--eh-primary);
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-outline-emergency:hover,
.btn-outline-emergency:focus {
    background-color: var(--eh-primary);
    border-color: var(--eh-primary);
    color: #fff;
}

.text-emergency {
    color: var(--eh-primary) !important;
}

.bg-emergency {
    background-color: var(--eh-primary) !important;
}

/* ===== Navbar ===== */
.navbar {
    padding: 0.5rem 0;
}

.navbar-brand {
    font-weight: 700;
}

.navbar .nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    transition: color 0.2s ease;
    min-height: 44px;
}

.navbar .nav-link:hover {
    color: var(--eh-primary) !important;
}

/* ===== Section Titles ===== */
.section-title {
    font-weight: 800;
    font-size: 2rem;
    color: var(--eh-dark);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Cards ===== */
.card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
}

/* ===== Forms ===== */
.form-control:focus {
    border-color: var(--eh-primary);
    box-shadow: 0 0 0 0.2rem rgba(232, 67, 10, 0.15);
}

.form-control-lg {
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

/* ===== Footer ===== */
.site-footer {
    margin-top: 0;
}

.site-footer a:hover {
    color: var(--eh-primary) !important;
    opacity: 1 !important;
}

/* ===== Prevent horizontal overflow ===== */
html, body {
    overflow-x: hidden;
}

/* ===== Mobile navbar collapse centering ===== */
@media (max-width: 991.98px) {
    .navbar-collapse .navbar-nav {
        align-items: center;
        text-align: center;
    }

    .navbar-collapse .navbar-nav:first-child {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .navbar-collapse .navbar-nav:first-child .nav-item {
        width: 50%;
    }

    .navbar-collapse .navbar-nav .d-flex.align-items-center {
        justify-content: center;
    }

    .navbar-collapse .navbar-nav.ms-auto {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .container.py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .form-control-lg {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }

    /* Admin tables: truncate long content */
    .table td {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* But allow wrapping on name/service columns */
    .table td:first-child,
    .table td:nth-child(2) {
        white-space: normal;
        max-width: 100px;
        word-break: break-word;
    }

    small, .small {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.35rem;
    }

    .container.py-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Stat number reduction */
    .fs-2 {
        font-size: 1.5rem !important;
    }

    /* Mobile-friendly tables */
    .table {
        font-size: 0.82rem;
    }

    .table th,
    .table td {
        padding: 0.45rem 0.5rem;
        max-width: 120px;
    }

    .table td:first-child {
        max-width: 80px;
    }

    .form-control-lg {
        padding: 0.45rem 0.65rem;
        font-size: 0.9rem;
    }

    .navbar .nav-link {
        min-height: 44px;
    }

    .nav-service-label {
        font-size: 0.8rem;
    }

    /* Ensure minimum readable font sizes on mobile */
    .badge {
        font-size: 0.75rem !important;
    }

    code {
        font-size: 0.78rem;
    }

    small, .small {
        font-size: 0.78rem;
    }
}

/* Nav service label default */
.nav-service-label {
    font-size: 0.75rem;
}

/* Very narrow phones */
@media (max-width: 400px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

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

/* ===== Service Card Radio Buttons ===== */
.btn-check:checked + .btn-outline-secondary {
    background-color: var(--eh-primary) !important;
    border-color: var(--eh-primary) !important;
    color: #fff !important;
}

/* ===== Badge ===== */
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ===== Smooth Scroll ===== */
html {
    scroll-behavior: smooth;
}
