/* Visualization Tab Styles */

/* File container */
.file {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #fafafa;
    transition: box-shadow 0.2s ease;
}

.file:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Control bar for each file */
.controlBar {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 7px 7px 0 0;
    padding: 0.75rem 1rem;
}

.controlBar .fw-bold {
    color: #495057;
    font-size: 0.95rem;
}

.controlBar .text-muted {
    font-size: 0.85rem;
}

.playFileBtn {
    border-radius: 20px;
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.playFileBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* File text container */
.fileText {
    background-color: #ffffff;
    border-radius: 0 0 7px 7px;
    padding: 1rem;
    min-height: 60px;
    line-height: 1.8;
}

/* Individual word styling */
.word {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    border-bottom: 1px solid #2196f3;
}

.word:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
    z-index: 10;
}

.word:active {
    transform: translateY(0);
    background-color: #1976d2;
    color: white;
    border-color: #1976d2;
}

/* Different file color schemes */
/* .word.file0 { border-bottom: 1px solid #2196f3; }
.word.file1 { border-bottom: 1px solid #4caf50; }
.word.file2 { border-bottom: 1px solid #ff9800; }
.word.file3 { border-bottom: 1px solid #9c27b0; }
.word.file4 { border-bottom: 1px solid #f44336; }
.word.file5 { border-bottom: 1px solid #00bcd4; }
.word.file6 { border-bottom: 1px solid #795548; }
.word.file7 { border-bottom: 1px solid #607d8b; }
.word.file8 { border-bottom: 1px solid #e91e63; }
.word.file9 { border-bottom: 1px solid #cddc39; } */

/* Cycle through colors for files beyond 10 */
/* .word.file10, .word.file20, .word.file30 { border-bottom: 1px solid #2196f3; }
.word.file11, .word.file21, .word.file31 { border-bottom: 1px solid #4caf50; }
.word.file12, .word.file22, .word.file32 { border-bottom: 1px solid #ff9800; }
.word.file13, .word.file23, .word.file33 { border-bottom: 1px solid #9c27b0; }
.word.file14, .word.file24, .word.file34 { border-bottom: 1px solid #f44336; }
.word.file15, .word.file25, .word.file35 { border-bottom: 1px solid #00bcd4; }
.word.file16, .word.file26, .word.file36 { border-bottom: 1px solid #795548; }
.word.file17, .word.file27, .word.file37 { border-bottom: 1px solid #607d8b; }
.word.file18, .word.file28, .word.file38 { border-bottom: 1px solid #e91e63; }
.word.file19, .word.file29, .word.file39 { border-bottom: 1px solid #cddc39; } */

/* Playing state for words and files */
.word.playing {
    background-color: #1976d2 !important;
    color: white !important;
    border-color: #1976d2 !important;
    animation: pulse 1s infinite;
}

/* Active state for currently playing word (real-time highlighting) */
.word.active {
    background-color: #ff9800 !important;
    color: white !important;
    border-color: #ff9800 !important;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    transform: translateY(-2px);
    z-index: 20;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.file.playing .controlBar {
    background: linear-gradient(90deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #1976d2;
}

.file.playing .playFileBtn {
    background-color: #1976d2;
    border-color: #1976d2;
}

/* Audio notification styles */
.audio-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Summary card enhancements */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-body h6 {
    color: #495057;
    margin-bottom: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .controlBar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    .controlBar .ms-auto {
        margin-left: 0 !important;
        align-self: flex-end;
    }
    
    .word {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
        margin: 0.05rem;
    }
    
    .fileText {
        padding: 0.75rem;
    }
}

/* Loading state */
.visualization-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.visualization-loading .spinner-border {
    margin-bottom: 1rem;
}

/* Error state */
.visualization-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

/* Empty state styling */
#visualization-empty-state {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
}

#visualization-empty-state .bi {
    color: #adb5bd;
}

