/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Righteous&display=swap');

/* CSS Variables - Dark Theme */
:root {
    --primary-color: #ff7acc;
    --secondary-color: #230a89;
    --accent-yellow: #ffdf6b;
    --surface-color: #262D34;
    --background-color: #1A1F24;
    --border-color: #3a4149;
    --text-color: #ffffff;
    --text-muted: #b0b8c1;
    --text-secondary: #8892a0;
    --success-color: #10b981;
    --warning-color: #ffdf6b;
    --error-color: #ef4444;
    --info-color: #ff7acc;
    --gradient-inner: linear-gradient(180deg, #2100A71C 0%, #F2295B0D 100%);
    --hover-color: #323941;
    --card-background: #2a3139;
}

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

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: var(--surface-color);
    background-image: var(--gradient-inner);
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-logo {
    height: 80px;
    width: auto;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    text-align: left;
}

.header h1 {
    font-family: 'Righteous', cursive;
    font-size: 2.5rem;
    margin-bottom: 0;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Submit Section */
.submit-section {
    background: var(--surface-color);
    background-image: var(--gradient-inner);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.submit-section h2 {
    font-family: 'Righteous', cursive;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Input Mode Selection */
.input-mode-selection {
    margin-bottom: 0.5rem;
}

.input-mode-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.input-mode-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.input-mode-tab:hover {
    background: var(--hover-color);
    color: var(--text-color);
    transform: none;
}

.input-mode-tab.active {
    background: var(--card-background);
    color: var(--primary-color);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.input-mode-tab.active:hover {
    background: var(--card-background);
    color: var(--primary-color);
}

.input-mode-section {
    display: none;
}

.input-mode-section.active {
    display: block;
}

/* YouTube URL specific styles */
.url-input-section {
    margin-bottom: 1.5rem;
}

.cookies-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 248, 220, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
}

.cookies-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cookies-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.cookies-help {
    margin-top: 1rem;
}

.cookies-explanation {
    line-height: 1.6;
}

.cookies-explanation p {
    margin-bottom: 1rem;
}

.cookies-explanation ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.cookies-explanation li {
    margin-bottom: 0.5rem;
}

.cookies-privacy {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 193, 7, 0.3);
}

#youtube-cookies {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    min-height: 80px;
    resize: vertical;
}

.job-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Primary Form Fields */
.primary-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.5rem;
}

.name-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    align-items: end;
    margin-bottom: 0.5rem;
}

.example-actions {
    display: flex;
    align-items: end;
    padding-bottom: 0.5rem;
}

/* Styles Section */
.styles-section {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: none;
}

.styles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.styles-info h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.styles-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.custom-styles-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.custom-styles-section .file-upload {
    margin-bottom: 1.5rem;
}

.custom-styles-section .file-upload:last-child {
    margin-bottom: 0;
}

.file-upload {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-upload input[type="file"] {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.file-upload input[type="file"]:hover {
    border-color: var(--accent-yellow);
}

.file-upload input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 204, 0.15);
}

.styles-quick-actions {
    margin-top: 0.5rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    color: var(--secondary-color);
    background: rgba(255, 122, 204, 0.15);
}

.btn-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--card-background);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.form-control:hover {
    border-color: var(--accent-yellow);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 204, 0.15);
}

.form-actions {
    margin-top: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.help-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.submit-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 122, 204, 0.3);
}

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

