/* Resources Page Specific Styles - Flash/Timing Fix */

/* ===================================
   CRITICAL FIX: Prevent header from covering content during load
   =================================== */

/* Ensure the page has proper top spacing BEFORE header loads */
body {
    padding-top: 120px !important; /* Reserve space for header immediately */
}

/* Override main.css body padding issues */
body.page-content {
    padding-top: 120px !important; /* Keep consistent spacing */
}

/* Ensure header container doesn't interfere with content positioning */
#header-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    height: auto !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
}

/* ===================================
   PAGE HEADER - PREVENT FLASH/COVERING
   =================================== */

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 150px 0 100px !important; /* Reduced top padding since body has padding */
    text-align: center !important;
    position: relative !important;
    overflow: hidden !important;
    margin-top: 0 !important;
    color: white !important;
    z-index: 1 !important; /* Lower than header */
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="200" cy="200" r="150" fill="rgba(255,255,255,0.1)" /><circle cx="800" cy="400" r="120" fill="rgba(255,255,255,0.08)" /></svg>');
    animation: float 20s ease-in-out infinite;
}

/* Ensure H1 is never covered */
.page-header h1 {
    font-size: 4rem !important;
    font-weight: 800 !important;
    color: white !important;
    margin: 0 0 30px 0 !important;
    text-align: center !important;
    position: relative !important;
    z-index: 2 !important;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    line-height: 1.1 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.page-header p {
    font-size: 1.4rem !important;
    color: rgba(255,255,255,0.95) !important;
    text-align: center !important;
    max-width: 700px !important;
    margin: 0 auto 50px !important;
    position: relative !important;
    z-index: 2 !important;
    line-height: 1.6 !important;
}

/* Header stats */
.header-stats {
    display: flex !important;
    justify-content: center !important;
    gap: 60px !important;
    margin-top: 50px !important;
    position: relative !important;
    z-index: 2 !important;
}

.stat-item {
    text-align: center !important;
    color: white !important;
}

.stat-number {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    display: block !important;
    margin-bottom: 10px !important;
    color: white !important;
}

.stat-label {
    font-size: 1rem !important;
    opacity: 0.9 !important;
    color: white !important;
}

/* ===================================
   SCROLL INDICATOR
   =================================== */

.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* ===================================
   SECTIONS
   =================================== */

.section-title {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    z-index: 2;
}

.section-title h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.3rem;
    color: #6c757d;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 400;
}

/* Resources Section */
.features-section {
    padding: 120px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin-top: -60px !important;
    position: relative;
    z-index: 2 !important;
}

/* Resource Cards */
.resource-card {
    background: white;
    border-radius: 25px;
    padding: 50px 40px;
    text-align: center;
    height: 100%;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.resource-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
}

.resource-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

.resource-card p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.7;
}

/* Feature Icons */
.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto 25px;
    transition: transform 0.3s ease;
}

.resource-card:hover .feature-icon {
    transform: scale(1.1);
}

/* Feature Lists */
.feature-list {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-bottom: 30px;
}

.feature-list li {
    padding: 8px 0;
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.feature-list .fas.fa-check {
    color: #28a745;
    margin-right: 10px;
    font-weight: bold;
    min-width: 20px;
}

.resource-cta {
    background: #2c5aa0;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
}

.resource-cta:hover {
    background: #1e3d6f;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Why Choose / Benefits Section */
.why-choose-section {
    padding: 120px 0;
    background: white;
}

.benefit-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.benefit-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.benefit-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}

.benefit-card:hover .benefit-icon {
    transform: scale(1.1);
}

.benefit-card h4 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.benefit-card p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Newsletter Section */
.newsletter-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.newsletter-card {
    background: white;
    border-radius: 25px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    max-width: 800px;
    margin: 0 auto;
}

.newsletter-card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: 700;
}

.newsletter-card p {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto 20px;
}

.newsletter-form .input-group {
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.newsletter-form .form-control {
    border: none;
    padding: 18px 25px;
    font-size: 16px;
    border-radius: 50px 0 0 50px;
}

.newsletter-form .btn {
    border-radius: 0 50px 50px 0;
    padding: 18px 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d6f 100%);
}

.newsletter-disclaimer {
    color: #6c757d;
    font-size: 14px;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 100px 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="200" cy="200" r="150" fill="rgba(255,255,255,0.1)" /><circle cx="800" cy="400" r="100" fill="rgba(255,255,255,0.05)" /></svg>');
    animation: float 15s ease-in-out infinite reverse;
}

.cta-section h2 {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.cta-section p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
    opacity: 0.95;
}

