 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-color: #4A90E2;
            --secondary-color: #7B68EE;
            --bg-color: #f5f7fa;
            --text-color: #2c3e50;
            --reader-bg: #ffffff;
            --border-color: #e1e8ed;
          
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
            color: var(--text-color);
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: var(--bg-color);
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.1);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 30px;
            text-align: center;
        }

        .header h1 {
            font-size: 2.5em;
            margin-bottom: 10px;
            font-weight: 700;
        }

        .header p {
            font-size: 1.1em;
            opacity: 0.95;
        }

        .main-content {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            padding: 30px;
        }

        .input-section, .reader-section {
            background: var(--reader-bg);
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        }

        .section-title {
            font-size: 1.3em;
            margin-bottom: 15px;
            color: var(--primary-color);
            font-weight: 600;
        }

        #textInput {
            width: 100%;
            height: 300px;
            padding: 15px;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            font-size: 16px;
            line-height: 1.6;
            resize: vertical;
            transition: border-color 0.3s ease;
        }

        #textInput:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .controls {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 20px;
            padding: 20px;
            background: var(--reader-bg);
            border-radius: 15px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        }

        .mode-btn {
            padding: 12px 24px;
            border: 2px solid var(--primary-color);
            background: white;
            color: var(--primary-color);
            border-radius: 25px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .mode-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
        }

        .mode-btn.active {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            border-color: transparent;
        }

        .mode-btn:before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.5);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        .mode-btn:active:before {
            width: 300px;
            height: 300px;
        }

        #readerContent {
            min-height: 350px;
            padding: 25px;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            font-size: 18px;
            line-height: 1.8;
            background: var(--reader-bg);
            transition: all 0.3s ease;
        }

        #readerContent.dyslexia-mode {
            font-family: 'OpenDyslexic','Arial', 'Verdana', sans-serif !important;
            font-size: 20px;
            line-height: 2.4;
            letter-spacing: 0.25em;
            word-spacing: 0.3em;
            background: #fef6e4;
            color: #2c3e50;
        }

        #readerContent p {
            margin-bottom: 1.2em;
        }

        .placeholder-text {
            color: #95a5a6;
            font-style: italic;
        }

        .action-buttons {
            margin-top: 15px;
            display: flex;
            gap: 10px;
        }

        .action-btn {
            padding: 10px 20px;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
        }

        .status-indicator {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #95a5a6;
            margin-right: 8px;
            animation: pulse 2s infinite;
        }

        .mode-btn.active .status-indicator {
            background: #2ecc71;
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
            }
            70% {
                box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
            }
        }

        @media (max-width: 768px) {
            .main-content {
                grid-template-columns: 1fr;
            }
            
            .header h1 {
                font-size: 1.8em;
            }
            
            .controls {
                justify-content: center;
            }
        }


        /* Audio Controls Styles */
        .audio-controls {
            display: none;
            flex-direction: column;
            gap: 15px;
            margin: 20px 30px;
            padding: 20px;
            background: var(--reader-bg);
            border-radius: 15px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
            animation: slideDown 0.3s ease;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .audio-controls-header {
            font-size: 1.1em;
            font-weight: 600;
            color: var(--primary-color);
            margin-bottom: 10px;
        }

        .playback-controls {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .audio-btn {
            padding: 10px 20px;
            background: linear-gradient(135deg, #4A90E2, #7B68EE);
            color: white;
            border: none;
            border-radius: 25px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .audio-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
        }

        .audio-btn:active {
            transform: translateY(0);
        }

        .audio-btn.stop {
            background: linear-gradient(135deg, #e74c3c, #c0392b);
        }

        .voice-select {
            width: 100%;
            padding: 10px;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            font-size: 14px;
            background: white;
            cursor: pointer;
            transition: border-color 0.3s ease;
        }

        .voice-select:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .parameter-controls {
            display: grid;
            gap: 15px;
        }

        .control-group {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .control-label {
            min-width: 80px;
            font-size: 14px;
            font-weight: 600;
            color: #555;
        }

        .control-slider {
            flex: 1;
             height: 6px;
            border-radius: 3px;
            background: #e1e8ed;
            outline: none;
            transition: background 0.3s;
        }

        .control-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            cursor: pointer;
            transition: transform 0.2s;
        }

        .control-slider::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }

        .control-slider::-moz-range-thumb {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            cursor: pointer;
        }

        .control-value {
            min-width: 50px;
            text-align: right;
            font-size: 14px;
            font-weight: 600;
            color: var(--primary-color);
        }


        /* High Contrast Mode */
body.high-contrast {
    background: #000000;
    --bg-color: #000000;
    --text-color: #ffffff;
    --reader-bg: #000000;
    --border-color: #ffffff;
    --primary-color: #ffff00;
    --secondary-color: #ffff00;
}

body.high-contrast .input-section,
body.high-contrast .reader-section,
body.high-contrast .audio-controls {
    border: 2px solid #ffffff;
}

body.high-contrast a:hover,
body.high-contrast button:hover {
    background: #ffff00;
    color: #000;
    outline: 2px solid #fff;
}



/* Large Text Mode */
body.large-text {
    font-size: 120%;
}

body.large-text #readerContent {
  font-size: 1.5rem !important;  /* scales better */
    line-height: 2 !important;
}

body.large-text .section-title {
    font-size: 1.8em !important;
}

body.large-text .mode-btn {
    font-size: 18px !important;
    padding: 15px 30px !important;
}


/* Colorblind Mode */
body.colorblind-mode {
    --primary-color: #0072B2;   /* Blue */
    --secondary-color: #E69F00; /* Orange */
    --bg-color: #f9f9f9;
    --text-color: #000000;
    --reader-bg: #ffffff;
    --border-color: #999999;
}

/* Focus Mode Enhancement */
#readerContent.focus-mode {
    position: relative;
    overflow: hidden;
}


#readerContent.focus-mode::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.8) 0%,
        transparent 35%,
        transparent 65%,
        rgba(0,0,0,0.8) 100%
    );
    pointer-events: none;
    z-index: 1;
}

