/**
 * WFGNA Custom Styles
 * Designed for elderly users - large text, high contrast, generous spacing
 */

/* ============================================================================
   Base Typography - Larger, More Readable
   ============================================================================ */

html {
    font-size: 16px;
}

body {
    font-size: 1rem;
    line-height: 1.6;
    color: #212529;
    background-color: #f8f9fa;
}

h1, .h1 { font-size: 2rem; }
h2, .h2 { font-size: 1.75rem; }
h3, .h3 { font-size: 1.5rem; }
h4, .h4 { font-size: 1.25rem; }
h5, .h5 { font-size: 1.125rem; }
h6, .h6 { font-size: 1rem; }

/* Important content should be larger */
.lead,
.card-title,
.alert {
    font-size: 1.125rem;
}

/* ============================================================================
   Touch Targets - Minimum 44x44px
   ============================================================================ */

.btn {
    min-height: 44px;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
}

.btn-lg {
    min-height: 52px;
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

.btn-sm {
    min-height: 38px;
    padding: 0.5rem 1rem;
}

/* Form controls */
.form-control,
.form-select {
    min-height: 44px;
    padding: 0.625rem 1rem;
    font-size: 1rem;
}

.form-control-lg,
.form-select-lg {
    min-height: 52px;
    padding: 0.75rem 1.25rem;
    font-size: 1.125rem;
}

/* Checkboxes and radios */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.125em;
}

.form-check-label {
    padding-left: 0.25rem;
}

/* Nav links */
.nav-link {
    padding: 0.75rem 1rem;
}

/* Dropdown items */
.dropdown-item {
    padding: 0.625rem 1.25rem;
}

/* ============================================================================
   High Contrast - Clear Visual Hierarchy
   ============================================================================ */

/* Text colors - avoid light grays */
.text-muted {
    color: #6c757d !important;
}

/* Links - clearly visible */
a {
    color: #198754;
    text-decoration-thickness: 2px;
}

a:hover {
    color: #146c43;
    text-decoration: underline;
}

/* Focus states - very visible */
:focus,
:focus-visible {
    outline: 3px solid rgba(25, 135, 84, 0.5);
    outline-offset: 2px;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* ============================================================================
   Spacing - Generous, Breathable Layouts
   ============================================================================ */

.card {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* Section spacing */
section,
.section {
    margin-bottom: 2rem;
}

/* Form groups */
.mb-3 {
    margin-bottom: 1.25rem !important;
}

/* ============================================================================
   Navigation - Clear and Simple
   ============================================================================ */

.navbar {
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
}

/* User dropdown */
.navbar .dropdown-menu {
    min-width: 200px;
    padding: 0.5rem;
}

/* ============================================================================
   Alerts - Front and Center (No Toasts!)
   ============================================================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    border-width: 2px;
    font-size: 1rem;
}

.alert-dismissible .btn-close {
    padding: 1.125rem 1rem;
}

/* Make icons more visible in alerts */
.alert i {
    font-size: 1.25rem;
    vertical-align: -2px;
}

/* ============================================================================
   Modals - Centered, Clear
   ============================================================================ */

.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
}

.modal-title {
    font-weight: 600;
}

/* ============================================================================
   Tables - Easy to Read
   ============================================================================ */

.table {
    font-size: 1rem;
}

.table th {
    font-weight: 600;
    padding: 1rem;
    background-color: #f8f9fa;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(25, 135, 84, 0.05);
}

/* ============================================================================
   Badges and Pills - Legible
   ============================================================================ */

.badge {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
}

/* ============================================================================
   Form Labels - Clear
   ============================================================================ */

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.375rem;
}

/* Required field indicator */
.required-label::after {
    content: " *";
    color: #dc3545;
}

/* ============================================================================
   Custom Components
   ============================================================================ */

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Loading spinner button */
.btn .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

/* Input groups - consistent height */
.input-group-text {
    min-height: 44px;
}

/* ============================================================================
   Responsive Adjustments
   ============================================================================ */

@media (max-width: 576px) {
    html {
        font-size: 15px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.875rem 1rem;
    }
    
    /* Stack buttons on mobile */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .navbar,
    .btn,
    .alert-dismissible .btn-close,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6;
        box-shadow: none;
    }
}

/* ============================================================================
   Sidebar Accordion Styles
   ============================================================================ */

/* Quick Actions Toolbar */
.quick-actions-bar {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.quick-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
}

.quick-action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.quick-action-btn i {
    font-size: 1.125rem;
}

.quick-action-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
    min-width: 16px;
}

/* Parent Section Toggles (Mobile User/Admin) */
.sidebar-parent-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-parent-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sidebar-parent-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-parent-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* Accordion Item */
.sidebar-accordion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-accordion-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-accordion-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-accordion-toggle[aria-expanded="true"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-accordion-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.toggle-icon {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

/* Accordion Content - Nav Links (menu items, no icons, indented) */
.sidebar-accordion-item .collapse {
    background: rgba(0, 0, 0, 0.15);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 0.75rem;
}

.sidebar-accordion-item .nav-link {
    padding: 0.5rem 1rem 0.5rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 400;
    border-left: none;
    transition: all 0.2s ease;
}

.sidebar-accordion-item .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-accordion-item .nav-link.active {
    color: #fff;
    background: rgba(25, 135, 84, 0.3);
    font-weight: 500;
}

.sidebar-accordion-item .nav-link .badge {
    font-size: 0.65rem;
}

/* Desktop Sidebar - Links directly under dashboard don't need extra indent */
.sidebar-desktop > .nav .nav-link {
    padding: 0.625rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-desktop > .nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-desktop > .nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #198754;
}

/* Mobile-specific adjustments */
.sidebar-mobile .sidebar-accordion-item .nav-link {
    padding-left: 1.25rem;
}

/* Collapse animation smoothing */
.sidebar-accordion-item .collapse,
.sidebar-parent-section .collapse {
    transition: none;
}

.sidebar-accordion-item .collapsing,
.sidebar-parent-section .collapsing {
    transition: height 0.2s ease;
}