/* Enhanced disabled state for YouTube mode when waiting for metadata */
.youtube-url-mode.active .submit-btn:disabled {
    background: linear-gradient(135deg, #adb5bd 0%, #6c757d 100%);
    color: #fff;
    opacity: 0.8;
    position: relative;
    overflow: hidden;
}

.youtube-url-mode.active .submit-btn:disabled::before {
    content: '⏳ Waiting for metadata extraction...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1;
}

.example-btn {
    padding: 0.50rem 1rem;
    background: rgba(255, 122, 204, 0.15);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    line-height: 1;
    min-width: 120px;
}

.example-btn:hover {
    background: rgba(255, 122, 204, 0.25);
    transform: translateY(-1px);
}

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

.example-btn small {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Statistics Section */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
}

.stat-card {
    background: var(--surface-color);
    background-image: var(--gradient-inner);
    padding: 0.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Jobs Section */
.jobs-section {
    background: var(--surface-color);
    background-image: var(--gradient-inner);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-family: 'Righteous', cursive;
    color: var(--text-color);
}

.auto-refresh-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-refresh-control label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.auto-refresh-control label:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.auto-refresh-control label.auto-refresh-active {
    background-color: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.auto-refresh-control label.auto-refresh-active::after {
    content: "●";
    color: #4F46E5;
    font-size: 8px;
    margin-left: 2px;
}

/* Job Items */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.job {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.job:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.job-row {
    display: flex;
    align-items: stretch;
}

.job-main-info {
    flex: 1;
    min-width: 0;
    padding: 1rem;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.job-title-section {
    flex: 1;
    min-width: 0;
}

.job-header-line {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.job-id {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-primary);
}

.job-status {
    display: flex;
    align-items: center;
}

.job-track-info,
.job-id-info {
    margin-top: 0.25rem;
}

.track-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-track-btn {
    background: transparent;
    border: 1px solid var(--accent-yellow);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.copy-track-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.copy-track-btn:active {
    transform: translateY(0);
}

.copy-track-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.job-id {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.job-timing-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: right;
    flex-shrink: 0;
    min-width: 140px;
}

.job-submitted,
.job-duration {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.timing-label {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 70px;
}

.timing-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.job-timestamp {
    font-size: 0.75rem;
    color: #666;
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-queued { background: rgba(255, 122, 204, 0.2); color: var(--primary-color); }
.status-processing_audio { background: rgba(255, 223, 107, 0.2); color: var(--accent-yellow); }
.status-transcribing { background: rgba(35, 10, 137, 0.2); color: var(--secondary-color); }
.status-awaiting_review { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.status-rendering { background: rgba(255, 122, 204, 0.2); color: var(--primary-color); }
.status-complete { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.status-error { background: rgba(239, 68, 68, 0.2); color: var(--error-color); }

.job-actions {
    padding: 1rem;
    border-left: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 280px; /* Fixed width instead of percentage */
    min-width: 280px; /* Ensure minimum width */
    max-width: 280px; /* Prevent width from growing */
    flex-shrink: 0;
    align-items: flex-start; /* Left-align buttons */
}

.job-actions .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    white-space: nowrap;
    text-align: left; /* Ensure text is left-aligned */
    justify-content: flex-start; /* Left-align button content */
    width: 100%; /* Make buttons take full width of container */
    max-width: 100%; /* Prevent buttons from exceeding container */
    box-sizing: border-box; /* Include padding in width calculation */
    overflow: hidden; /* Prevent text overflow */
    text-overflow: ellipsis; /* Add ellipsis for long text */
    
    /* Default subtle styling for most actions */
    background: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.job-actions .btn:hover {
    background: var(--hover-color);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

/* Delete buttons - red styling */
.job-actions .btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.job-actions .btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Human input actions - green styling */
.job-actions .btn-success {
    background: var(--card-background);
    color: var(--text-color);
    border: 2px solid var(--success-color);
}

.job-actions .btn-success:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--text-color);
}

/* All other actions - pink accent styling */
.job-actions .btn-info,
.job-actions .btn-primary,
.job-actions .btn-warning,
.job-actions .btn-secondary {
    background: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--primary-color);
}

.job-actions .btn-info:hover,
.job-actions .btn-primary:hover,
.job-actions .btn-warning:hover,
.job-actions .btn-secondary:hover {
    background: rgba(255, 122, 204, 0.1);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.log-entry {
    margin-bottom: 0.25rem;
    padding: 0.25rem;
    border-radius: 3px;
}

.log-timestamp {
    color: #666;
    margin-right: 0.5rem;
}

.log-level {
    font-weight: bold;
    margin-right: 0.5rem;
    min-width: 60px;
    display: inline-block;
}

.log-info .log-level { color: #0066cc; }
.log-success .log-level { color: #28a745; }
.log-warning .log-level { color: #ffc107; }
.log-error .log-level { color: #dc3545; }
.log-debug .log-level { color: #6c757d; }

/* Buttons */
.btn-primary { background: var(--primary-color); color: white; }
.btn-success { background: var(--success-color); color: white; }
.btn-danger { background: var(--error-color); color: white; }
.btn-warning { background: var(--warning-color); color: #212529; }
.btn-info { background: var(--info-color); color: white; }

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(110%);
}

/* Admin Panel (Floating) */
.admin-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.admin-toggle {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.admin-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.admin-content {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 250px;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.admin-panel.show .admin-content {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.admin-content h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-family: 'Righteous', cursive;
}

.admin-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Log Tail Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: calc(100vw - 40px);
    height: auto;
    max-height: 95vh;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-background);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    font-family: 'Righteous', cursive;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-control-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-control-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.modal-control-btn.secondary {
    background: #6c757d;
}

.modal-control-btn.secondary:hover {
    background: #5a6268;
}

.modal-control-btn.toggle-active {
    background: #28a745;
}

.modal-control-btn.toggle-active:hover {
    background: #218838;
}

/* Auto-refresh toggle button - paused state */
#log-auto-refresh-btn:not(.toggle-active) {
    background: #ffc107;
    color: #212529;
}

#log-auto-refresh-btn:not(.toggle-active):hover {
    background: #e0a800;
}

.modal-close {
    background: #dc3545;
    color: white;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.modal-logs {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    background: var(--card-background);
    color: var(--text-color);
    line-height: 1.4;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Improve text selection appearance */
.modal-logs::selection {
    background: #667eea;
    color: white;
}

.modal-logs *::selection {
    background: #667eea;
    color: white;
}

/* Font size classes for adjustable text */
.modal-logs.font-xs { font-size: 0.6rem; }
.modal-logs.font-sm { font-size: 0.7rem; }
.modal-logs.font-md { font-size: 0.8rem; }
.modal-logs.font-lg { font-size: 0.9rem; }
.modal-logs.font-xl { font-size: 1.0rem; }
.modal-logs.font-xxl { font-size: 1.1rem; }

/* Log Filter Bar (Server-side Filtering) */
.log-filter-bar {
    padding: 1rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    min-width: 150px;
    background: var(--card-background);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.filter-input:hover {
    border-color: var(--accent-yellow);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 122, 204, 0.15);
}

.filter-level-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--card-background);
    color: var(--text-color);
    min-width: 120px;
    transition: all 0.2s ease;
}

.filter-level-select:hover {
    border-color: var(--accent-yellow);
}

.filter-level-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 122, 204, 0.15);
}

.filter-limit-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    width: 80px;
    background: var(--card-background);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.filter-limit-input:hover {
    border-color: var(--accent-yellow);
}

.filter-limit-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 122, 204, 0.15);
}

.limit-presets {
    display: flex;
    gap: 0.25rem;
}

.limit-preset-btn {
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.75rem;
    background: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.limit-preset-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.filter-regex-btn {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    background: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.filter-regex-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

.filter-regex-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: bold;
}

.filter-refresh-btn {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-refresh-btn:hover {
    background: var(--hover-color);
    border-color: var(--success-color);
    color: var(--success-color);
}

.filter-clear-btn {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-clear-btn:hover {
    background: var(--hover-color);
    border-color: var(--error-color);
    color: var(--error-color);
}

.filter-stats-row {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.filter-stats {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Log entry styles */
.log-entry {
    display: flex;
    gap: 0.75rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.log-timestamp {
    color: var(--text-secondary);
    font-size: 0.8em;
    white-space: nowrap;
    min-width: 70px;
}

.log-level {
    font-weight: bold;
    min-width: 60px;
    white-space: nowrap;
}

.log-level.debug { color: var(--text-muted); }
.log-level.info { color: var(--info-color); }
.log-level.warning { color: var(--warning-color); }
.log-level.error { color: var(--error-color); }
.log-level.critical { color: var(--error-color); }

.log-message {
    flex: 1;
    word-wrap: break-word;
    line-height: 1.3;
}

.log-entry.log-debug { background: rgba(176, 184, 193, 0.05); }
.log-entry.log-info { background: rgba(255, 122, 204, 0.05); }
.log-entry.log-warning { background: rgba(255, 223, 107, 0.1); }
.log-entry.log-error { background: rgba(239, 68, 68, 0.1); }
.log-entry.log-critical { background: rgba(239, 68, 68, 0.15); }

.no-logs, .loading, .error {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.error {
    color: #dc3545;
}

/* Responsive log filter bar */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 0.25rem;
        align-items: stretch;
    }
    
    .filter-input,
    .filter-level-select {
        min-width: auto;
        width: 100%;
    }
    
    .filter-actions {
        margin-left: 0;
        justify-content: center;
    }
    
    .limit-presets {
        justify-content: center;
    }
}

/* Notifications */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    pointer-events: none; /* Allow clicks through container */
}

.notification {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    max-width: 350px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    pointer-events: auto; /* Re-enable clicks on notification */
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.notification-success {
    border-left: 4px solid var(--success-color) !important;
    background: var(--card-background) !important;
    color: var(--success-color) !important;
}

.notification-info {
    border-left: 4px solid var(--info-color);
    background: var(--card-background);
    color: var(--info-color);
}

.notification-error {
    border-left: 4px solid var(--error-color);
    background: var(--card-background);
    color: var(--error-color);
}

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

@keyframes highlight-flash {
    0% {
        background-color: var(--surface-color);
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    25% {
        background-color: rgba(255, 122, 204, 0.15);
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(255, 122, 204, 0.3);
    }
    50% {
        background-color: rgba(255, 122, 204, 0.2);
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(255, 122, 204, 0.4);
    }
    75% {
        background-color: rgba(255, 122, 204, 0.15);
        transform: scale(1.01);
        box-shadow: 0 6px 20px rgba(255, 122, 204, 0.3);
    }
    100% {
        background-color: var(--surface-color);
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

/* Review Instructions */
.review-instructions {
    background: rgba(255, 122, 204, 0.1);
    border: 1px solid var(--info-color);
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    color: var(--info-color);
    font-weight: 500;
}

.review-instructions strong {
    color: var(--text-color);
}

/* Error Details */
.error-details {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    color: var(--error-color);
    white-space: pre-wrap;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.no-jobs {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

.no-logs {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.logs-loading {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .modal {
        padding: 10px;
    }
    
    .header {
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-logo {
        height: 60px;
    }

    .header-text {
        text-align: center;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .name-fields-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .example-actions {
        justify-content: center;
        padding-bottom: 0;
    }

    .styles-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .styles-info {
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .job-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .job-actions {
        border-left: none;
        border-top: 1px solid var(--border-color);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start; /* Left-align buttons on mobile */
        gap: 0.5rem;
        margin-top: 0.5rem;
        width: 100%; /* Full width on mobile */
        min-width: auto; /* Remove min-width constraint on mobile */
        max-width: none; /* Remove max-width constraint on mobile */
        align-items: flex-start; /* Keep left alignment */
        padding: 0.75rem;
    }
    
    .job-actions .btn {
        flex: 1 1 auto; /* Allow buttons to grow and shrink */
        min-width: 100px; /* Reasonable minimum width for mobile */
        max-width: 200px; /* Prevent buttons from getting too wide */
        font-size: 0.75rem;
        padding: 0.6rem 0.4rem;
        text-align: center;
        white-space: nowrap; /* Prevent text wrapping */
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3; /* Better line height for mobile */
    }
    
    .modal-content {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
    }
    
    .modal-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .modal-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .modal-control-btn,
    .modal-close {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .admin-content {
        right: -50px;
        min-width: 200px;
    }
    
    /* Job header responsive styles */
    .job-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .job-timing-section {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        min-width: auto;
        width: 100%;
    }
    
    .timing-label {
        min-width: auto;
    }
    
    .multi-stage-progress-bar {
        height: 40px;
    }
    
    .segment-content {
        padding: 0.125rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .segment-label {
        font-size: 0.6rem;
    }
    
    .segment-duration {
        font-size: 0.55rem;
    }
    
    /* Notifications on mobile */
    .notifications {
        top: 10px;
        right: 10px;
        left: 10px;
        right: 10px;
    }
    
    .notification {
        max-width: none;
        min-width: auto;
        margin-bottom: 0.5rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Console log styles for readability */
.console-log {
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.4;
}

#manual-status-update-modal .modal-content {
    max-width: 60vw;
    max-height: 85vh;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#manual-status-update-modal .modal-body {
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 120px); /* Account for header height */
}

/* Cache Stats Modal Styles */
.cache-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.cache-stats-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cache-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
}

/* Cache Overview */
.cache-overview {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
}

.cache-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.cache-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.cache-stat-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.cache-stat-value {
    font-weight: 600;
    color: var(--primary);
}

/* Cache Directories */
.cache-directories {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
}

.cache-dirs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.cache-dir-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.cache-dir-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.cache-dir-header {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.cache-dir-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cache-dir-stats > div {
    color: var(--text-secondary);
    font-size: 12px;
}

.cache-dir-stats > div:first-child {
    font-weight: 500;
    color: var(--primary);
}

/* AudioShake Cache */
.audioshake-cache {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
}

.audioshake-cache-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.audioshake-cache-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.audioshake-cache-item:hover {
    border-color: var(--primary);
}

.cache-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.cache-item-hash {
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.cache-item-timestamp {
    font-size: 11px;
    color: var(--text-secondary);
}

.cache-item-size {
    font-size: 11px;
    color: var(--text-muted);
}

.no-cache {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
    margin-top: 12px;
}

/* Cache Actions */
.cache-actions {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
}

.cache-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.cache-actions-grid .btn {
    padding: 12px 16px;
    font-size: 14px;
    text-align: center;
}

/* Small button variant for cache items */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* Responsive adjustments for cache modal */
@media (max-width: 768px) {
    .cache-modal-content {
        max-width: 95vw;
        margin: 10px;
    }
    
    .cache-summary {
        grid-template-columns: 1fr;
    }
    
    .cache-dirs-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .cache-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .audioshake-cache-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .cache-item-info {
        text-align: center;
    }
}

/* Files Modal Styles */
.files-modal-content {
    max-width: 90vw;
    width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.files-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.files-summary {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.files-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.files-stat {
    color: var(--text-muted);
}

.files-stat strong {
    color: var(--text-primary);
}

/* File Categories */
.files-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.file-category {
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.file-category-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-category-header h4 {
    margin: 0;
    font-weight: 600;
}

.file-category-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.file-category-description {
    padding: 1rem 1.5rem 0.5rem;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.file-category-files {
    padding: 0.5rem 1.5rem 1.5rem;
}

/* File Items */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--background-color);
    transition: all 0.2s ease;
}

.file-item:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.file-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.file-name-text {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-details {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-size {
    font-weight: 500;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.file-actions .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Preview Modal Styles */
.video-preview-content,
.audio-preview-content {
    max-width: 90vw;
    width: 800px;
    max-height: 90vh;
}

.preview-video {
    width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    background: #000;
}

.preview-audio {
    width: 100%;
    border-radius: 8px;
}

.preview-actions {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Button Size Variants */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
}

/* Modal Control Button Variants */
.modal-control-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.modal-control-btn.primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6a4193 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* No Files State */
.no-files {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
}

/* Responsive Design for Files Modal */
@media (max-width: 768px) {
    .files-modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .files-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .file-actions {
        justify-content: center;
    }
    
    .file-details {
        justify-content: center;
    }
    
    .video-preview-content,
    .audio-preview-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .preview-video {
        max-height: 40vh;
    }
}

@media (max-width: 480px) {
    .file-category-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .file-actions {
        flex-direction: column;
    }
    
    .file-actions .btn {
        text-align: center;
    }
}

/* Timeline Styles */
.timeline-phases {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
}

.timeline-phase {
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Timeline Modal Styles */
.timeline-modal-content {
    max-width: 95vw;
    width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.timeline-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Timeline Summary Cards */
.timeline-summary {
    margin-bottom: 1.5rem;
}

.timeline-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.timeline-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.timeline-card-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.timeline-card-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

/* Timeline Visualization */
.timeline-visualization {
    margin-bottom: 1.5rem;
}

.timeline-visualization h4 {
    margin-bottom: 0.75rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.timeline-chart {
    display: flex;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-phase-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    min-width: 35px;
    cursor: pointer;
}

.timeline-phase-bar:hover {
    opacity: 0.85;
    transform: scaleY(1.05);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timeline-phase-bar.active {
    animation: pulse 2s infinite;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.timeline-phase-info {
    text-align: center;
    padding: 0.2rem 0.15rem;
    width: 100%;
}

.timeline-phase-name {
    font-weight: 700;
    margin-bottom: 0.1rem;
    font-size: 0.65rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-phase-duration {
    font-size: 0.55rem;
    opacity: 0.9;
    font-weight: 500;
    white-space: nowrap;
}

/* Timeline Details Table */
.timeline-details {
    margin-bottom: 1.5rem;
}

.timeline-details h4 {
    margin-bottom: 0.75rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.timeline-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.timeline-table-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.timeline-table-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    align-items: center;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.timeline-table-row:hover {
    background: #f8f9fa;
}

.timeline-table-row.active {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.08), rgba(40, 167, 69, 0.03));
    border-left: 3px solid #28a745;
    padding-left: calc(1rem - 3px);
}

.timeline-table-row:last-child {
    border-bottom: none;
}

.timeline-phase-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #333;
}

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



/* Responsive Design for Timeline */
@media (max-width: 768px) {
    .timeline-modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .timeline-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-chart {
        height: 80px;
        flex-direction: column;
    }
    
    .timeline-phase-bar {
        height: 20px;
        width: 100% !important;
        margin-bottom: 2px;
    }
    
    .timeline-table-header,
    .timeline-table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .timeline-table-header > div,
    .timeline-table-row > div {
        text-align: center;
        padding: 0.25rem 0;
    }
    
    .timeline-table-header > div:first-child,
    .timeline-table-row > div:first-child {
        font-weight: 600;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .timeline-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .timeline-phases {
        flex-direction: column;
    }
    
    .timeline-phase {
        text-align: center;
    }
    
    .timeline-card-value {
        font-size: 1.25rem;
    }
}



/* Multi-Stage Progress Bar - Fixed Layout */
.job-progress-enhanced {
    margin-bottom: 1rem;
    width: 100%;
}

.multi-stage-progress-bar {
    display: flex;
    width: 100%;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.multi-stage-progress-bar.clickable-progress-bar {
    cursor: pointer;
    transition: all 0.2s ease;
}

.multi-stage-progress-bar.clickable-progress-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.progress-segment {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    cursor: pointer;
    min-width: 30px;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.progress-segment:last-child {
    border-right: none;
}

.progress-segment:hover {
    transform: scaleY(1.08);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.progress-segment.active {
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.progress-segment.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 25%, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 50%, 
        transparent 75%, 
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 8px 8px;
    animation: progressStripes 1s linear infinite;
}

.progress-segment.completed {
    position: relative;
    opacity: 0.9;
}

.progress-segment.completed::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-segment.upcoming {
    opacity: 0.5;
    background: linear-gradient(135deg, var(--card-background) 0%, var(--surface-color) 100%) !important;
    color: var(--text-muted);
}

.progress-segment.next {
    opacity: 0.75;
    box-shadow: inset 0 0 0 2px rgba(66, 133, 244, 0.3);
    animation: nextPhaseGlow 2s ease-in-out infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 8px 0; }
}

@keyframes nextPhaseGlow {
    0%, 100% { 
        box-shadow: inset 0 0 0 1px rgba(66, 133, 244, 0.2);
    }
    50% { 
        box-shadow: inset 0 0 0 2px rgba(66, 133, 244, 0.4);
    }
}

.segment-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.25rem 0.5rem;
    width: 100%;
    height: 100%;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-segment.upcoming .segment-content {
    color: var(--text-muted);
    text-shadow: none;
}

.segment-label {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    letter-spacing: 0.25px;
    text-transform: uppercase;
    font-size: 0.65rem;
}

.segment-duration {
    font-size: 0.6rem;
    opacity: 0.9;
    font-weight: 500;
    white-space: nowrap;
    margin-top: 1px;
}

/* Enhanced Status Badge */
.job-status .status-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Progress Bar Responsive Behavior */
@media (max-width: 768px) {
    .job-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .job-timing-section {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        min-width: auto;
        width: 100%;
    }
    
    .timing-label {
        min-width: auto;
    }
    
    .multi-stage-progress-bar {
        height: 40px;
    }
    
    .segment-content {
        padding: 0.125rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .segment-label {
        font-size: 0.6rem;
    }
    
    .segment-duration {
        font-size: 0.55rem;
    }
    
    .progress-segment {
        min-width: 25px;
    }
}

@media (max-width: 480px) {
    .job-header-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .copy-track-btn {
        margin-left: 4px;
        padding: 3px 6px;
        min-width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .job-timing-section {
        flex-direction: column;
        gap: 0.25rem;
        text-align: left;
    }
    
    .multi-stage-progress-bar {
        height: 40px;
    }
    
    .segment-content {
        padding: 0.125rem 0.125rem;
        font-size: 0.65rem;
    }
    
    .segment-label {
        font-size: 0.55rem;
        display: none; /* Hide labels on very small screens */
    }
    
    .segment-duration {
        font-size: 0.5rem;
    }
    
    .progress-segment {
        min-width: 20px;
    }
    
    .progress-segment.completed::after {
        font-size: 8px;
        top: 1px;
        right: 2px;
    }
}

/* Mobile Job Layout Enhancement */
@media (max-width: 768px) {
    .job-row {
        flex-direction: column;
    }
    
    .job-actions {
        border-left: none;
        border-top: 1px solid var(--border-color);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        min-width: auto;
        padding: 0.75rem;
    }
    
    .job-main-info {
        padding: 0.75rem;
    }
}

/* Refined Color Palette */
.progress-segment[style*="rgb(108, 117, 125)"] { /* queued - gray */
    background: linear-gradient(135deg, var(--text-muted) 0%, var(--text-secondary) 100%);
}

.progress-segment[style*="rgb(0, 123, 255)"] { /* processing - blue */
    background: linear-gradient(135deg, var(--info-color) 0%, var(--secondary-color) 100%);
}

.progress-segment[style*="rgb(255, 193, 7)"] { /* awaiting_review - amber */
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--accent-yellow) 100%);
}

.progress-segment[style*="rgb(253, 126, 20)"] { /* reviewing - orange */
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--accent-yellow) 100%);
}

.progress-segment[style*="rgb(40, 167, 69)"] { /* rendering/complete - green */
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-color) 100%);
}

.progress-segment[style*="rgb(220, 53, 69)"] { /* error - red */
    background: linear-gradient(135deg, var(--error-color) 0%, var(--error-color) 100%);
}

/* Simple Timeline Info for Legacy Jobs */
.simple-timeline-info {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.simple-timeline-info h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.simple-timeline-info p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.simple-timeline-info strong {
    color: var(--text-color);
    font-weight: 600;
}

.simple-timeline-info em {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
}

/* Authentication Section */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    color: var(--text-color);
    padding: 2rem 0;
}

.auth-container {
    background: var(--surface-color);
    background-image: var(--gradient-inner);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    margin: 3rem auto 0 auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-family: 'Righteous', cursive;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.auth-form {
    margin-bottom: 30px;
}

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

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.auth-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: var(--card-background);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.auth-form .form-control:hover {
    border-color: var(--accent-yellow);
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 204, 0.15);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 122, 204, 0.3);
}

.auth-help {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-help h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.auth-help ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.auth-help a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-help a:hover {
    text-decoration: underline;
}

/* User Status Bar */
.user-status-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 15px 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 122, 204, 0.3);
}

.user-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.user-type {
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
}

.user-remaining {
    font-size: 14px;
    opacity: 0.9;
}

.user-remaining.warning {
    color: var(--accent-yellow);
    font-weight: 600;
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-actions .btn {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 8px;
}

.user-actions .btn-link {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-actions .btn-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* User Info Modal */
.user-info-content {
    padding: 20px;
}

.user-info-grid {
    display: grid;
    gap: 15px;
}

.user-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.user-info-item label {
    font-weight: 600;
    color: #555;
    margin: 0;
}

.user-info-item span {
    color: #333;
}

/* Notification Controls in User Info Modal */
.notification-controls {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.notification-controls h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.notification-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.notification-setting label {
    font-weight: 500;
    color: #555;
    margin: 0;
}

.notification-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notification-enabled {
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
}

.notification-blocked {
    color: #dc3545;
    font-weight: 600;
    font-size: 0.9rem;
}

.notification-unsupported {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.notification-unsupported p {
    margin: 5px 0;
    color: #856404;
    font-size: 0.9rem;
}

.notification-unsupported p:last-child {
    margin-bottom: 0;
}

/* Token Management Modal */
.token-modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.token-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.token-management {
    padding: 20px;
    padding-bottom: 0;
}

.token-create-section {
    background: var(--card-background);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.token-create-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.token-list-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.token-list-section h4 {
    color: var(--text-color);
    margin-bottom: 15px;
    text-align: center;
    flex-shrink: 0;
}

.token-list {
    display: grid;
    gap: 8px;
    padding-bottom: 20px;
    overflow-y: auto;
    flex: 1;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    transition: all 0.2s ease;
    min-height: auto;
}

.token-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(255, 122, 204, 0.2);
}

.token-item.active {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.token-item.revoked {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
    opacity: 0.7;
}

.token-info {
    flex: 1;
    min-width: 0;
}

.token-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.token-value {
    font-family: 'Courier New', monospace;
    background: var(--surface-color);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-type {
    background: var(--primary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.token-status {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.token-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.token-status.revoked {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.token-details {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.token-usage, .token-jobs {
    background: var(--surface-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
}

.token-description {
    font-style: italic;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 2px;
    word-break: break-word;
}

.token-last-used {
    font-size: 11px;
    color: var(--text-secondary);
}

.token-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.no-tokens {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 30px;
}

.token-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

/* Token Management Form Styling */
.token-management .form-group {
    margin-bottom: 1rem;
}

.token-management .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.token-management input[type="text"],
.token-management input[type="number"],
.token-management select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--card-background);
    color: var(--text-color);
}

.token-management input[type="text"]:hover,
.token-management input[type="number"]:hover,
.token-management select:hover {
    border-color: var(--accent-yellow);
}

.token-management input[type="text"]:focus,
.token-management input[type="number"]:focus,
.token-management select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 204, 0.15);
}

.token-management select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.75rem;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.token-management .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.token-management .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.token-management .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.token-management .btn-danger {
    background: #dc3545;
    color: white;
}

.token-management .btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Form row specific adjustments */
.token-management .form-row .form-group {
    margin-bottom: 0;
}

/* Cookie Management Modal Styles */
.cookie-modal-content {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cookie-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.cookie-management {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cookie-status-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.cookie-status-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.cookie-status-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.cookie-status-info .status-indicator {
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-height: 60px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.cookie-status-info .status-indicator:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-status-info .status-indicator.active {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cookie-status-info .status-indicator.inactive {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cookie-status-info .status-indicator.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.last-updated {
    font-size: 0.85rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

.cookie-warning {
    margin-top: 12px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
}

.cookie-warning p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.cookie-warning p:last-child {
    margin-bottom: 0;
}

.cookie-update-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cookie-update-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.cookie-update-section .form-group {
    margin-bottom: 15px;
}

.cookie-update-section .form-group:last-child {
    margin-bottom: 0;
}

.cookie-update-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.cookie-update-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    resize: vertical;
    min-height: 120px;
    background: var(--card-background);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.cookie-update-section textarea:hover {
    border-color: var(--accent-yellow);
}

.cookie-update-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 204, 0.15);
}

.cookie-update-section .form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.cookie-update-section .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.cookie-update-section .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cookie-update-section .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.cookie-update-section .btn-secondary {
    background: #6c757d;
    color: white;
}

.cookie-update-section .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.cookie-update-section .btn-danger {
    background: #dc3545;
    color: white;
}

.cookie-update-section .btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.cookie-help-section {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #bbdefb;
}

.cookie-help-section h4 {
    color: #0d47a1;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.cookie-instructions {
    color: #1565c0;
    line-height: 1.5;
}

.cookie-instructions p {
    margin-bottom: 12px;
}

.cookie-instructions p:last-child {
    margin-bottom: 0;
}

.cookie-instructions strong {
    color: #0d47a1;
    font-weight: 600;
}

.cookie-instructions ol,
.cookie-instructions ul {
    margin: 10px 0 12px 20px;
    padding-left: 0;
}

.cookie-instructions li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.cookie-instructions a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

.cookie-instructions a:hover {
    text-decoration: underline;
}

.cookie-loading {
    text-align: center;
    color: #6c757d;
    padding: 40px;
    font-style: italic;
}

/* Delivery Message Template Modal Styles */
.delivery-template-modal-content {
    max-width: 900px;
    min-height: 600px;
}

.delivery-template-modal-content .modal-body {
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    padding: 30px;
}

.delivery-template-management {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.template-info-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
}

.template-info-section h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.template-info {
    color: var(--text-muted);
    line-height: 1.6;
}

.template-info p {
    margin: 0 0 15px 0;
}

.template-info ul {
    margin: 15px 0;
    padding-left: 20px;
}

.template-info li {
    margin: 8px 0;
}

.template-info code {
    background: rgba(255, 122, 204, 0.1);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.template-status {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 223, 107, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--accent-yellow);
}

.template-edit-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
}

.template-edit-section .form-group {
    margin-bottom: 25px;
}

.template-edit-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.template-textarea {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-background);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.template-textarea:hover {
    border-color: var(--primary-color);
}

.template-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 204, 0.1);
}

.template-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.template-actions .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.template-actions .btn-primary {
    background: var(--primary-color);
    color: white;
}

.template-actions .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 122, 204, 0.3);
}

.template-actions .btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.template-actions .btn-secondary:hover {
    background: #5a6acf;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.template-preview-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.template-preview-section h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.template-preview-content {
    background: var(--input-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.delivery-template-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.delivery-template-loading::before {
    content: "🔄";
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Instrumental Selection Modal Specific Styles */
.instrumental-modal-content {
    max-width: 900px;
    width: 90vw;
    max-height: 95vh;
    min-height: 60vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.instrumental-modal-content .modal-header {
    flex-shrink: 0;
    padding: 1.5rem 2rem 1rem 2rem;
}

.instrumental-modal-content .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 2rem 2rem 2rem;
}

.instrumental-selection-subtitle {
    margin-bottom: 0;
    flex-shrink: 0;
}

.instrumental-selection-subtitle .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

.instrumental-selection-content {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 1rem 0.5rem 0.5rem 0.5rem;
}

.instrumental-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.instrumental-options {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0.25rem;
}

.instrumental-option {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    background: var(--card-background);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    margin-bottom: 1rem;
}

.instrumental-option:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 122, 204, 0.15);
}

.instrumental-option.selected {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}



.instrumental-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.instrumental-title {
    flex: 1;
    min-width: 0;
}

.instrumental-type {
    font-family: 'Righteous', cursive;
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.instrumental-filename {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
    line-height: 1.4;
    background: rgba(176, 184, 193, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 0.25rem;
}

.instrumental-controls {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    align-items: center;
}

.instrumental-description {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.instrumental-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}

.instrumental-size {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--surface-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.instrumental-selection-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0 0 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    flex-shrink: 0;
    background: var(--surface-color);
}

#confirm-instrumental-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-preview-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex-shrink: 0;
}

.audio-preview-player {
    width: 220px;
    height: 32px;
    border-radius: 6px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
}

.no-instrumentals {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-style: italic;
}

/* Instrumental Selection Button */
.instrumental-selection-control {
    margin-left: 12px;
    display: flex;
    align-items: center;
}

.btn-select-instrumental {
    background: linear-gradient(135deg, var(--primary-color) 0%, #e91e63 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
}

.btn-select-instrumental:hover {
    background: linear-gradient(135deg, #e91e63 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 122, 204, 0.4);
}

.btn-select-instrumental.selected {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-select-instrumental.selected:hover {
    background: linear-gradient(135deg, #059669 0%, var(--success-color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .auth-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .user-status-bar {
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0;
    }
    
    /* Notification controls responsive */
    .notification-setting {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    
    .notification-actions {
        width: 100%;
        justify-content: center;
    }
    
    .notification-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .notification-controls h4 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .token-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .token-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .token-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .admin-panel {
        bottom: 10px;
        right: 10px;
    }
    
    .admin-content {
        right: -50px;
        min-width: 200px;
    }
    
    .instrumental-modal-content {
        max-width: 95vw;
        width: 95vw;
        min-height: 50vh;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .instrumental-modal-content .modal-header {
        padding: 1rem 1.5rem 0.75rem 1.5rem;
    }
    
    .instrumental-modal-content .modal-body {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
    
    .instrumental-option {
        padding: 1.25rem;
    }
    
    .instrumental-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .instrumental-controls {
        justify-content: flex-start;
        width: 100%;
    }
    
    .instrumental-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .instrumental-selection-actions {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0 0 0;
    }
    
    .instrumental-selection-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .audio-preview-player {
        width: 100%;
        max-width: 300px;
    }
    
    .cookie-modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .cookie-management {
        padding: 15px;
        gap: 15px;
    }
    
    .cookie-status-section,
    .cookie-update-section,
    .cookie-help-section {
        padding: 12px;
    }
    
    .cookie-update-section .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .cookie-update-section .btn {
        width: 100%;
        text-align: center;
    }
    
    .cookie-instructions ol,
    .cookie-instructions ul {
        margin-left: 15px;
    }

    .delivery-template-modal-content {
        max-width: 95vw;
        min-height: auto;
    }

    .delivery-template-modal-content .modal-body {
        padding: 20px;
        max-height: calc(90vh - 80px);
    }

    .delivery-template-management {
        gap: 20px;
    }

    .template-info-section,
    .template-edit-section,
    .template-preview-section {
        padding: 20px;
    }

    .template-textarea {
        min-height: 300px;
        font-size: 13px;
    }

    .template-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .template-actions .btn {
        padding: 15px;
        text-align: center;
    }

    .template-info-section h4 {
        font-size: 1.2rem;
    }
}

/* YouTube Metadata Auto-Population Styles */
.loading-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 0.5rem;
}

.metadata-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.75rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    min-width: 180px;
}

.metadata-status {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metadata-status.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.metadata-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.youtube-url-mode .name-fields-row {
    margin-top: 1rem;
}

.youtube-url-mode .form-group small {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Enhanced input styling for auto-populated fields */
.youtube-url-mode input[placeholder*="auto-populated"],
.youtube-url-mode input[placeholder*="Auto-extracted"] {
    border-color: var(--success-color);
    background: linear-gradient(135deg, var(--card-background) 0%, var(--surface-color) 100%);
}

.youtube-url-mode input[placeholder*="auto-populated"]:focus,
.youtube-url-mode input[placeholder*="Auto-extracted"]:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25);
}

/* Disabled field styling for YouTube mode */
.youtube-url-mode input:disabled {
    background: linear-gradient(135deg, var(--card-background) 0%, var(--surface-color) 100%);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.youtube-url-mode input:disabled::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* Loading state styling */
.youtube-url-mode input[placeholder*="Extracting"] {
    background: linear-gradient(135deg, var(--card-background) 0%, var(--surface-color) 100%);
    border-color: var(--accent-yellow);
    animation: field-pulse 1.5s ease-in-out infinite;
}

@keyframes field-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Loading animation */
@keyframes metadata-pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.metadata-loading {
    animation: metadata-pulse 1.5s ease-in-out infinite;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .loading-status {
        flex-direction: column;
        gap: 0.5rem;
        min-height: auto;
    }
    
    .metadata-loading {
        min-width: auto;
        width: 100%;
    }
    
    .metadata-status {
        width: 100%;
        text-align: center;
    }
    
    .youtube-url-mode .name-fields-row {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Log Level Settings Styles */
.admin-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.log-level-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.log-level-settings {
    max-width: 600px;
}

.log-level-settings h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.log-level-info {
    background: rgba(102, 126, 234, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.log-level-info p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.log-level-info p:last-child {
    margin-bottom: 0;
}

.log-level-description {
    color: var(--text-muted);
    font-style: italic;
}

.log-level-controls {
    margin-bottom: 2rem;
}

.log-level-controls .form-group {
    margin-bottom: 1rem;
}

.log-level-controls label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.log-level-controls select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.log-level-controls select:hover {
    border-color: var(--accent-yellow);
}

.log-level-controls select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 204, 0.15);
}

.log-level-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.log-level-help {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
    margin-top: 1.5rem;
}

.log-level-help h5 {
    color: #334155;
    margin-bottom: 1rem;
    font-weight: 600;
}

.log-level-help ul {
    margin: 0 0 1rem 1.5rem;
    padding: 0;
}

.log-level-help li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    line-height: 1.5;
}

.log-level-help li strong {
    color: var(--primary-color);
    font-weight: 600;
}

.log-level-help p {
    margin: 0;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 768px) {
    .admin-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
    
    .log-level-section {
        margin-top: 1rem;
        padding: 1rem;
    }
    
    .log-level-settings h4 {
        font-size: 1.1rem;
    }
    
    .log-level-info {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .log-level-controls {
        margin-bottom: 1.5rem;
    }
    
    .log-level-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .log-level-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .log-level-controls select {
        max-width: 100%;
        padding: 0.625rem;
    }
    
    .log-level-help {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .log-level-help h5 {
        font-size: 1rem;
    }
}

/* Clone Job Modal */
.clone-job-modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

.clone-job-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.clone-source-info {
    background: var(--card-background);
    background-image: var(--gradient-inner);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.clone-source-info h4 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-weight: 600;
}

.clone-source-info p {
    margin: 5px 0;
    font-size: 0.95em;
    color: var(--text-color);
}

.clone-source-info p strong {
    color: var(--text-color);
    font-weight: 600;
}

.clone-options h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-weight: 600;
}

.clone-description {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.clone-phases {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.clone-phase-option {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--card-background);
}

.clone-phase-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(255, 122, 204, 0.2);
    transform: translateY(-1px);
}

.clone-phase-label {
    display: block;
    margin: 0;
    cursor: pointer;
    position: relative;
}

.clone-phase-label input[type="radio"] {
    position: absolute;
    left: 15px;
    top: 15px;
    margin: 0;
    accent-color: var(--primary-color);
}

.clone-phase-info {
    padding: 15px 15px 15px 45px;
    background: var(--card-background);
    transition: all 0.3s ease;
}

.clone-phase-label:hover .clone-phase-info {
    background: var(--hover-color);
}

.clone-phase-label input[type="radio"]:checked + .clone-phase-info {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 122, 204, 0.3);
}

.clone-phase-name {
    font-weight: bold;
    font-size: 1.05em;
    margin-bottom: 5px;
    color: var(--text-color);
}

.clone-phase-label input[type="radio"]:checked + .clone-phase-info .clone-phase-name {
    color: white;
}

.clone-phase-description {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.clone-phase-label input[type="radio"]:checked + .clone-phase-info .clone-phase-description {
    color: rgba(255, 255, 255, 0.9);
}

.clone-phase-badge {
    display: inline-block;
    background: var(--text-secondary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clone-phase-label input[type="radio"]:checked + .clone-phase-info .clone-phase-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.clone-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.clone-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.clone-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
}

.clone-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 122, 204, 0.3);
}

.clone-actions .btn-primary:disabled {
    background: var(--text-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clone-actions .btn-secondary {
    background: var(--card-background);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.clone-actions .btn-secondary:hover {
    background: var(--hover-color);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.no-clone-phases {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .clone-job-modal-content {
        max-width: 95vw;
        margin: 20px;
        width: 95vw;
    }
    
    .clone-job-info {
        gap: 20px;
    }
    
    .clone-source-info {
        padding: 12px;
    }
    
    .clone-source-info h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .clone-options h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .clone-description {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    .clone-phase-option {
        border-width: 1px;
    }
    
    .clone-phase-label input[type="radio"] {
        left: 10px;
        top: 12px;
    }
    
    .clone-phase-info {
        padding: 12px 12px 12px 35px;
    }
    
    .clone-phase-name {
        font-size: 1rem;
        margin-bottom: 4px;
    }
    
    .clone-phase-description {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .clone-phase-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .clone-actions {
        flex-direction: column;
        gap: 10px;
        padding-top: 12px;
        margin-top: 15px;
    }
    
    .clone-actions .btn {
        width: 100%;
        text-align: center;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .clone-actions .btn-primary:hover,
    .clone-actions .btn-secondary:hover {
        transform: none; /* Disable hover transforms on mobile */
    }
}

/* Log Filter Bar Styles */
.log-filter-bar {
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    padding: 12px 16px;
    font-size: 14px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.filter-label {
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 13px;
}

.filter-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    min-width: 120px;
    background: var(--card-background);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.filter-input:hover {
    border-color: var(--accent-yellow);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 122, 204, 0.15);
}

.filter-regex-btn {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-background);
    color: var(--text-color);
    font-size: 11px;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-regex-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

.filter-regex-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.filter-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.filter-clear-btn,
.filter-advanced-btn {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.filter-clear-btn:hover {
    background: var(--error-color);
    color: #fff;
    border-color: var(--error-color);
}

.filter-advanced-btn:hover {
    background: var(--hover-color);
}

.filter-advanced-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.advanced-filters-section {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 8px;
}

.filter-logic-group,
.filter-level-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-logic-select,
.filter-level-select {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    background: var(--card-background);
    color: var(--text-color);
    min-width: 120px;
    transition: all 0.2s ease;
}

.filter-logic-select:hover,
.filter-level-select:hover {
    border-color: var(--accent-yellow);
}

.filter-logic-select:focus,
.filter-level-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 122, 204, 0.15);
}

.filter-add-btn {
    padding: 6px 12px;
    border: 1px solid var(--success-color);
    border-radius: 4px;
    background: var(--card-background);
    color: var(--success-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.filter-add-btn:hover {
    background: var(--success-color);
    color: #fff;
}

.filter-stats {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
    margin-left: auto;
}

.additional-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border-top: 1px solid var(--border-color);
}

.additional-filter-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 12px;
    background: var(--card-background);
    color: var(--text-color);
}

.additional-filter-type {
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 12px;
    min-width: 80px;
    background: var(--card-background);
    color: var(--text-color);
}

.additional-filter-remove {
    padding: 4px 6px;
    border: 1px solid var(--error-color);
    border-radius: 3px;
    background: var(--card-background);
    color: var(--error-color);
    cursor: pointer;
    font-size: 12px;
}

.additional-filter-remove:hover {
    background: var(--error-color);
    color: #fff;
}

/* Filter highlight styles */
.log-entry.filtered-out {
    display: none !important;
}

.log-entry .filter-highlight {
    background-color: rgba(255, 223, 107, 0.3);
    color: var(--accent-yellow);
    padding: 0 2px;
    border-radius: 2px;
}

/* Responsive adjustments for filter bar */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .filter-actions {
        justify-content: center;
    }
    
    .filter-stats {
        margin-left: 0;
        text-align: center;
    }
}

/* YouTube Authentication Styles */
.youtube-auth-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-background);
    border-radius: 6px;
    border-left: 4px solid var(--error-color);
}

.youtube-auth-section h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
}

.youtube-auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-loading {
    color: #666;
    font-style: italic;
    font-size: 13px;
}

.youtube-auth-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.youtube-auth-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.youtube-auth-info.authenticated {
    color: var(--success-color);
}

.youtube-auth-info.not-authenticated {
    color: var(--text-muted);
}

.youtube-auth-info.error {
    color: var(--error-color);
}

.youtube-auth-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.youtube-auth-btn:hover {
    background: var(--secondary-color);
}

.youtube-auth-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.youtube-revoke-btn {
    background: var(--text-muted);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.youtube-revoke-btn:hover {
    background: var(--text-secondary);
}

/* YouTube Upload Confirmation Modal */
.youtube-upload-modal-content {
    max-width: 600px;
    width: 90vw;
}

.youtube-upload-content {
    padding: 1rem;
}

.upload-intro {
    margin-bottom: 1.5rem;
    text-align: center;
}

.upload-intro p {
    color: var(--text-color);
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.5;
}

.youtube-upload-modal-content .youtube-auth-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.youtube-upload-modal-content .youtube-auth-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.youtube-upload-modal-content .youtube-auth-info {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.youtube-upload-modal-content .youtube-auth-info.authenticated {
    color: var(--success-color);
}

.youtube-upload-modal-content .youtube-auth-info.not-authenticated {
    color: var(--warning-color);
}

.youtube-upload-modal-content .youtube-auth-info.error {
    color: var(--error-color);
}

.youtube-upload-modal-content .auth-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.upload-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    min-width: 200px;
    text-align: center;
}

@media (max-width: 768px) {
    .youtube-upload-modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .upload-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .upload-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Audio visualization styles for instrumental selection modal */
.visualization-mode-toggle {
    background: rgba(42, 49, 57, 0.9);
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

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

.mode-toggle-header h4 {
    margin: 0;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
}

.mode-toggle-buttons {
    display: flex;
    gap: 8px;
}

.mode-toggle-btn {
    padding: 8px 16px;
    border: 1px solid #4a5568;
    border-radius: 6px;
    background: rgba(30, 35, 44, 0.8);
    color: #cbd5e0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
}

.mode-toggle-btn:hover {
    background: rgba(255, 122, 204, 0.1);
    border-color: #ff7acc;
    color: #ff7acc;
}

.mode-toggle-btn.active {
    background: rgba(255, 122, 204, 0.2);
    border-color: #ff7acc;
    color: #ff7acc;
    font-weight: 600;
}

.mode-description {
    color: #a0aec0;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 8px;
}

.visualization-container {
    margin: 16px 0;
    background: rgba(30, 35, 44, 0.6);
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 12px;
}

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

.visualization-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.visualization-label {
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
}

.visualization-loading {
    color: #a0aec0;
    font-size: 11px;
    font-style: italic;
}

.visualization-display {
    position: relative;
    background: rgba(42, 49, 57, 0.8);
    border: 1px solid #4a5568;
    border-radius: 6px;
    overflow: hidden;
}

.visualization-image-container {
    position: relative;
    width: 100%;
    height: 200px; /* Main instrumental height */
    cursor: pointer;
}

.backing-vocals-viz .visualization-image-container {
    height: 150px; /* Backing vocals height */
}

.visualization-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 6px;
}

.playhead-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.playhead-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #ff7acc;
    border-radius: 1px;
    box-shadow: 0 0 4px rgba(255, 122, 204, 0.6);
    transition: left 0.1s ease;
}

.playhead-time {
    position: absolute;
    top: 4px;
    left: 0;
    background: rgba(255, 122, 204, 0.9);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    transform: translateX(-50%);
    min-width: 35px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.timeline-clicks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.timeline-clicks:hover {
    background: rgba(255, 122, 204, 0.05);
}

.backing-vocals-section {
    margin-top: 16px;
    padding: 12px;
    background: rgba(30, 35, 44, 0.4);
    border: 1px solid #4a5568;
    border-radius: 6px;
}

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

.backing-vocals-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.backing-vocals-info {
    color: #a0aec0;
    font-size: 11px;
    font-style: italic;
}

.backing-vocals-controls {
    display: flex;
    align-items: center;
}

.backing-vocals-player {
    width: 200px;
    height: 30px;
}

.audio-preview-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-preview-player {
    width: 250px;
    height: 32px;
    border-radius: 4px;
    background: rgba(30, 35, 44, 0.8);
    border: 1px solid #4a5568;
}

.audio-preview-player::-webkit-media-controls-panel {
    background-color: rgba(30, 35, 44, 0.9);
}

.audio-preview-player::-webkit-media-controls-play-button,
.audio-preview-player::-webkit-media-controls-pause-button {
    background-color: #ff7acc;
    border-radius: 50%;
}

.audio-preview-player::-webkit-media-controls-timeline {
    background-color: rgba(255, 122, 204, 0.2);
    border-radius: 2px;
}

.audio-preview-player::-webkit-media-controls-current-time-display,
.audio-preview-player::-webkit-media-controls-time-remaining-display {
    color: #e2e8f0;
    font-size: 10px;
}

.instrumental-option.selected .visualization-container {
    border-color: #ff7acc;
    background: rgba(255, 122, 204, 0.1);
}

.instrumental-option.selected .visualization-display {
    border-color: #ff7acc;
    box-shadow: 0 0 8px rgba(255, 122, 204, 0.3);
}

.instrumental-option.selected .backing-vocals-section {
    border-color: #ff7acc;
    background: rgba(255, 122, 204, 0.05);
}



/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .mode-toggle-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .mode-toggle-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .visualization-image-container {
        height: 120px;
    }
    
    .backing-vocals-viz .visualization-image-container {
        height: 100px;
    }
    
    .backing-vocals-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .audio-preview-player {
        width: 180px;
        height: 28px;
    }
    
    .backing-vocals-player {
        width: 160px;
        height: 28px;
    }
}

/* Loading states */
.visualization-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #a0aec0;
    font-size: 12px;
}

.backing-vocals-viz .visualization-loading {
    height: 150px;
}

/* Error states */
.visualization-loading[style*="color: #ef4444"] {
    color: #ef4444 !important;
}

/* Range Selection Controls for Backing Vocals */
.range-selection-controls {
    background-color: #2a3139;
    border: 1px solid #3a4149;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
}

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

.range-controls-label {
    font-weight: 600;
    color: var(--text-color);
}

.range-selection-info {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--success-color);
}

.selected-ranges-list {
    margin-top: 12px;
}

.ranges-header {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.ranges-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.range-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
}

.range-number {
    font-weight: 600;
    color: var(--error-color);
    min-width: 20px;
}

.range-times {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--success-color);
    min-width: 80px;
}

.range-percentage {
    color: var(--text-secondary);
    font-size: 12px;
    flex: 1;
}

.no-ranges {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 12px;
}

/* Range Selection Overlay */
.range-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.range-indicator {
    user-select: none;
}

.temp-range-indicator {
    user-select: none;
}

/* Custom Instrumental Section */
.custom-instrumental-section {
    background-color: rgba(255, 122, 204, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.custom-instrumental-header h4 {
    margin: 0 0 4px 0;
    color: var(--primary-color);
}

.custom-instrumental-header p {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.custom-instrumental-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.custom-instrumental-progress {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
}

.progress-message {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.progress-bar {
    background-color: var(--background-color);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background-color: var(--primary-color);
    height: 100%;
    border-radius: 4px;
    animation: progress-pulse 2s ease-in-out infinite;
    width: 100%;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Active range selection mode */
.btn.active {
    background-color: var(--error-color) !important;
    color: white !important;
    border-color: var(--error-color) !important;
}

/* Timeline in range selection mode */
.timeline-clicks.range-selection-active {
    cursor: crosshair;
}

/* Visualization Mode Toggle */
.visualization-mode-toggle {
    margin-bottom: 16px;
    padding: 12px;
    background-color: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.mode-toggle-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 16px;
}

.mode-toggle-buttons {
    display: flex;
    gap: 8px;
}

.mode-toggle-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.mode-toggle-btn:hover {
    background-color: var(--hover-color);
    border-color: var(--text-secondary);
}

.mode-toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mode-description {
    color: var(--text-muted);
    font-size: 13px;
}

/* Range selection responsive design */
@media (max-width: 768px) {
    .range-controls-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .custom-instrumental-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .range-item {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .range-times {
        min-width: 60px;
        font-size: 12px;
    }
}

/* Highlight animation for job notifications */
@keyframes highlight-flash {
    0% { background-color: rgba(255, 122, 204, 0.2); }
    50% { background-color: rgba(255, 122, 204, 0.4); }
    100% { background-color: rgba(255, 122, 204, 0.2); }
}

/* Manual Status Update Preset Buttons */
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-small.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-small.btn-warning:hover {
    background-color: #e0a800;
}

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

.btn-small.btn-danger:hover {
    background-color: #c82333;
}

.btn-small.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-small.btn-success:hover {
    background-color: #218838;
}

.btn-small.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-small.btn-info:hover {
    background-color: #138496;
}

.btn-small i {
    font-size: 10px;
}

/* Responsive design for preset buttons */
@media (max-width: 768px) {
    .preset-buttons {
        gap: 6px;
    }
    
    .btn-small {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .btn-small i {
        font-size: 9px;
    }
}