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

body {
    background: #000000;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Content Wrapper */
.content-wrapper {
    margin-left: 0;
    padding: 20px;
}

.content-wrapper.with-sidebar {
    margin-left: 280px;
}

/* Login page - no sidebar */
body:has(.login-panel) .content-wrapper {
    margin-left: 0;
}

/* Sidebar - Compact Modern */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(12, 12, 12, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.sidebar-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.logo-container {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-logo {
    max-width: 140px;
    width: auto;
    height: auto;
    max-height: 32px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.logo-fallback {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-email {
    font-size: 13px;
    color: #cccccc;
    word-break: break-all;
}

.user-role {
    font-size: 11px;
    color: #888888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 18px;
    margin: 0 8px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 13px;
    border-left: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-left: none;
    box-shadow: inset 2px 0 0 rgba(147, 112, 219, 0.6);
}

.nav-item-logout {
    color: #e57373;
}

.nav-item-logout:hover {
    background: rgba(229, 115, 115, 0.12);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    font-size: 12px;
    text-align: center;
}

.nav-icon i {
    font-size: 12px;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    flex: 1;
}

.nav-category {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.28);
    padding: 12px 14px 5px 24px;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 8px 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
    }
    
    .content-wrapper.with-sidebar {
        margin-left: 260px;
    }
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Panel */
.panel {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.panel h2, .panel h3 {
    color: #ffffff;
    margin-bottom: 16px;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(15, 15, 15, 0.98);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #888888;
    font-size: 12px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Job Cards */
.job-card {
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    background: #1a1a1a;
    color: #fff;
    margin-bottom: 8px;
}

/* Status Messages */
.status-success {
    padding: 12px 16px;
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.5);
    border-radius: 8px;
    color: #28a745;
    margin-top: 12px;
}

.status-playing {
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #1a1a1a;
    margin-top: 12px;
}

.status-warning {
    padding: 12px 16px;
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    color: #ffc107;
    margin-top: 12px;
}

.status-error {
    padding: 12px 16px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    border-radius: 8px;
    color: #dc3545;
    margin-top: 12px;
}

/* Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 12px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Streaming progress bar - loading animation (ElevenLabs-style) */
.streaming-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: stretch;
}
.streaming-progress-played {
    background: rgba(34,197,94,0.8);
    transition: width 0.05s linear;
}
.streaming-progress-buffered {
    background: rgba(34,197,94,0.35);
    transition: width 0.1s ease;
}
.streaming-progress-loading {
    flex: 1;
    min-width: 40px;
    background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.08) 100%);
    background-size: 200% 100%;
    animation: streamingShimmer 1.5s ease-in-out infinite;
}
@keyframes streamingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Login Panel */
.login-panel {
    max-width: 400px;
    margin: 100px auto;
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.login-panel h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #ffffff;
}

.login-panel .form-group {
    margin-bottom: 20px;
}

.login-panel .btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Code Blocks */
code, pre {
    font-family: 'Courier New', monospace;
    background: rgba(10, 10, 10, 0.98);
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffffff;
}

pre {
    padding: 16px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* Accordion */
.accordion {
    background: rgba(20, 20, 20, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 16px 0;
    overflow: hidden;
}

.accordion-header {
    padding: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    font-weight: 500;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
}

.accordion-content.active {
    max-height: 2000px;
    padding: 16px;
}

/* Info Card for Editor */
.info-card {
    background: rgba(10, 10, 10, 0.98);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-card h4 {
    color: #ffffff;
    margin-bottom: 16px;
}

.info-text {
    color: #cccccc;
    margin-bottom: 8px;
}

.info-subtext {
    color: #888888;
    font-size: 13px;
    margin-bottom: 4px;
}

.info-label {
    color: #888888;
    font-size: 12px;
}

/* Credit History Table Styles */
.credit-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
    background: rgba(20, 20, 20, 0.8);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.credit-history-table th {
    background: #ffffff;
    color: #000000;
    font-weight: 600;
    padding: 16px;
    text-align: left;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credit-history-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
}

.credit-history-table tr:last-child td {
    border-bottom: none;
}

.credit-history-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.credit-positive {
    color: #90ee90 !important;
    font-weight: 600;
}

.credit-negative {
    color: #ff6b6b !important;
    font-weight: 600;
}

/* Audio Player Styles */
.audio-player {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.audio-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.audio-player-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

.audio-icon, .audio-icon-outline {
    font-size: 20px;
}

.audio-player-actions {
    display: flex;
    gap: 8px;
}

.audio-action-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.audio-waveform-container {
    position: relative;
    width: 100%;
    height: 150px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.audio-waveform-container.streaming-mode {
    display: flex;
    flex-direction: column;
}

.streaming-waveform-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.streaming-waveform-wrapper .audio-waveform {
    height: 100%;
}

.audio-waveform {
    width: 100%;
    height: 100%;
    display: block;
}

.audio-progress-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 10;
}

.audio-time {
    display: flex;
    justify-content: space-between;
    color: #cccccc;
    font-size: 14px;
    margin-bottom: 12px;
}

.audio-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.audio-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.audio-play-btn {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 16px;
}

.audio-play-btn:hover {
    background: #f0f0f0;
}

.audio-speed-controls {
    display: flex;
    justify-content: center;
}

.audio-speed-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    color: #ffffff;
    font-size: 12px;
}

.audio-speed-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Presets List Styles */
.presets-list {
    margin-top: 16px;
}

.presets-container {
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.preset-card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.preset-card:last-child {
    margin-bottom: 0;
}

.preset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.preset-icon {
    font-size: 16px;
}

.preset-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
}

.preset-params {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.preset-param {
    color: #cccccc;
    font-size: 12px;
    font-family: monospace;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.presets-container::-webkit-scrollbar {
    width: 8px;
}

.presets-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.presets-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

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

/* Dictionary List Styles */
.dictionary-list {
    margin-top: 16px;
}

.dictionary-container {
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.dictionary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.dictionary-item:last-child {
    margin-bottom: 0;
}

.dictionary-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dictionary-word {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
    min-width: 100px;
}

.dictionary-arrow {
    color: #888888;
    font-size: 14px;
}

.dictionary-pronunciation {
    color: #cccccc;
    font-size: 13px;
    font-family: monospace;
    flex: 1;
}

.dictionary-container::-webkit-scrollbar {
    width: 8px;
}

.dictionary-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.dictionary-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

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