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

.tts-layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.control-bar {
    background: white;
    padding: 16px 0 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 16px 24px;
}

.keyboard-shortcuts-info {
    margin-bottom: 20px;
    position: relative;
}

.shortcuts-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.shortcuts-toggle:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.shortcuts-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 300px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.shortcut-item:last-child {
    border-bottom: none;
}

kbd {
    display: inline-block;
    padding: 4px 8px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 32px;
    text-align: center;
}

.shortcut-item span {
    flex: 1;
    font-size: 14px;
    color: #6b7280;
}

/* History */
.history-info {
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    margin-left: 12px;
}

.history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-toggle:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.history-badge {
    background: #3b82f6;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.history-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 400px;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.2s ease;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.history-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.btn-clear-history {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.btn-clear-history:hover {
    background: #fef2f2;
}

.history-list {
    overflow-y: auto;
    max-height: 400px;
    padding: 8px;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.history-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
    cursor: pointer;
}

.history-item:hover {
    background: #f9fafb;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.history-date {
    font-size: 12px;
    color: #9ca3af;
}

.history-delete {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.history-delete:hover {
    background: #fef2f2;
    color: #ef4444;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.history-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.history-empty p {
    font-size: 14px;
    margin: 0;
}

/* Örnek Cümleler Bölümü */
.example-sentences {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px dashed #e5e7eb;
}

.example-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.example-header svg {
    color: #3b82f6;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.example-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.example-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.example-btn:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
    color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.example-btn:active::before {
    width: 300px;
    height: 300px;
}

.example-btn span {
    position: relative;
    z-index: 1;
}

.textarea-input {
    width: 100%;
    min-height: 400px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 16px;
    line-height: 1.8;
    color: #111827;
    resize: none;
    font-family: inherit;
    transition: transform 0.2s ease;
}

.left-actions { display: flex; align-items: center; gap: 8px; }
.center-controls { display: flex; align-items: center; gap: 12px; justify-content: center; }
.right-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

.btn-control {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-control:hover:not(:disabled) {
    background: #f3f4f6;
    color: #111827;
}

.btn-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-control::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-control:active:not(:disabled)::before {
    width: 80px;
    height: 80px;
}

.btn-play {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 14px rgba(37, 99, 235, 0.4);
}

.btn-play:hover:not(:disabled) {
    color: white;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: scale(1.05);
    box-shadow: 0 2px 20px rgba(37, 99, 235, 0.5);
}

.btn-play::before {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.speed-btn {
    background: transparent !important;
}

.speed-display {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    min-width: 45px;
    text-align: center;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #111827;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-icon:active::before {
    width: 80px;
    height: 80px;
}

.btn-more-mobile {
    display: none;
    position: relative;
}

.mobile-more-menu {
    position: absolute; /* fixed değil, absolute */
    top: calc(100% + 8px); /* Butonun hemen altı */
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 220px;
    overflow: hidden;
    display: none;
}

.more-menu-content {
    padding: 8px 0;
}

.more-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.more-menu-item:hover {
    background: #f3f4f6;
}

.more-menu-item svg {
    flex-shrink: 0;
}

/* PROGRESS BAR */
.progress-wrapper {
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
    overflow: visible;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
}

.progress-wrapper.playing {
    background: transparent;
    z-index: 9999;
}

.progress-wrapper::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 3px;
    background: #e5e7eb;
    z-index: 1;
}

.progress-wrapper.playing::before {
    background: linear-gradient(to right, #dbeafe 0%, #bfdbfe 100%);
}

.progress-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transition: width 0.1s linear;
    z-index: 2;
    pointer-events: none;
}

.progress-bar-container {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
}

.progress-input {
    width: 100%;
    height: 16px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border-radius: 0;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 4;
    margin: 0;
}

.progress-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #2563eb;
    border: 3px solid #2563eb;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    margin-top: -6.5px;
}

.progress-input::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.15);
}

.progress-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #2563eb;
    border: 3px solid #2563eb;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    transition: all 0.2s;
    margin-top: 0;
}

.progress-input::-moz-range-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.15);
}

.progress-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    background: transparent;
    border-radius: 0;
}