/* Accessibility improvements */
.word:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.playFileBtn:focus {
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Visualization options styles */
.visualization-options {
    border: 1px solid #dee2e6;
}

/* Pause visibility control */
.hide-pauses .pause {
    display: none !important;
}

/* Pause threshold styling */
.pause-below-min {
    display: none !important;
}

.pause-above-max {
    opacity: 0.8;
    background-color: #fd79a8 !important;
    border: 2px solid #e84393;
}

/* Enhanced pause styling */
.pause {
    background-color: #d5e8ff;
    display: inline-block;
    margin: 0 1px;
    transition: opacity 0.2s ease;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin: 0.05rem;
}

/* Pause Display Mode Styles */
/* No pause label mode - keep default styling, override pause type classes */
.pause-display-none .pause {
    display: inline-block;
    /* Override pause type class styling */
    background-color: #d5e8ff !important;
    border-color: transparent !important;
}

/* Type display mode - uses existing pause type classes */
.pause-display-type .pause {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    color: #000;
    text-align: center;
    line-height: 16px;
    min-width: 25px;
    border: solid 1px #000;
}

/* Ensure text is visible on different pause type backgrounds */
.pause-display-type .BC {
    color: #000; /* Black text on green background */
}

.pause-display-type .BP {
    color: #000; /* Black text on light blue background */
}

.pause-display-type .WP {
    color: #fff; /* White text on red background */
}

/* Syntactic distance display mode */
.pause-display-syntactic .pause {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    text-align: center;
    line-height: 16px;
    min-width: 20px;
    border: solid 1px #000;
}

/* Syntactic distance color classes */
.pause-syntactic-distance-0 {
    background-color: #ff0000 !important;
}

.pause-syntactic-distance-1 {
    background-color: #ff6666 !important;
}

.pause-syntactic-distance-2 {
    background-color: #ffcccc !important;
}

.pause-syntactic-distance-3 {
    background-color: #cceed7 !important;
}

.pause-syntactic-distance-4 {
    background-color: #66cc85 !important;
}

.pause-syntactic-distance-5,
.pause-syntactic-distance-6,
.pause-syntactic-distance-7,
.pause-syntactic-distance-8,
.pause-syntactic-distance-9,
.pause-syntactic-distance-10,
.pause-syntactic-distance-high {
    background-color: #00a933 !important;
}

/* Ensure pause text is visible and properly positioned */
.pause {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    min-height: 18px;
    box-sizing: border-box;
}

/* Improve text vertical alignment for different display modes */
.pause-display-type .pause,
.pause-display-syntactic .pause {
    line-height: 1;
    padding: 2px 4px;
}

/* Part-of-speech styling */
.pos {
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
    text-align: center;
    text-transform: lowercase;
}

/* Word container positioning */
.word {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    vertical-align: top;
}

.word-text {
    text-align: center;
    margin-top: auto; /* Push word text to bottom for consistent alignment */
}

/* Stress pattern classes for correct/incorrect stress */
.word.stress_good {
    background-color: #c3ffc3;
}

.word.stress_bad {
    background-color: #ffabab;
}

/* Hide stress colors when disabled */
.hide-stress-colors .word.stress_good,
.hide-stress-colors .word.stress_bad {
    background-color: #f8f9fa !important;
}

/* Simple stress information styling */
.stress-info {
    font-size: 1rem;
    color: #495057;
    white-space: nowrap;
    height: 24px; /* Fixed height for consistent alignment */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Detailed stress visualization styling */
.stress-detailed {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.2rem;
    height: 40px; /* Fixed height for consistent alignment */
    min-height: 40px;
}

.stress-circle {
    border: 1px solid #495057;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #495057;
    position: relative;
    transition: all 0.2s ease;
    background-color: white;
}

.stress-circle:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* Stress circle color intensity based on value */
/* .stress-circle[title*="0%"], .stress-circle[title*="1%"], .stress-circle[title*="2%"], 
.stress-circle[title*="3%"], .stress-circle[title*="4%"], .stress-circle[title*="5%"] {
    background-color: #f8f9fa;
} */

/* Very high stress levels */
/* .stress-circle[title*="91%"], .stress-circle[title*="92%"], .stress-circle[title*="93%"], 
.stress-circle[title*="94%"], .stress-circle[title*="95%"], .stress-circle[title*="96%"], 
.stress-circle[title*="97%"], .stress-circle[title*="98%"], .stress-circle[title*="99%"], 
.stress-circle[title*="100%"] {
    background-color: #2196f3;
    color: white;
    border-color: #1565c0;
} */

/* Tooltip enhancements for stress information */
.stress-info:hover, .stress-detailed:hover {
    border-color: #2196f3;
}

/* Visualization options enhancements */
#stress-mode-options {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

#stress-mode-options label.form-label {
    margin-bottom: 0.25rem;
    font-weight: 500;
}

/* Responsive adjustments for stress visualization */
@media (max-width: 768px) {
    .stress-circle {
        font-size: 0.5rem;
        min-width: 12px;
        min-height: 12px;
    }
    
    .stress-info {
        font-size: 0.65rem;
        padding: 0.1rem 0.2rem;
    }
    
    .pos {
        font-size: 0.6rem;
    }
}

.BC {
    background-color: rgb(95, 253, 95);
}

.BP {
    background-color: lightblue;
}

.BW, .WP {
    background-color: rgb(255, 85, 85);
}