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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
}

/* Branding Sections */
.branding-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-placeholder {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
}

.logo-fallback {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

.developer-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.developer-label {
    font-size: 0.85rem;
    color: #888888;
}

.developer-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
    padding: 5px 15px;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Listener Page Branding */
.branding-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.logo-placeholder-listener {
    display: flex;
    align-items: center;
}

.logo-img-small {
    max-height: 40px;
    max-width: 150px;
    object-fit: contain;
}

.logo-fallback-small {
    font-size: 1.5rem;
}

.developer-info-listener {
    color: #888888;
    font-size: 0.9rem;
}

.developer-text {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

/* Admin Page Styles - Dark Mode */
.admin-page {
    background: #0a0a0a;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #888;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.status-dot.streaming {
    background: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.6);
}

.status-dot.disconnected {
    background: #888;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.language-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.language-section label {
    font-size: 1.2rem;
    margin-right: 15px;
    font-weight: bold;
    color: #e0e0e0;
}

.language-select {
    padding: 12px 20px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    cursor: pointer;
    min-width: 250px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.language-select:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.7);
}

.language-select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.language-select option {
    background: #1a1a1a;
    color: #ffffff;
}

.control-panel {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #da190b 0%, #c41700 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.transcript-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.transcript-section h2 {
    margin-bottom: 20px;
    color: #e0e0e0;
}

.transcript-box {
    background: #000000;
    border-radius: 10px;
    padding: 20px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.transcript-box::-webkit-scrollbar {
    width: 8px;
}

.transcript-box::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.transcript-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.transcript-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.final-transcript {
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1.1rem;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    border-left: 3px solid #4CAF50;
}

.interim-transcript {
    color: #888888;
    font-style: italic;
    font-size: 1rem;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 5px;
    border-left: 3px solid #888888;
}

.info-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.info-section h3 {
    color: #e0e0e0;
    margin-bottom: 10px;
}

.info-section p {
    color: #b0b0b0;
}

.language-stats {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Listener Page Styles */
.listener-page {
    background: #000000;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
}

.subtitle-overlay {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.language-selector {
    text-align: center;
    margin-bottom: 40px;
}

.language-selector label {
    font-size: 1.3rem;
    margin-right: 15px;
    color: #ffffff;
    font-weight: bold;
}

.language-dropdown {
    padding: 15px 25px;
    font-size: 1.2rem;
    border-radius: 8px;
    border: 2px solid #ffffff;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    min-width: 300px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.language-dropdown:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #60a5fa;
}

.language-dropdown:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

.language-dropdown option {
    background: #1a1a1a;
    color: #ffffff;
}

.subtitle-container {
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column-reverse;
    gap: 15px;
}

.subtitle-text {
    background: rgba(0, 0, 0, 0.95);
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.5;
    border: 3px solid transparent;
    transition: all 0.5s ease;
}

/* Current (newest) subtitle - largest */
.subtitle-current {
    font-size: 3rem;
    padding: 60px 40px;
    min-height: 200px;
    opacity: 1;
    transform: scale(1);
}

.subtitle-current.active {
    border-color: #4CAF50;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.6);
    background: rgba(0, 0, 0, 0.98);
}

/* Previous subtitle - smaller */
.subtitle-previous {
    font-size: 2rem;
    padding: 30px 30px;
    min-height: 100px;
    opacity: 0.6;
    transform: scale(0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Oldest subtitle - smallest */
.subtitle-older {
    font-size: 1.5rem;
    padding: 20px 25px;
    min-height: 80px;
    opacity: 0.35;
    transform: scale(0.85);
    border-color: rgba(255, 255, 255, 0.05);
}

.waiting-text {
    color: #666666;
    font-size: 1.5rem;
    font-style: italic;
}

.error-text {
    color: #ff6666;
    font-size: 1.5rem;
    font-style: italic;
}

.connection-status {
    text-align: center;
    margin-top: 30px;
    color: #cccccc;
    font-size: 1.1rem;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.status-indicator.connected {
    background: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
}

.status-indicator.disconnected {
    background: #f44336;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .branding-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .developer-info {
        align-items: flex-start;
    }

    .branding-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle-current {
        font-size: 2rem;
        padding: 40px 20px;
        min-height: 150px;
    }

    .subtitle-previous {
        font-size: 1.4rem;
        padding: 25px 15px;
        min-height: 80px;
    }

    .subtitle-older {
        font-size: 1.1rem;
        padding: 15px 12px;
        min-height: 60px;
    }

    .waiting-text,
    .error-text {
        font-size: 1.2rem;
    }

    .control-panel {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .language-select,
    .language-dropdown {
        min-width: 100%;
        width: 100%;
    }

    .language-selector {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .language-selector label {
        margin-right: 0;
    }
}