.progress-input::-moz-range-track {
    width: 100%;
    height: 3px;
    background: transparent;
    border-radius: 0;
}

.progress-input::-moz-range-progress {
    height: 3px;
    background: transparent;
    border-radius: 0;
}

.time-labels {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    background: white;
    position: relative;
    z-index: 1;
}

.time-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
    width: 100%;
}

.text-box {
    background: white;
    border-radius: 12px;
    padding: 32px;
    min-height: 500px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 10px 40px rgba(0,0,0,0.05);
    position: relative;
    border: 1px solid #f3f4f6;
}

.text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.char-count {
    font-size: 13px;
    color: #9ca3af;
}

.btn-clear {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #f3f4f6;
    color: #111827;
}

.textarea-input::placeholder {
    color: #d1d5db;
}

.reading-text {
    font-size: 16px;
    line-height: 1.8;
    color: #111827;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 4px;
}

.reading-text::-webkit-scrollbar {
    width: 6px;
}

.reading-text::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.reading-text::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.reading-text::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.word {
    display: inline;
    transition: all 0.2s;
}

.word.active {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 0 2px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    animation: wordPulse 0.3s ease;
    transform: translateY(-2px);
}

@keyframes wordPulse {
    0%, 100% { transform: translateY(-2px) scale(1); }
    50% { transform: translateY(-2px) scale(1.05); }
}

.highlight-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 -4px 20px rgba(16, 185, 129, 0.3);
    z-index: 999;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.highlight-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.highlight-word {
    font-size: 20px;
    font-weight: 600;
    color: white;
    flex: 1;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-close-highlight {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 24px;
    transition: all 0.2s;
}

.btn-close-highlight:hover {
    background: rgba(255, 255, 255, 0.3);
}

.speed-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.speed-modal.active {
    display: flex;
}

.speed-modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.speed-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.speed-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: #f3f4f6;
    color: #111827;
}

.speed-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.speed-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.speed-option.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.speed-option-label {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.speed-option-value {
    font-size: 14px;
    color: #6b7280;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
}

.setting-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
}

.setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.setting-value {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    margin-top: 8px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
    animation: alertSlideDown 0.3s ease;
}

