/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Accessibility Toolbar */
.accessibility-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.accessibility-btn {
    background: rgba(102, 126, 234, 0.3);
    color: #fff;
    border: 2px solid #667eea;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
}

.accessibility-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.accessibility-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

.accessibility-btn:active,
.accessibility-btn.active {
    background: rgba(102, 126, 234, 0.7);
    border-color: #764ba2;
}

.accessibility-btn span[aria-hidden="true"] {
    font-size: 1.2rem;
}

/* CSS-based Icons */
.icon-contrast {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(90deg, #fff 0%, #fff 50%, #000 50%, #000 100%);
    border: 2px solid #fff;
    flex-shrink: 0;
}

.icon-spacing {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.icon-spacing::before,
.icon-spacing::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 2px;
    background: #fff;
}

.icon-spacing::before {
    left: 0;
}

.icon-spacing::after {
    right: 0;
}

.icon-spacing {
    background: linear-gradient(90deg, 
        transparent 0%, transparent 35%, 
        #fff 35%, #fff 40%, 
        transparent 40%, transparent 60%, 
        #fff 60%, #fff 65%, 
        transparent 65%, transparent 100%);
}

/* High Contrast Mode */
body.high-contrast {
    background: #000;
    color: #fff;
}

body.high-contrast .header-wrapper {
    background: #000;
    border-bottom: 3px solid #fff;
}

body.high-contrast .main-header h1 {
    background: #fff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: none;
}

body.high-contrast .hero,
body.high-contrast .content-section {
    background: #000;
    border: 3px solid #fff;
}

body.high-contrast .hero h2,
body.high-contrast .content-section h3 {
    color: #fff;
}

body.high-contrast .hero p,
body.high-contrast .content-section p {
    color: #fff;
}

body.high-contrast .features-list li {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
}

body.high-contrast .main-footer {
    background: #000;
    border-top: 3px solid #fff;
}

body.high-contrast .main-footer p {
    color: #fff;
}

body.high-contrast .accessibility-toolbar {
    background: #000;
    border: 3px solid #fff;
}

body.high-contrast .accessibility-btn {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
}

body.high-contrast .accessibility-btn:hover {
    background: #fff;
    color: #000;
}

body.high-contrast .accessibility-btn:focus {
    outline: 3px solid #fff;
}

/* Enhanced Spacing Mode */
body.enhanced-spacing {
    line-height: 2.0;
    letter-spacing: 0.12em;
    word-spacing: 0.16em;
}

body.enhanced-spacing .main-header h1 {
    letter-spacing: 0.15em;
    line-height: 1.8;
}

body.enhanced-spacing .hero h2,
body.enhanced-spacing .content-section h3 {
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

body.enhanced-spacing .hero p,
body.enhanced-spacing .content-section p {
    line-height: 2.4;
    margin-bottom: 2rem;
}

body.enhanced-spacing .content-section {
    padding: 3.5rem;
    margin-bottom: 3rem;
}

body.enhanced-spacing .features-list li {
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    line-height: 2.0;
}

/* Text Size Adjustments */
body.text-small {
    font-size: 14px;
}

body.text-small .main-header h1 {
    font-size: clamp(2rem, 5vw, 4rem);
}

body.text-small .hero h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
}

body.text-small .hero p {
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
}

body.text-small .content-section h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

body.text-small .content-section p,
body.text-small .features-list li {
    font-size: 0.95rem;
}

body.text-large {
    font-size: 18px;
}

body.text-large .main-header h1 {
    font-size: clamp(3rem, 7vw, 6rem);
}

body.text-large .hero h2 {
    font-size: clamp(2.4rem, 4.5vw, 4rem);
}

body.text-large .hero p {
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}

body.text-large .content-section h3 {
    font-size: clamp(2rem, 3.5vw, 3rem);
}

body.text-large .content-section p,
body.text-large .features-list li {
    font-size: 1.25rem;
}

body.text-xlarge {
    font-size: 20px;
}

body.text-xlarge .main-header h1 {
    font-size: clamp(3.5rem, 8vw, 7rem);
}

body.text-xlarge .hero h2 {
    font-size: clamp(2.8rem, 5vw, 4.5rem);
}

body.text-xlarge .hero p {
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
}

body.text-xlarge .content-section h3 {
    font-size: clamp(2.25rem, 4vw, 3.5rem);
}

body.text-xlarge .content-section p,
body.text-xlarge .features-list li {
    font-size: 1.4rem;
}

body.text-xxlarge {
    font-size: 22px;
}

body.text-xxlarge .main-header h1 {
    font-size: clamp(4rem, 9vw, 8rem);
}

body.text-xxlarge .hero h2 {
    font-size: clamp(3.2rem, 5.5vw, 5rem);
}

body.text-xxlarge .hero p {
    font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

body.text-xxlarge .content-section h3 {
    font-size: clamp(2.5rem, 4.5vw, 4rem);
}

body.text-xxlarge .content-section p,
body.text-xxlarge .features-list li {
    font-size: 1.55rem;
}

body.text-xxlarge .accessibility-btn {
    font-size: 1.1rem;
}

body.text-xxlarge .main-footer p {
    font-size: 1.1rem;
}

/* Header */
.header-wrapper {
    width: 100%;
    background: linear-gradient(135deg, #0f3460 0%, #533483 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.main-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
}

.main-header h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    padding: 0.5rem 0;
    line-height: 1.2;
    letter-spacing: 0.02em;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    flex: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.hero h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #fff;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #b8b8d1;
    max-width: 800px;
    margin: 0 auto;
}

/* Content Sections */
.content-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.content-section h3 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: #fff;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.content-section p {
    font-size: 1.1rem;
    color: #b8b8d1;
    line-height: 1.8;
}

/* Features List */
.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    font-size: 1.1rem;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.features-list li:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(10px);
}

/* CTA Button */
.cta-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 1.5rem;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.cta-button:active {
    transform: translateY(-1px);
}

/* Footer */
.main-footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.main-footer p {
    color: #888;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .accessibility-toolbar {
        top: 10px;
        right: 10px;
        padding: 0.75rem;
        gap: 0.4rem;
    }

    .accessibility-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        min-width: 150px;
    }

    .btn-text {
        font-size: 0.85rem;
    }

    .main-header {
        padding: 2.5rem 1.5rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .hero {
        padding: 2.5rem 1.5rem;
    }

    .content-section {
        padding: 2rem 1.5rem;
    }

    .features-list li:hover {
        transform: translateX(5px);
    }
}

@media (max-width: 480px) {
    .accessibility-toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        top: 5px;
        right: 5px;
        left: 5px;
        padding: 0.5rem;
    }

    .accessibility-btn {
        flex: 1 1 45%;
        min-width: auto;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .btn-text {
        display: none;
    }

    .accessibility-btn span[aria-hidden="true"] {
        font-size: 1rem;
    }
}