/**
 * Styles for Real-Time Audio Translation plugin
 */

/* Common styles */
.audio-translation-container {
    max-width: 1000px;
    margin: 0 auto 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.audio-translation-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.translation-panel {
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.panel-section {
    margin-bottom: 25px;
    background-color: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.panel-section h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Status indicators */
.status-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.status-item {
    flex: 1;
    min-width: 200px;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.status-label {
    font-weight: bold;
    display: inline-block;
    margin-right: 8px;
    color: #555;
}

.status-value {
    color: #333;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn:focus {
    outline: none;
}

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

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #27ae60;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

/* Form controls */
.form-control {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Audio visualizer */
#audio-visualizer {
    width: 100%;
    height: 100px;
    background-color: #000;
    border-radius: 4px;
}

/* QR code section */
.qrcode-section {
    text-align: center;
}

#qrcode-container {
    margin: 20px auto;
    padding: 15px;
    background-color: white;
    display: inline-block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qrcode-link {
    color: #3498db;
    word-break: break-all;
}

/* Offer string container */
.offer-string-container {
    margin-top: 20px;
}

#offer-string, #offer-string-input {
    height: 60px;
    font-family: monospace;
    font-size: 12px;
}

/* Listeners section */
.listeners-section {
    max-height: 400px;
    overflow-y: auto;
}

.listener-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
}

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

.listener-name {
    font-weight: bold;
    margin-right: 10px;
}

.listener-language {
    background-color: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-right: 10px;
}

.listener-status {
    font-size: 12px;
}

.status-connected {
    color: #2ecc71;
}

.status-disconnected {
    color: #e74c3c;
}

/* Transcript section */
.transcript-section {
    max-height: 400px;
    overflow-y: auto;
}

.transcript-content {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #fff;
}

.transcript-entry {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 4px;
    background-color: #f0f7fb;
    border-left: 4px solid #3498db;
}

.transcript-entry.direct-audio {
    background-color: #f0fbf5;
    border-left: 4px solid #2ecc71;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .status-container {
        flex-direction: column;
    }
    
    .status-item {
        min-width: 100%;
    }
    
    .control-buttons {
        display: flex;
        flex-wrap: wrap;
    }
    
    .btn {
        flex: 1 0 calc(50% - 10px);
    }
    
    .listener-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .listener-actions {
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
}

/* Audio control button */
.muted {
    background-color: #7f8c8d;
}

/* Translation info styles */
.translation-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.info-item {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.info-label {
    font-weight: bold;
    margin-right: 8px;
    color: #555;
}

.info-value {
    color: #333;
}

/* Language selection styles */
.language-selection {
    margin-top: 10px;
}

.language-selection label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* Controls section formatting */
.control-buttons {
    margin-bottom: 15px;
}

.audio-controls {
    display: flex;
    gap: 10px;
}

/* Session information */
.session-info {
    margin-bottom: 15px;
}

.session-id-info {
    font-size: 16px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f0f7fb;
    border-radius: 4px;
}

.session-label {
    font-weight: bold;
    margin-right: 8px;
}

.session-value {
    font-family: monospace;
}

.session-instruction {
    color: #7f8c8d;
    font-style: italic;
}

/* Connection section */
.session-join {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.session-join input {
    flex: 1;
    margin-bottom: 0;
}

/* Additional styles for sender-specific elements */
.sender .visualizer-section {
    margin-bottom: 20px;
}

/* Additional styles for listener-specific elements */
.listener .transcript-section {
    margin-top: 20px;
}

.audio-translation-admin .card {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-top: 20px;
    padding: 0;
    position: relative;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.audio-translation-admin .card-header {
    border-bottom: 1px solid #ccd0d4;
    padding: 10px 15px;
    background: #f8f9fa;
    position: relative;
}

.audio-translation-admin .card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.audio-translation-admin .card-body {
    padding: 15px;
}

.audio-translation-admin .collapse-toggle {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
    color: #72777c;
}

.audio-translation-admin .collapse-toggle:hover {
    color: #0073aa;
}

.audio-translation-admin .language-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
}

.audio-translation-admin .language-table th,
.audio-translation-admin .language-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.audio-translation-admin .language-table th {
    background-color: #f9f9f9;
}

.audio-translation-admin .form-container {
    display: none;
    background: #f9f9f9;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid #e5e5e5;
}

.audio-translation-admin .active-language {
    color: #46b450;
    font-weight: bold;
}

.audio-translation-admin .inactive-language {
    color: #dc3232;
    text-decoration: line-through;
    opacity: 0.7;
}

/* Select2 custom styling */
.select2-container {
    width: 100% !important;
}

/* Toggle switch for language activation */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}