#readerContent.focus-mode p {
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 2;
}


/* Theme Controls Section */
.theme-controls {
    margin: 20px 30px;
    padding: 20px;
    background: var(--reader-bg);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 2px solid var(--border-color);
}

.theme-controls h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}


.theme-btn {
    padding: 10px 15px;
    border: 2px solid var(--primary-color);
    background: var(--reader-bg);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.theme-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(74, 144, 226, 0.3);
}

.theme-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Make existing elements work with new themes */
body.high-contrast {
    background: #000000;
    --bg-color: #000000;
    --text-color: #ffffff;
    --reader-bg: #000000;
    --border-color: #ffffff;
    --primary-color: #ffffff;
    --secondary-color: #ffffff;
}

body.high-contrast .header h1{
    color: #000000;
}

body.high-contrast .header p{
    color: #000000;
}

body.high-contrast .input-section,
body.high-contrast .reader-section,
body.high-contrast .audio-controls,
body.high-contrast .theme-controls,
body.high-contrast .controls {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
}


body.high-contrast .mode-btn,
body.high-contrast .theme-btn,
body.high-contrast .action-btn {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}



body.high-contrast .mode-btn.active,
body.high-contrast .theme-btn.active {
    background: #ffffff !important;
    color: #000000 !important;
}

body.high-contrast #textInput,
body.high-contrast .voice-select {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

body.high-contrast #readerContent {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

body.high-contrast .control-label {
    color: var(--text-color);
}
    





.notification {
            position: fixed;
            top: 20px;
            right: 20px;
            background: #4A90E2;
            color: white;
            padding: 15px 20px;
            border-radius: 10px;
            z-index: 1000;
            animation: slideIn 0.3s ease;
        }

        
        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @media (max-width: 768px) {
            .main-content {
                grid-template-columns: 1fr;
            }
            .controls {
                grid-template-columns: 1fr;
            }
        }