/**
 * Screen Reader Widget Styles
 */

.tt-screen-reader-container {
    width: 100%;
    margin: 20px 0;
}

/* Card design */
.tt-screen-reader-card {
    position: relative;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    transition: box-shadow 0.3s ease;
}

.tt-screen-reader-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tt-screen-reader-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #eeeeee;
}

.tt-screen-reader-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

/* SVG icons styling */
.tt-svg-icon {
    fill: currentColor;
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
}

.tt-screen-reader-buttons .tt-svg-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.tt-screen-reader-close .tt-svg-icon {
    width: 14px;
    height: 14px;
}

/* Settings button */
.tt-screen-reader-settings-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #eeeeee;
    color: #555555;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tt-screen-reader-settings-button:hover {
    background-color: #e0e0e0;
    color: #333333;
}

.tt-screen-reader-settings-button .tt-svg-icon {
    font-size: 14px;
}

/* Main controls section */
.tt-screen-reader-controls-main {
    padding: 15px 20px;
}

/* Player control buttons */
.tt-screen-reader-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0 0 15px;
}

.tt-screen-reader-buttons button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    color: white;
}

.tt-screen-reader-buttons button:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.05);
}

.tt-screen-reader-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tt-screen-reader-buttons .tt-sr-play {
    background: #4CAF50;
}

.tt-screen-reader-buttons .tt-sr-pause {
    background: #2196F3;
}

.tt-screen-reader-buttons .tt-sr-stop {
    background: #F44336;
}

.tt-screen-reader-buttons i {
    font-size: 18px;
}

/* Progress bar */
.tt-screen-reader-progress {
    margin-bottom: 10px;
}

.tt-sr-progress-bar {
    height: 8px;
    background: #eeeeee;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.tt-sr-progress-value {
    height: 100%;
    background: #4054b2;
    width: 0;
    transition: width 0.3s linear;
}

/* Popover styles - now only for settings */
.tt-screen-reader-popover {
    position: fixed;
    display: none;
    width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    overflow: visible;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Popover positions */
.tt-popover-bottom-right {
    top: calc(100% + 10px);
    right: 20px;
}

.tt-popover-bottom-left {
    top: calc(100% + 10px);
    left: 20px;
}

.tt-popover-top-right {
    bottom: calc(100% + 10px);
    right: 20px;
}

.tt-popover-top-left {
    bottom: calc(100% + 10px);
    left: 20px;
}

/* Popover header */
.tt-screen-reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
}

.tt-screen-reader-title {
    font-weight: bold;
    font-size: 14px;
}

.tt-screen-reader-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #777;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tt-screen-reader-close:hover {
    background: #eee;
    color: #333;
}

/* Popover controls */
.tt-screen-reader-controls {
    padding: 15px;
}

.tt-screen-reader-control {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tt-screen-reader-control:last-child {
    margin-bottom: 0;
}

.tt-screen-reader-control label {
    font-size: 13px;
    min-width: 50px;
}

.tt-screen-reader-control input[type="range"] {
    flex: 1;
    min-width: 120px;
}

.tt-screen-reader-control span {
    font-size: 13px;
    min-width: 30px;
    text-align: center;
}

.tt-speech-voice-selector {
    flex: 1;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 13px;
}

/* Highlight for current sentence */
.tt-highlight-sentence {
    background-color: #ffeb3b;
    border-radius: 4px;
    padding: 2px 0;
    display: inline-block;
    width: 100%;
}

/* Remove old word highlighting class if not needed */
.tt-highlight-word {
    display: none;
}

/* Responsive design */
@media (max-width: 480px) {
    .tt-screen-reader-card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .tt-screen-reader-settings-button {
        align-self: flex-end;
    }
    
    .tt-screen-reader-popover {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
    
    .tt-screen-reader-buttons button {
        width: 46px;
        height: 46px;
    }
}