/* Semantic HTML and Accessibility Enhancements */

/* 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-width: 0;
}

/* Focus visible styles for better keyboard navigation */
*:focus-visible {
    outline: 2px solid #64b5f6;
    outline-offset: 2px;
}

/* Ensure proper heading hierarchy styling */
h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.625rem;
}

h5 {
    font-size: 1.125rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

h6 {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* Footer styling */
.footer {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.footer nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer nav li {
    margin: 0;
}

.footer nav a {
    color: #64b5f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer nav a:hover,
.footer nav a:focus {
    color: #42a5f5;
    text-decoration: underline;
}

/* Logo text styling (replacing h1 in nav) */
.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #64b5f6, #42a5f5, #2196f3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Ensure proper ARIA live region styling */
[aria-live="polite"],
[aria-live="assertive"] {
    position: relative;
}

/* Loading spinner accessibility */
.loading-spinner[aria-busy="true"] {
    display: block;
}

/* Status messages */
[role="status"],
[role="alert"] {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Improve button accessibility */
button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

button:not(:disabled):hover,
button:not(:disabled):focus {
    transform: translateY(-1px);
}

/* Ensure proper list semantics */
[role="list"] {
    list-style: none;
    padding: 0;
}

[role="listitem"] {
    margin-bottom: 0.5rem;
}

/* Navigation improvements */
nav[role="navigation"] ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Breadcrumb improvements */
nav[aria-label="Breadcrumb"] {
    margin: 1rem 0;
}

nav[aria-label="Breadcrumb"] [aria-current="page"] {
    font-weight: bold;
    color: #64b5f6;
}

/* Dialog/Modal accessibility */
[role="dialog"][aria-modal="true"] {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* Complementary content (aside) styling */
aside[role="complementary"] {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

/* Main content area */
main[role="main"] {
    min-height: 60vh;
    padding-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .footer nav ul {
        flex-direction: column;
        gap: 1rem;
    }

}

/* High contrast mode support */
@media (prefers-contrast: high) {

    *:focus-visible {
        outline: 3px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    button:not(:disabled):hover,
    button:not(:disabled):focus {
        transform: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