.cta-buttons {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d6f 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 90, 160, 0.4);
    color: white;
    text-decoration: none;
}

.btn-outline-primary {
    background: transparent;
    color: #2c5aa0;
    border: 2px solid #2c5aa0;
}

.btn-outline-primary:hover {
    background: #2c5aa0;
    color: white;
    text-decoration: none;
}

.btn-outline-light {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-light:hover {
    background: white;
    color: #2c5aa0;
    text-decoration: none;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Animations */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    25% { 
        transform: translateY(-20px) rotate(1deg); 
    }
    50% { 
        transform: translateY(0px) rotate(0deg); 
    }
    75% { 
        transform: translateY(15px) rotate(-1deg); 
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    body,
    body.page-content {
        padding-top: 100px !important;
    }
    
    .page-header {
        padding: 60px 0 80px !important;
    }
    
    .page-header h1 {
        font-size: 3rem !important;
    }
    
    .page-header p {
        font-size: 1.2rem !important;
    }
    
    .header-stats {
        flex-direction: column !important;
        gap: 30px !important;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
    
    .resource-card {
        padding: 40px 30px;
    }
    
    .benefit-card {
        padding: 30px 20px;
        margin-bottom: 20px;
    }
    
    .newsletter-card {
        padding: 40px 30px;
    }
    
    .cta-section h2 {
        font-size: 2.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 576px) {
    body,
    body.page-content {
        padding-top: 90px !important;
    }
    
    .page-header {
        padding: 40px 0 60px !important;
    }
    
    .page-header h1 {
        font-size: 2.5rem !important;
    }
    
    .page-header p {
        font-size: 1.1rem !important;
    }
    
    .header-stats {
        gap: 20px !important;
    }
    
    .stat-number {
        font-size: 1.8rem !important;
    }
    
    .resource-card,
    .newsletter-card {
        padding: 30px 20px;
    }
    
    .feature-icon,
    .benefit-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .cta-section h2 {
        font-size: 2rem;
    }
}

/* ===================================
   ADDITIONAL SECTIONS FOR COMPLETENESS
   =================================== */

/* Page loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-content h4 {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
    opacity: 0.9;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================
   FORM ELEMENTS
   =================================== */

.form-group {
    margin-bottom: 30px;
}

.form-label {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.form-control {
    border-radius: 15px;
    border: 3px solid #e9ecef;
    padding: 15px 20px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
}

.form-control:focus {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 0.25rem rgba(44, 90, 160, 0.15);
    transform: translateY(-2px);
    outline: none;
}

.form-select {
    border-radius: 15px;
    border: 3px solid #e9ecef;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 500;
}

.form-check {
    margin-top: 20px;
}

.form-check-input:checked {
    background-color: #2c5aa0;
    border-color: #2c5aa0;
}

.form-check-label {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* ===================================
   INPUT GROUPS
   =================================== */

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    margin-bottom: 0;
}

.input-group .btn {
    position: relative;
    z-index: 2;
}

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

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-5 {
    margin-top: 3rem !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.gap-3 {
    gap: 1rem !important;
}

.gap-4 {
    gap: 1.5rem !important;
}

/* ===================================
   BOOTSTRAP GRID OVERRIDES
   =================================== */

.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-lg-4,
.col-lg-3,
.col-lg-6,
.col-lg-8,
.col-md-6 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* ===================================
   ADDITIONAL ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation utility classes */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

/* Animation delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

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

@media print {
    .page-header,
    .cta-section {
        background: none !important;
        color: #333 !important;
    }
    
    .feature-icon,
    .benefit-icon {
        background: #f8f9fa !important;
        color: #333 !important;
    }
    
    .btn,
    .resource-cta {
        display: none;
    }
    
    .page-loader,
    .scroll-indicator {
        display: none !important;
    }
}

/* ===================================
   DARK MODE SUPPORT (Optional)
   =================================== */

@media (prefers-color-scheme: dark) {
    .resource-card,
    .benefit-card,
    .newsletter-card {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: #333;
    }
    
    .resource-card h3,
    .benefit-card h4,
    .newsletter-card h2 {
        color: #fff;
    }
    
    .resource-card p,
    .benefit-card p,
    .newsletter-card p {
        color: #ccc;
    }
}

/* ===================================
   FOCUS STYLES FOR ACCESSIBILITY
   =================================== */

.btn:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

.resource-card:focus-within,
.benefit-card:focus-within {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

.form-control:focus,
.form-select:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .resource-card,
    .benefit-card,
    .newsletter-card {
        border: 2px solid #000;
    }
    
    .feature-icon,
    .benefit-icon {
        border: 2px solid #000;
    }
}