@keyframes alertSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* MOBILE STYLES - İYİLEŞTİRİLMİŞ */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .control-bar {
        padding: 12px 0 0 0;
    }

    .control-grid {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 0 16px 12px 16px;
    }

    /* Mobilde left-actions'ı göster (shortcuts ve history için) */
    .left-actions {
        display: flex !important;
        gap: 4px;
        flex: 0 0 auto;
    }

    /* Right actions'ı gizle ama more butonunu göster */
    .right-actions {
        position: relative;
    }

    .right-actions > *:not(.btn-more-mobile) {
        display: none;
    }

    /* Center controls'ü ortala */
    .center-controls {
        flex: 1;
        justify-content: center;
    }

    .btn-more-mobile {
        display: flex !important;
        position: relative;
    }

    .mobile-more-menu {
        position: absolute; /* fixed değil, absolute */
        top: calc(100% + 8px); /* Butonun hemen altı */
        right: 0;
        margin-top: 8px;
        min-width: 240px;
        max-width: calc(100vw - 32px);
    }

    .more-menu-item {
        padding: 16px 20px;
        font-size: 16px;
    }

    .btn-control {
        width: 48px;
        height: 48px;
    }

    .btn-play {
        width: 64px;
        height: 64px;
    }

    /* Progress bar mobil iyileştirme */
    .progress-wrapper {
        height: 20px;
        bottom: -10px;
    }

    .progress-wrapper::before,
    .progress-wrapper::after {
        height: 4px;
    }

    .progress-input {
        height: 20px;
    }

    .progress-input::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
        margin-top: -8px;
    }

    .progress-input::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }

    .progress-input::-webkit-slider-runnable-track {
        height: 4px;
    }

    .progress-input::-moz-range-track {
        height: 4px;
    }

    .time-labels {
        padding: 8px 16px;
    }

    /* Klavye kısayolları mobil - daha iyi konumlandırma */
    .keyboard-shortcuts-info {
        margin-bottom: 0;
    }

    .shortcuts-toggle {
        padding: 8px 10px;
        font-size: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .shortcuts-toggle span {
        display: none;
    }

    .shortcuts-toggle svg {
        margin: 0;
    }

    .shortcuts-panel {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        margin-top: 0;
        width: calc(100vw - 32px);
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 2000;
    }

    .shortcuts-panel::-webkit-scrollbar {
        width: 6px;
    }

    .shortcuts-panel::-webkit-scrollbar-track {
        background: #f3f4f6;
    }

    .shortcuts-panel::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 3px;
    }

    /* Geçmiş buton mobil */
    .history-info {
        margin-left: 0;
        margin-bottom: 0;
    }

    .history-toggle {
        padding: 8px 10px;
        font-size: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
        position: relative;
    }

    .history-toggle span:not(.history-badge) {
        display: none;
    }

    .history-toggle svg {
        margin: 0;
    }

    .history-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        font-size: 10px;
        padding: 2px 5px;
        min-width: 18px;
    }

    /* Geçmiş paneli mobil iyileştirme - ÖNEMLİ */
    .history-panel {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        margin-top: 0;
        width: calc(100vw - 32px);
        max-width: 450px;
        max-height: 75vh;
        z-index: 2000;
    }

    .history-list {
        max-height: calc(75vh - 80px);
    }

    .history-text {
        font-size: 15px;
        -webkit-line-clamp: 3;
    }

    /* Mobil menü pozisyonu */
    .mobile-more-menu {
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 8px;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        min-width: 220px;
        overflow: hidden;
        display: none;
    }

    .more-menu-item {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border: none;
        background: transparent;
        color: #374151;
        font-size: 15px;
        cursor: pointer;
        transition: all 0.2s;
        text-align: left;
    }

    .more-menu-item:hover {
        background: #f3f4f6;
    }

    .more-menu-item svg {
        flex-shrink: 0;
    }

    .more-menu-item span:first-of-type {
        flex: 1;
    }

    .more-menu-value {
        font-size: 13px;
        font-weight: 600;
        color: #3b82f6;
        padding: 2px 8px;
        background: #eff6ff;
        border-radius: 6px;
    }

    .desktop-only {
        display: flex;
    }

    /* Ana içerik mobil */
    .main-content {
        padding: 24px 16px 80px 16px;
    }

    .text-box {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .text-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .char-count {
        font-size: 12px;
    }

    .btn-clear {
        font-size: 13px;
        padding: 6px 10px;
    }

    .textarea-input {
        font-size: 16px;
        min-height: 300px;
    }

    .reading-text {
        font-size: 16px;
        min-height: 300px;
        max-height: 400px;
    }

    /* Örnek cümleler mobil */
    .example-sentences {
        margin-top: 20px;
        padding-top: 20px;
    }

    .example-header {
        font-size: 13px;
    }

    .example-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .example-btn {
        width: 100%;
        text-align: left;
        padding: 12px 16px;
        font-size: 15px;
    }

    /* Vurgulama çubuğu mobil */
    .highlight-bar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .highlight-content {
        padding: 20px 16px;
    }

    .highlight-word {
        font-size: 18px;
        padding: 0 12px;
    }

    /* Modal mobil */
    .speed-modal-content {
        width: calc(100vw - 32px);
        max-width: 380px;
        padding: 24px 20px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .speed-modal-title {
        font-size: 17px;
    }

    .speed-option {
        padding: 14px 16px;
    }

    .speed-option-label {
        font-size: 15px;
    }

    .speed-option-value {
        font-size: 13px;
    }

    /* Bildirim/Alert mobil */
    .alert {
        font-size: 14px;
        padding: 10px 14px;
    }
}

/* Küçük mobil cihazlar için ekstra optimizasyon */
@media (max-width: 375px) {
    .control-grid {
        gap: 6px;
        padding: 0 12px 10px 12px;
    }

    .btn-control {
        width: 44px;
        height: 44px;
    }

    .btn-play {
        width: 58px;
        height: 58px;
    }

    .speed-display {
        font-size: 14px;
        min-width: 40px;
    }

    .text-box {
        padding: 16px 12px;
    }

    .example-btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .history-panel,
    .shortcuts-panel {
        width: calc(100vw - 24px);
        max-width: none;
    }
}

/* Tablet için özel stiller */
@media (min-width: 769px) and (max-width: 1024px) {
    .control-grid {
        max-width: 100%;
        padding: 0 32px 16px 32px;
    }

    .main-content {
        max-width: 100%;
        padding: 32px;
    }

    .text-box {
        padding: 28px;
    }

    .history-panel {
        width: 450px;
    }
}

/* DESKTOP ONLY */
@media (min-width: 769px) {
    .btn-more-mobile {
        display: none !important;
    }
}

/* Yatay mod (landscape) mobil */
@media (max-width: 768px) and (orientation: landscape) {
    .history-panel {
        max-height: 80vh;
    }

    .history-list {
        max-height: calc(80vh - 80px);
    }

    .speed-modal-content {
        max-height: 85vh;
    }

    .text-box {
        min-height: 300px;
    }

    .textarea-input,
    .reading-text {
        min-height: 250px;
        max-height: 350px;
    }
}

/* Touch cihazlar için hover efektlerini devre dışı bırak */
@media (hover: none) {
    .btn-control:hover:not(:disabled),
    .btn-icon:hover,
    .btn-clear:hover,
    .example-btn:hover,
    .speed-option:hover,
    .history-item:hover {
        transform: none;
    }
}

/* ============================================
DARK MODE SUPPORT
============================================ */

[data-bs-theme="dark"] .tts-layout {
    background: #1e1e2d;
}

[data-bs-theme="dark"] .control-bar {
    background: #1e1e2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid #2b2b40;
}

[data-bs-theme="dark"] .btn-control {
    color: #92929f;
}

[data-bs-theme="dark"] .btn-control:hover:not(:disabled) {
    background: #2b2b40;
    color: #f5f5f5;
}

[data-bs-theme="dark"] .btn-icon {
    color: #92929f;
}

[data-bs-theme="dark"] .btn-icon:hover {
    background: #2b2b40;
    color: #f5f5f5;
}

[data-bs-theme="dark"] .speed-display {
    color: #f5f5f5;
}

[data-bs-theme="dark"] .time-label {
    color: #92929f;
}

[data-bs-theme="dark"] .time-labels {
    background: #1e1e2d;
}

[data-bs-theme="dark"] .progress-wrapper::before {
    background: #2b2b40;
}

[data-bs-theme="dark"] .progress-wrapper.playing::before {
    background: linear-gradient(to right, #1e3a5f 0%, #2a5a8f 100%);
}

[data-bs-theme="dark"] .text-box {
    background: #1e1e2d;
    border-color: #2b2b40;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 10px 40px rgba(0,0,0,0.2);
}

[data-bs-theme="dark"] .text-header {
    border-bottom-color: #2b2b40;
}

[data-bs-theme="dark"] .char-count {
    color: #92929f;
}

[data-bs-theme="dark"] .btn-clear {
    color: #92929f;
}

[data-bs-theme="dark"] .btn-clear:hover {
    background: #2b2b40;
    color: #f5f5f5;
}

[data-bs-theme="dark"] .textarea-input {
    color: #f5f5f5;
    background: transparent;
}

[data-bs-theme="dark"] .textarea-input::placeholder {
    color: #565674;
}

[data-bs-theme="dark"] .reading-text {
    color: #f5f5f5;
}

[data-bs-theme="dark"] .reading-text::-webkit-scrollbar-track {
    background: #2b2b40;
}

[data-bs-theme="dark"] .reading-text::-webkit-scrollbar-thumb {
    background: #565674;
}

[data-bs-theme="dark"] .reading-text::-webkit-scrollbar-thumb:hover {
    background: #92929f;
}

[data-bs-theme="dark"] .example-sentences {
    border-top-color: #2b2b40;
}

[data-bs-theme="dark"] .example-header {
    color: #92929f;
}

[data-bs-theme="dark"] .example-btn {
    background: linear-gradient(135deg, #2b2b40 0%, #373751 100%);
    border-color: #565674;
    color: #f5f5f5;
}

[data-bs-theme="dark"] .example-btn:hover {
    background: linear-gradient(135deg, #1e3a5f 0%, #2a5a8f 100%);
    border-color: #3b82f6;
    color: #bfdbfe;
}

[data-bs-theme="dark"] .speed-modal {
    background: rgba(0, 0, 0, 0.7);
}

[data-bs-theme="dark"] .speed-modal-content {
    background: #1e1e2d;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .speed-modal-title {
    color: #f5f5f5;
}

[data-bs-theme="dark"] .btn-close-modal {
    color: #92929f;
}

[data-bs-theme="dark"] .btn-close-modal:hover {
    background: #2b2b40;
    color: #f5f5f5;
}

[data-bs-theme="dark"] .speed-option {
    border-color: #2b2b40;
    background: transparent;
}

[data-bs-theme="dark"] .speed-option:hover {
    border-color: #565674;
    background: #2b2b40;
}

[data-bs-theme="dark"] .speed-option.active {
    border-color: #3b82f6;
    background: #1e3a5f;
}

[data-bs-theme="dark"] .speed-option-label {
    color: #f5f5f5;
}

[data-bs-theme="dark"] .speed-option-value {
    color: #92929f;
}

[data-bs-theme="dark"] .setting-label {
    color: #f5f5f5;
}

[data-bs-theme="dark"] .setting-range {
    background: #2b2b40;
}

[data-bs-theme="dark"] .alert-danger {
    background: #3d1a1a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

[data-bs-theme="dark"] .alert-success {
    background: #1a3d2e;
    color: #86efac;
    border-color: #14532d;
}

[data-bs-theme="dark"] .alert-warning {
    background: #3d2e1a;
    color: #fcd34d;
    border-color: #78350f;
}

[data-bs-theme="dark"] .shortcuts-toggle {
    background: #1e1e2d;
    border-color: #2b2b40;
    color: #92929f;
}

[data-bs-theme="dark"] .shortcuts-toggle:hover {
    background: #2b2b40;
    border-color: #565674;
    color: #f5f5f5;
}

[data-bs-theme="dark"] .shortcuts-panel {
    background: #1e1e2d;
    border-color: #2b2b40;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .shortcut-item {
    border-bottom-color: #2b2b40;
}

[data-bs-theme="dark"] kbd {
    background: linear-gradient(135deg, #2b2b40 0%, #373751 100%);
    border-color: #565674;
    color: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .shortcut-item span {
    color: #92929f;
}

[data-bs-theme="dark"] .history-toggle {
    background: #1e1e2d;
    border-color: #2b2b40;
    color: #92929f;
}

[data-bs-theme="dark"] .history-toggle:hover {
    background: #2b2b40;
    border-color: #565674;
    color: #f5f5f5;
}

[data-bs-theme="dark"] .history-panel {
    background: #1e1e2d;
    border-color: #2b2b40;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .history-header {
    border-bottom-color: #2b2b40;
}

[data-bs-theme="dark"] .history-header h3 {
    color: #f5f5f5;
}

[data-bs-theme="dark"] .btn-clear-history:hover {
    background: #3d1a1a;
}

[data-bs-theme="dark"] .history-list::-webkit-scrollbar-track {
    background: #2b2b40;
}

[data-bs-theme="dark"] .history-list::-webkit-scrollbar-thumb {
    background: #565674;
}

[data-bs-theme="dark"] .history-item:hover {
    background: #2b2b40;
}

[data-bs-theme="dark"] .history-text {
    color: #f5f5f5;
}

[data-bs-theme="dark"] .history-date {
    color: #92929f;
}

[data-bs-theme="dark"] .history-delete {
    color: #92929f;
}

[data-bs-theme="dark"] .history-delete:hover {
    background: #3d1a1a;
    color: #ef4444;
}

[data-bs-theme="dark"] .history-empty {
    color: #92929f;
}

[data-bs-theme="dark"] .mobile-more-menu {
    background: #1e1e2d;
    border: 1px solid #2b2b40;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .more-menu-item {
    color: #f5f5f5;
}

[data-bs-theme="dark"] .more-menu-item:hover {
    background: #2b2b40;
}
