/**
 * Master Page Headers CSS
 * Standardizes all page header sizes across the application
 * Reference: SBVMS header (1.5rem / 24px)
 * All page headers should be equal or smaller than this size
 */

/* ===================================
   PRIMARY PAGE HEADERS
   ================================ */

/* Main page titles - matching SBVMS navbar brand size */
.page-title,
.main-title,
h1.mb-0,
h2.mb-0 {
    font-size: 1.5rem !important;      /* 24px - Same as SBVMS */
    font-weight: 600 !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
    color: #2c3e50 !important;
}

/* ===================================
   SECONDARY HEADERS
   ================================ */

/* Section headers - slightly smaller */
.section-header,
.content-header h2,
h3 {
    font-size: 1.25rem !important;     /* 20px - Smaller than SBVMS */
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #2c3e50 !important;
}

/* ===================================
   TERTIARY HEADERS
   ================================ */

/* Card headers and subsection titles */
.card-title,
.subsection-title,
h4 {
    font-size: 1.1rem !important;      /* 17.6px - Smaller than SBVMS */
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #2c3e50 !important;
}

/* ===================================
   SMALL HEADERS
   ================================ */

/* Table headers and small sections */
.table-title,
h5 {
    font-size: 1rem !important;        /* 16px - Smaller than SBVMS */
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: #2c3e50 !important;
}

/* ===================================
   MINI HEADERS
   ================================ */

/* Very small section headers */
h6,
.mini-header {
    font-size: 0.875rem !important;    /* 14px - Much smaller than SBVMS */
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: #2c3e50 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   SPECIFIC PAGE HEADERS
   ================================ */

/* Task List Page */
.tasks-header h2,
#taskListHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Programs Page */
.programs-header h2,
#programsHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* SBUSA Volunteers Page */
.volunteers-header h2,
#volunteersHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Registered Users Page */
.registered-users-container .users-title,
.users-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
}

/* Approval Portal Header */
.approval-portal-header h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Documents & Templates Page */
.docs-header h2,
#docsHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* RBAC / Permissions Page */
.rbac-header h2,
#rbacHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Organization Hierarchy Page */
.org-header h2,
#orgHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Admin Panel Page */
.admin-header h2,
#adminHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Meetings & RSVP Page */
.meetings-header h2,
#meetingsHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* AI Center Page */
.ai-center-header h1,
.ai-center-header h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Careers/Volunteer Hours Page */
.careers-header h2,
#careersHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Dashboard Page */
.dashboard-header h2,
#dashboardHeader h2 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* ===================================
   HEADER WITH ICONS
   ================================ */

/* Headers that include icons (like "My Tasks", "Programs", etc.) */
.page-title i,
.main-title i,
h1.mb-0 i,
h2.mb-0 i {
    font-size: 1.3rem !important;      /* Slightly smaller than text */
    margin-right: 0.5rem !important;
    vertical-align: middle !important;
}

/* ===================================
   MODAL HEADERS
   ================================ */

/* Modal titles */
.modal-title,
.modal-header h5 {
    font-size: 1.25rem !important;     /* 20px - Smaller than SBVMS */
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #2c3e50 !important;
}

/* ===================================
   TABLE HEADERS
   ================================ */

/* Table column headers */
.table thead th,
.users-table th {
    font-size: 0.875rem !important;    /* 14px - Much smaller than SBVMS */
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #495057 !important;
}

/* ===================================
   FORM SECTION HEADERS
   ================================ */

/* Headers within forms */
.form-section-header,
fieldset legend {
    font-size: 1.1rem !important;      /* 17.6px - Smaller than SBVMS */
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 1rem !important;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   ================================ */

/* Mobile devices - reduce all headers proportionally */
@media (max-width: 768px) {
    .page-title,
    .main-title,
    h1.mb-0,
    h2.mb-0 {
        font-size: 1.3rem !important;  /* 20.8px on mobile */
    }
    
    .section-header,
    .content-header h2,
    h3 {
        font-size: 1.15rem !important; /* 18.4px on mobile */
    }
    
    .card-title,
    .subsection-title,
    h4 {
        font-size: 1rem !important;    /* 16px on mobile */
    }
    
    .table-title,
    h5 {
        font-size: 0.95rem !important; /* 15.2px on mobile */
    }
    
    h6,
    .mini-header {
        font-size: 0.85rem !important; /* 13.6px on mobile */
    }
    
    .modal-title,
    .modal-header h5 {
        font-size: 1.15rem !important; /* 18.4px on mobile */
    }
}

/* Extra small devices - further reduce */
@media (max-width: 576px) {
    .page-title,
    .main-title,
    h1.mb-0,
    h2.mb-0 {
        font-size: 1.2rem !important;  /* 19.2px on extra small */
    }
    
    .section-header,
    .content-header h2,
    h3 {
        font-size: 1.1rem !important;  /* 17.6px on extra small */
    }
    
    .card-title,
    .subsection-title,
    h4 {
        font-size: 0.95rem !important; /* 15.2px on extra small */
    }
}

/* ===================================
   UTILITY CLASSES
   ================================ */

/* Force header size matching SBVMS exactly */
.header-size-sbvms {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

/* Force header size smaller than SBVMS */
.header-size-small {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

/* Force header size much smaller than SBVMS */
.header-size-mini {
    font-size: 1rem !important;
    font-weight: 600 !important;
}

/* ===================================
   CONSISTENCY RULES
   ================================ */

/* Ensure all headers have consistent spacing */
.page-title,
.main-title,
.section-header,
.content-header h2,
.card-title,
.subsection-title,
h1, h2, h3, h4, h5, h6 {
    margin-top: 0 !important;
}

/* Ensure consistent color scheme */
.page-title,
.main-title,
.section-header,
.subsection-title,
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50 !important;
}

/* White text for headers on dark backgrounds */
.bg-primary .page-title,
.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-dark .page-title,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
[style*="background: linear-gradient"] h1,
[style*="background: linear-gradient"] h2,
[style*="background: linear-gradient"] h3,
[style*="background: linear-gradient"] h4 {
    color: white !important;
}

/* ===================================
   PRINT STYLES
   ================================ */

/* Maintain header hierarchy in print */
@media print {
    .page-title,
    .main-title,
    h1.mb-0,
    h2.mb-0 {
        font-size: 18pt !important;
        page-break-after: avoid !important;
    }
    
    .section-header,
    h3 {
        font-size: 16pt !important;
        page-break-after: avoid !important;
    }
    
    .card-title,
    h4 {
        font-size: 14pt !important;
        page-break-after: avoid !important;
    }
    
    h5 {
        font-size: 12pt !important;
    }
    
    h6 {
        font-size: 10pt !important;
    }
}

/* ===================================
   ACCESSIBILITY
   ================================ */

/* Ensure headers are focusable and have proper contrast */
.page-title:focus,
.main-title:focus,
h1:focus,
h2:focus,
h3:focus,
h4:focus,
h5:focus,
h6:focus {
    outline: 2px solid #0d6efd !important;
    outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .page-title,
    .main-title,
    h1, h2, h3, h4, h5, h6 {
        color: #000000 !important;
        font-weight: 700 !important;
    }
}

/* ===================================
   END OF MASTER HEADERS CSS
   ================================ */

