:root {
    --primary: #5e35b1;
    --secondary: #3949ab;
    --accent: #7e57c2;
    --dark: #1a237e;
    --light: #f5f7ff;
    --success: #43a047;
    --warning: #ffb300;
    --danger: #e53935;
    --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --card-bg: rgba(255, 255, 255, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #e0e7ff 0%, #d1c4e9 100%);
    color: #2c3e50;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0;
    position: relative;
    margin-bottom: 20px;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.logo i {
    color: white;
    font-size: 2.5rem;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: -1px;
}

header p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto;
    color: #4a5568;
    line-height: 1.6;
}

.simulator-container {
    display: flex;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.controls {
    flex: 1;
    min-width: 320px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.preview {
    flex: 2;
    min-width: 320px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.section-title {
    font-size: 1.6rem;
    margin-bottom: 25px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e7ff;
}

.section-title i {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.control-group {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #edf2f7;
}

.control-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: var(--transition);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

input:checked + .slider:before {
    transform: translateX(30px);
}

select, .slider-range {
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid #cbd5e0;
    background: white;
    font-size: 1.05rem;
    margin-top: 10px;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

select:focus, .slider-range:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 53, 177, 0.2);
}

.slider-container {
    margin: 20px 0;
}

.slider-range {
    -webkit-appearance: none;
    height: 10px;
    border-radius: 5px;
    background: #e2e8f0;
}

.slider-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 2px solid white;
}

.slider-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.preview-content {
    line-height: 1.8;
    font-size: 1.15rem;
    transition: var(--transition);
}

.preview-content p {
    margin-bottom: 20px;
}

/* Dyslexia effect - Enhanced */
.dyslexia-mode .preview-content {
    font-family: 'Comic Sans MS', cursive;
    letter-spacing: 1.5px;
    line-height: 2.1;
}

.dyslexia-mode .preview-content p {
    position: relative;
}

.dyslexia-mode .preview-content span {
    display: inline-block;
    transform: rotate(calc(var(--rotation) * 1deg));
    margin: 0 -1px;
}

/* Color blindness filters */
.protanopia { filter: url(#protanopia); }
.deuteranopia { filter: url(#deuteranopia); }
.tritanopia { filter: url(#tritanopia); }
.achromatopsia { filter: url(#achromatopsia); }

/* Motor impairment effect */
.motor-impairment {
    cursor: none;
}

.tremor-cursor {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(229, 57, 53, 0.8);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.05s linear;
    box-shadow: 0 0 10px rgba(229, 57, 53, 0.5);
}

/* Info button */
.info-btn {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.info-btn:hover {
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 10px 25px rgba(94, 53, 177, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    padding: 30px;
    position: relative;
    animation: modalIn 0.4s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
}

@keyframes modalIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #718096;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.about-section {
    margin-bottom: 25px;
}

.about-section h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.about-section h3 i {
    font-size: 1.3rem;
}

.about-section p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #4a5568;
}

.personal-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.info-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.info-links a:hover {
    color: var(--primary);
    text-decoration: underline;
    transform: translateX(5px);
}

.voice-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.voice-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px;
    background: white;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-weight: 500;
}

.voice-btn:hover {
    border-color: var(--primary);
    background: #f0f4ff;
}

.voice-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(94, 53, 177, 0.3);
}

.color-palette {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.color-box {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.color-box:nth-child(1) { background: #FF5252; }
.color-box:nth-child(2) { background: #4CAF50; }
.color-box:nth-child(3) { background: #2196F3; }
.color-box:nth-child(4) { background: #FF9800; }
.color-box:nth-child(5) { background: #9C27B0; }
.color-box:nth-child(6) { background: #00BCD4; }

.preview-examples {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.example-card {
    padding: 20px;
    border-radius: 12px;
    background: #f0f4ff;
    transition: var(--transition);
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.example-card h4 {
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(94, 53, 177, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(94, 53, 177, 0.4);
}

.btn:active {
    transform: translateY(1px);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #718096;
    font-size: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 900px) {
    .simulator-container {
        flex-direction: column;
    }

    header h1 {
        font-size: 2.8rem;
    }

    .preview-examples {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .controls, .preview {
        padding: 20px;
    }

    header h1 {
        font-size: 2.3rem;
    }

    header p {
        font-size: 1.1rem;
    }
}
