.gistmag-tts-player {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.gistmag-tts-player-header {
    margin-bottom: 15px;
}

.gistmag-tts-player-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.gistmag-tts-icon {
    font-size: 20px;
}

.gistmag-tts-player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.gistmag-tts-play-btn {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    position: relative;
}

.gistmag-tts-play-btn:hover {
    background: #005a87;
}

.gistmag-tts-play-btn:active {
    transform: scale(0.95);
}

.gistmag-tts-play-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.gistmag-tts-play-icon,
.gistmag-tts-pause-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.gistmag-tts-play-icon svg,
.gistmag-tts-pause-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.gistmag-tts-progress-container {
    flex: 1;
    min-width: 200px;
}

.gistmag-tts-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-bottom: 5px;
}

.gistmag-tts-progress-fill {
    height: 100%;
    background: #0073aa;
    border-radius: 3px;
    transition: width 0.1s linear;
    width: 0%;
}

.gistmag-tts-time {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.gistmag-tts-status {
    font-size: 14px;
    color: #666;
    min-width: 100px;
}

.gistmag-tts-status-text {
    font-weight: 500;
}

.gistmag-tts-error {
    margin-top: 10px;
    padding: 10px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    font-size: 14px;
}

.gistmag-tts-settings-toggle {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 4px;
    position: relative;
    z-index: 10;
    outline: none;
}

.gistmag-tts-settings-toggle:hover {
    color: #0073aa;
    background: #f0f0f0;
}

.gistmag-tts-player-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gistmag-tts-settings-panel {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.gistmag-tts-setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gistmag-tts-setting-label {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gistmag-tts-speed-value {
    font-weight: 600;
    color: #0073aa;
    font-size: 16px;
}

.gistmag-tts-speed-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.gistmag-tts-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
    transition: background 0.2s;
}

.gistmag-tts-speed-slider::-webkit-slider-thumb:hover {
    background: #005a87;
}

.gistmag-tts-speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.gistmag-tts-speed-slider::-moz-range-thumb:hover {
    background: #005a87;
}

.gistmag-tts-speed-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .gistmag-tts-player {
        background: #1e1e1e;
        border-color: #444;
        color: #fff;
    }

    .gistmag-tts-player-title {
        color: #fff;
    }

    .gistmag-tts-progress-bar {
        background: #444;
    }

    .gistmag-tts-time {
        color: #aaa;
    }

    .gistmag-tts-status {
        color: #aaa;
    }

    .gistmag-tts-play-btn {
        background: #0073aa;
    }

    .gistmag-tts-play-btn:hover {
        background: #0085c3;
    }

    .gistmag-tts-play-btn:disabled {
        background: #555;
    }

    .gistmag-tts-error {
        background: #3a1f1f;
        border-color: #633;
        color: #f99;
    }

    .gistmag-tts-settings-toggle {
        color: #aaa;
    }

    .gistmag-tts-settings-toggle:hover {
        color: #0073aa;
        background: #333;
    }

    .gistmag-tts-settings-panel {
        background: #2a2a2a;
        border-color: #444;
    }

    .gistmag-tts-setting-label {
        color: #fff;
    }

    .gistmag-tts-speed-labels {
        color: #aaa;
    }

    .gistmag-tts-speed-slider {
        background: #444;
    }

    .gistmag-tts-speed-slider::-webkit-slider-thumb {
        background: #0073aa;
    }

    .gistmag-tts-speed-slider::-webkit-slider-thumb:hover {
        background: #0085c3;
    }

    .gistmag-tts-speed-slider::-moz-range-thumb {
        background: #0073aa;
    }

    .gistmag-tts-speed-slider::-moz-range-thumb:hover {
        background: #0085c3;
    }
}

/* Responsive design */
@media (max-width: 600px) {
    .gistmag-tts-player {
        padding: 15px;
    }

    .gistmag-tts-player-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .gistmag-tts-play-btn {
        align-self: center;
    }

    .gistmag-tts-progress-container {
        width: 100%;
    }
}

