/* ============================================
   UNIFIED STYLESHEET FOR USE CASE PAGES
   Consolidates: reset.css, layout.css, navigation.css, hero.css, critical.css
   ============================================ */

/* ============================================
   1. RESET AND BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-display: swap;
    line-height: 1.6;
    color: #2c3e50;
    background: #ffffff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   2. TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 {
    font-size: 2rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
}

/* ============================================
   3. LAYOUT AND CONTAINER
   ============================================ */

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================
   4. NAVIGATION (STICKY WITH MOBILE MENU)
   ============================================ */

nav {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: relative;
}

.nav-container-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #34495e;
    text-decoration: none;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(52, 152, 219, 0.1);
}

.mobile-menu-toggle:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: #2c3e50;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger animation when menu is open */
.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile navigation menu */
.nav-links,
.nav-menu {
    display: none;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    background: none;
    box-shadow: none;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    border-radius: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nav-links.active,
.nav-menu.active {
    display: flex;
    opacity: 1;
    max-height: 100px;
}

.nav-links li,
.nav-menu li {
    margin: 0;
}

.nav-links a,
.nav-menu a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    min-height: auto;
    display: inline-block;
    border-bottom: none;
}

.nav-links a:hover,
.nav-menu a:hover {
    color: #3498db;
    background: none;
}

.nav-links a::after,
.nav-menu a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-menu a:hover::after {
    width: 100%;
}

/* ============================================
   5. HERO SECTION (GRADIENT BACKGROUND)
   ============================================ */

.hero,
.hero-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-section .container {
    max-width: 100%;
    width: 100%;
}

.hero-content {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.hero h1,
.hero-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 1rem;
    font-weight: 400;
}

.hero-description {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ============================================
   6. CALL-TO-ACTION SECTION
   ============================================ */

.cta-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 3rem 0;
    text-align: center;
    margin-top: 3rem;
}

.cta-section h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.1rem;
    color: #495057;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.2);
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.cta-button:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.3);
    color: white;
}

/* ============================================
   7. CONTENT SECTIONS
   ============================================ */

main {
    padding: 2rem 0;
}

article {
    max-width: 1200px;
    margin: 0 auto;
}

section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ============================================
   8. FOOTER
   ============================================ */

footer {
    background: #2c3e50;
    color: #ffffff;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

footer a {
    color: #3498db;
}

footer a:hover {
    color: #5dade2;
}

/* ============================================
   9. ACCESSIBILITY STYLES
   ============================================ */

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 4px;
}

.skip-link:focus {
    top: 0;
}

.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;
}

/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0078d4;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background: #ffffff;
        color: #000000;
    }
    
    .hero {
        background: #ffffff !important;
    }
    
    .cta-section {
        background: #ffffff !important;
    }
    
    .cta-button {
        background: #000000 !important;
        color: #ffffff !important;
        border: 2px solid #000000 !important;
    }
    
    .nav-menu a {
        color: #000000 !important;
    }
}

/* ============================================
   10. RESPONSIVE BREAKPOINTS
   ============================================ */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
        padding: 0 1.5rem;
    }
    
    .hero,
    .hero-section {
        padding: 3rem 0;
        min-height: 65vh;
    }
    
    .hero h1,
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .cta-button {
        display: inline-block;
        margin: 0;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 2rem;
    }
    
    .nav-container {
        flex-direction: row;
        padding: 1rem 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .nav-container-top {
        display: contents;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    /* Hide mobile menu toggle on desktop */
    .mobile-menu-toggle {
        display: none;
    }
    
    /* Show desktop navigation */
    .nav-links,
    .nav-menu {
        display: flex !important;
        position: static;
        flex-direction: row;
        gap: 1.5rem;
        background: none;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        opacity: 1;
        transform: none;
        transition: none;
        max-height: none;
        overflow: visible;
        margin: 0;
    }
    
    .nav-links a,
    .nav-menu a {
        padding: 0.5rem 0;
        background: none !important;
        border-bottom: none;
        min-height: auto;
    }
    
    .nav-links a::after,
    .nav-menu a::after {
        bottom: -5px;
        left: 0;
        top: auto;
        width: 0;
        height: 2px;
    }
    
    .nav-links a:hover::after,
    .nav-menu a:hover::after {
        width: 100%;
        height: 2px;
    }
    
    .hero,
    .hero-section {
        padding: 4rem 0;
        min-height: 70vh;
    }
    
    .hero-content {
        max-width: 1200px;
        padding: 0 2rem;
    }
    
    .hero h1,
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.7;
    }
    
    .cta-button {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.25rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    h1 {
        font-size: 3.25rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .hero h1,
    .hero-section h1 {
        font-size: 3.5rem;
    }
    
    h1 {
        font-size: 3.5rem;
    }
}

/* ============================================
   11. DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    body {
        background: #121212;
        color: #e0e0e0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #ffffff;
    }
    
    a {
        color: #5dade2;
    }
    
    a:hover {
        color: #3498db;
    }
    
    /* Navigation */
    nav {
        background: #1e1e1e;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    
    .logo {
        color: #ffffff;
    }
    
    .hamburger-line {
        background: #e0e0e0;
    }
    
    .nav-links,
    .nav-menu {
        background: #1e1e1e;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    
    .nav-links a,
    .nav-menu a {
        color: #e0e0e0;
        border-bottom: none;
    }
    
    .nav-links a:hover,
    .nav-menu a:hover {
        color: #5dade2;
        background: none;
    }
    
    /* Hero Section */
    .hero,
    .hero-section {
        background: linear-gradient(135deg, #1e1e1e 0%, #121212 100%);
    }
    
    .hero h1,
    .hero-section h1 {
        color: #ffffff;
    }
    
    .hero-subtitle {
        color: #b0b0b0;
    }
    
    .hero-description {
        color: #d0d0d0;
    }
    
    /* CTA Section */
    .cta-section {
        background: linear-gradient(135deg, #1e1e1e 0%, #121212 100%);
    }
    
    .cta-section h2 {
        color: #ffffff;
    }
    
    .cta-section p {
        color: #d0d0d0;
    }
    
    .cta-button {
        background: #3498db;
        color: #ffffff;
    }
    
    .cta-button:hover {
        background: #5dade2;
        color: #ffffff;
    }
    
    /* Content Sections */
    section h2,
    section h3 {
        color: #ffffff;
    }
    
    /* Footer */
    footer {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    footer a {
        color: #5dade2;
    }
    
    footer a:hover {
        color: #3498db;
    }
    
    /* Skip Links */
    .skip-link {
        background: #ffffff;
        color: #000000;
    }
}

/* ============================================
   12. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Font display swap for web fonts */
@font-face {
    font-family: 'System UI';
    font-display: swap;
    src: local('Segoe UI'), local('system-ui'), local('-apple-system'), local('BlinkMacSystemFont');
}

/* Image lazy loading support */
img {
    max-width: 60%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    nav,
    .cta-section,
    footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
}


/* ============================================
   IMAGE FIX - Ensure images are always visible
   ============================================ */
img {
    opacity: 1 !important;
    display: block !important;
    max-width: 60%;
    height: auto;
    margin: 1rem auto;
}

/* Override any loading states that hide images */
img.loading,
img.lazy,
img[loading] {
    opacity: 1 !important;
    display: block !important;
}

/* Ensure figure images display properly */
figure img {
    opacity: 1 !important;
    display: block !important;
    max-width: 60%;
    margin: 1rem auto;
}
