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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2C4D24 0%, #1a3318 100%);
}

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-box h1 {
    font-size: 2rem;
    color: #2C4D24;
    margin-bottom: 10px;
}

.login-subtitle {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1rem;
}

.btn-google-login {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google-login:hover {
    border-color: #4285F4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.login-note {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #95a5a6;
}

.login-error {
    margin-top: 15px;
    color: #e74c3c;
    font-size: 0.9rem;
    min-height: 20px;
}

/* ===== APP CONTAINER - DASHBOARD LAYOUT ===== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #2C4D24 0%, #1a3318 100%);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.sidebar-header h1 {
    font-size: 1.3rem;
    color: white;
    font-weight: 700;
}

.sidebar-section {
    padding: 15px;
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
}

.sidebar-folder {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-folder:hover {
    background: rgba(255,255,255,0.15);
}

.sidebar-folder.active {
    background: #ED5734;
}

.sidebar-folder-icon {
    font-size: 1rem;
}

.sidebar-folder-name {
    flex: 1;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-folder-count {
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.sidebar-nav-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav-btn.active {
    background: #ED5734;
    color: white;
}

.nav-icon {
    font-size: 1.1rem;
}

.sidebar-user {
    margin-top: auto;
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user .user-name {
    display: block;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f5f5;
}

/* ===== EDITOR PANEL (Collapsible) ===== */
.editor-panel {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.editor-panel.collapsed {
    max-height: 0;
    border-bottom: none;
}

.editor-panel:not(.collapsed) {
    max-height: 450px;
}

.editor-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #ecf0f1;
    gap: 15px;
}

.editor-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

#script-title {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

#script-title:focus {
    border-color: #3498db;
}

.source-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.source-badge.source-cabin {
    background: #e8f5e9;
    color: #2e7d32;
}

.source-badge.source-xpress {
    background: #e3f2fd;
    color: #1565c0;
}

.source-badge.source-bn-audio {
    background: #f3e5f5;
    color: #7b1fa2;
}

.editor-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#script-type,
#script-folder {
    padding: 8px 12px;
    font-size: 0.85rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    background: #f8f9fa;
}

#script-type:focus,
#script-folder:focus {
    border-color: #3498db;
}

#script-editor-container {
    border: none;
    border-radius: 0;
    margin: 0 20px;
}

#script-editor {
    width: 100%;
    min-height: 180px;
    max-height: 220px;
    padding: 15px 0;
    font-size: 1.05rem;
    font-family: 'Georgia', serif;
    line-height: 1.7;
    outline: none;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#script-editor:empty:before {
    content: attr(data-placeholder);
    color: #95a5a6;
    pointer-events: none;
}

#script-editor[disabled] {
    background-color: #f5f5f5;
    color: #7f8c8d;
    cursor: not-allowed;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #ecf0f1;
}

.audio-clips-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.clips-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    font-weight: 500;
}

#clips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 100px;
}

.empty-clips-hint {
    color: #bdc3c7;
    font-size: 0.8rem;
    font-style: italic;
}

.stats-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.stats-inline strong {
    color: #2c3e50;
}

.stat-divider {
    color: #ddd;
}

.script-metadata {
    padding: 8px 20px;
    background: #fafafa;
    font-size: 0.8rem;
    color: #95a5a6;
    border-top: 1px solid #ecf0f1;
}

.metadata-item strong {
    color: #2c3e50;
}

.metadata-divider {
    margin: 0 10px;
    color: #ddd;
}

/* ===== LOCK BANNER ===== */
.lock-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #fef9e7;
    border-bottom: 2px solid #f1c40f;
    color: #9a7b0a;
    font-weight: 500;
    font-size: 0.9rem;
}

.lock-icon {
    font-size: 1rem;
}

/* ===== SCRIPTS TABLE VIEW ===== */
.view {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.view.active {
    display: flex;
}

.scripts-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.table-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.table-title h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
}

.scripts-count {
    font-size: 0.85rem;
    color: #95a5a6;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-group select {
    padding: 8px 12px;
    font-size: 0.85rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    outline: none;
}

.filter-group select:focus {
    border-color: #3498db;
}

.search-bar {
    position: relative;
}

.search-bar input {
    padding: 8px 32px 8px 12px;
    font-size: 0.85rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    width: 180px;
    transition: border-color 0.2s, width 0.2s;
}

.search-bar input:focus {
    border-color: #3498db;
    width: 220px;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    display: none;
}

.search-bar.has-value .search-clear-btn {
    display: block;
}

.search-clear-btn:hover {
    color: #e74c3c;
}

.scripts-table-container {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.scripts-table {
    width: 100%;
    border-collapse: collapse;
}

.scripts-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

.scripts-table th {
    padding: 12px 15px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
    border-bottom: 2px solid #e0e0e0;
}

.scripts-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.scripts-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s;
}

.scripts-table tbody tr:hover {
    background-color: #f8fbff;
}

.scripts-table tbody tr.active {
    background-color: #e8f4fc;
}

.scripts-table tbody tr.locked {
    opacity: 0.7;
}

.empty-row td {
    padding: 60px 20px;
    text-align: center;
    color: #95a5a6;
    font-style: italic;
}

.editing-by {
    font-size: 0.75rem;
    color: #95a5a6;
    font-weight: normal;
    margin-left: 8px;
}

.delete-btn,
.add-to-cast-btn-table {
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.script-row:hover .delete-btn,
.script-row:hover .add-to-cast-btn-table {
    opacity: 1;
}

.delete-btn:hover {
    color: #e74c3c;
    background: #fef0ef;
}

.add-to-cast-btn-table {
    font-weight: 700;
    font-size: 1rem;
}

.add-to-cast-btn-table:hover {
    color: #27ae60;
    background: #e8f5e9;
}

.col-title {
    width: 40%;
}

.col-source {
    width: 12%;
}

.col-type {
    width: 10%;
}

.col-duration {
    width: 10%;
}

.col-updated {
    width: 18%;
}

.col-actions {
    width: 10%;
    text-align: right;
}

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

.script-title-text {
    font-weight: 500;
    color: #2c3e50;
}

.lock-indicator {
    font-size: 0.85rem;
}

.source-badge-small {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.source-cabin {
    background: #e8f5e9;
    color: #2e7d32;
}

.source-xpress {
    background: #e3f2fd;
    color: #1565c0;
}

.source-bn-audio {
    background: #f3e5f5;
    color: #7b1fa2;
}

.type-badge-small {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
}

.type-script { background: #f3e8f7; color: #9b59b6; }
.type-clip { background: #e8f4fc; color: #3498db; }
.type-voicer { background: #fdf2e6; color: #e67e22; }

.duration-cell {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.updated-cell {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.action-btn {
    background: none;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    color: #bdc3c7;
    font-size: 1rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.scripts-table tbody tr:hover .action-btn {
    opacity: 1;
}

.action-btn:hover {
    color: #e74c3c;
    background: #fef0ef;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary {
    background-color: #27ae60;
    color: white;
}

.btn-primary:hover {
    background-color: #219a52;
}

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

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

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

.btn-present:hover {
    background-color: #c0392b;
}

/* ===== INLINE CLIPS ===== */
.inline-clip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: grab;
    user-select: none;
    margin: 2px 4px;
    vertical-align: middle;
}

.inline-clip:hover {
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.inline-clip.dragging {
    opacity: 0.5;
}

.inline-clip .clip-play-inline {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    padding-left: 1px;
}

.inline-clip .clip-play-inline:hover {
    background: rgba(255, 255, 255, 0.4);
}

.inline-clip .clip-duration {
    font-weight: 700;
}

.inline-clip .clip-out {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Clip pills in footer */
.audio-clip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 20px;
    cursor: grab;
    user-select: none;
    font-size: 0.8rem;
}

.audio-clip:hover {
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
}

.audio-clip.dragging {
    opacity: 0.5;
}

.audio-clip.in-editor {
    opacity: 0.5;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: default;
}

.clip-play-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    padding-left: 2px;
}

.clip-play-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.clip-play-btn.playing {
    background: #e74c3c;
}

.clip-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clip-duration {
    font-weight: 700;
}

.clip-out-words {
    font-size: 0.75rem;
    opacity: 0.9;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clip-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 2px;
}

.clip-delete-btn:hover {
    color: white;
}

.clip-status {
    font-size: 0.7rem;
    opacity: 0.7;
    font-style: italic;
}

/* Audio clip pills */
.audio-clip-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 16px;
    cursor: grab;
    user-select: none;
    font-size: 0.8rem;
}

.audio-clip-pill:hover {
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.audio-clip-pill.dragging {
    opacity: 0.5;
}

.audio-clip-pill.in-editor {
    opacity: 0.5;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: default;
}

/* ===== NEWSCASTS VIEW ===== */
#newscasts-view {
    flex-direction: row;
    gap: 20px;
    padding: 20px;
}

.newscast-builder {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.newscast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.newscast-title-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.newscast-title-area h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.newscast-datetime-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#newscast-date {
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    min-width: 140px;
}

#newscast-date:focus {
    border-color: #3498db;
}

.time-picker-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 500px;
}

.time-preset-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: monospace;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background: #f8f9fa;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.15s;
}

.time-preset-btn:hover {
    border-color: #3498db;
    background: #e8f4fd;
}

.time-preset-btn.active {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.time-preset-other {
    background: #ecf0f1;
    font-family: inherit;
}

.time-preset-other.active {
    background: #95a5a6;
    border-color: #95a5a6;
}

.time-preset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-preset-btn:disabled:hover {
    border-color: #e0e0e0;
    background: #f8f9fa;
}

.time-custom-input {
    padding: 6px 10px;
    font-size: 0.85rem;
    border: 2px solid #3498db;
    border-radius: 4px;
    outline: none;
    width: 90px;
}

.time-custom-input:focus {
    border-color: #2980b9;
}

.newscast-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.autosave-status {
    font-size: 0.8rem;
    color: #95a5a6;
    font-style: italic;
}

.autosave-status.saving {
    color: #3498db;
}

.autosave-status.saved {
    color: #27ae60;
}

.running-order-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    min-height: 300px;
}

.running-order-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.running-order-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #2c3e50;
}

.running-order-stats {
    flex: 1;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.running-order-stats strong {
    color: #2c3e50;
}

#running-order-container {
    min-height: 200px;
}

.empty-running-order {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

#running-order-container.drag-over {
    background: #e8f4fd;
    border: 2px dashed #3498db;
    border-radius: 6px;
}

.running-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    cursor: grab;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.running-order-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.running-order-item.dragging {
    opacity: 0.5;
}

.running-order-item.drag-over {
    border-color: #3498db;
    border-style: dashed;
}

.running-order-item.missing-script {
    background: #fde8e8;
    border-color: #e74c3c;
}

.ro-number {
    width: 28px;
    height: 28px;
    background: #ecf0f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #7f8c8d;
    flex-shrink: 0;
}

.ro-drag-handle {
    color: #bdc3c7;
    cursor: grab;
    font-size: 1.2rem;
}

.ro-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px 0;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.ro-info:hover {
    background: #e8f4fd;
}

.running-order-item.active {
    background: #e8f4fc;
    border-color: #3498db;
}

.running-order-item.active .ro-number {
    background: #3498db;
    color: white;
}

.ro-title {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ro-meta {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 3px;
}

.ro-duration {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.ro-delete-btn {
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
}

.ro-delete-btn:hover {
    color: #e74c3c;
}

/* Scripts Sidebar (in Newscasts view) */
.scripts-sidebar-section {
    width: 280px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
}

.scripts-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.scripts-sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #2c3e50;
}

.scripts-count-small {
    font-size: 0.75rem;
    color: #95a5a6;
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 10px;
}

.scripts-sidebar-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-script-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: grab;
    transition: background-color 0.15s, border-color 0.15s;
    border: 2px solid transparent;
}

.sidebar-script-item:hover {
    background: #e8f4fd;
    border-color: #3498db;
}

.sidebar-script-item.dragging {
    opacity: 0.5;
}

.sidebar-script-item.in-running-order {
    opacity: 0.5;
    background: #e8f5e9;
    border-color: #27ae60;
    cursor: default;
}

.sidebar-script-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.sidebar-script-title {
    font-weight: 500;
    font-size: 0.85rem;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-script-meta {
    font-size: 0.7rem;
    color: #95a5a6;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-script-duration {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sidebar-script-add-btn {
    background: none;
    border: none;
    color: #27ae60;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}

.sidebar-script-item:hover .sidebar-script-add-btn {
    opacity: 1;
}

.sidebar-script-add-btn:hover {
    background: #e8f5e9;
}

.sidebar-script-item.in-running-order .sidebar-script-add-btn {
    display: none;
}

.sidebar-empty {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding: 30px 10px;
    font-size: 0.85rem;
}

/* Keep newscast-item styles for the picker modal */
.newscast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.newscast-item:hover {
    background: #e8f4fd;
}

.newscast-item.active {
    background: #d4edfc;
}

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

.newscast-item-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.newscast-item-meta {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 3px;
}

.newscast-delete-btn {
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.newscast-item:hover .newscast-delete-btn {
    opacity: 1;
}

.newscast-delete-btn:hover {
    color: #e74c3c;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #95a5a6;
    cursor: pointer;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 15px 20px;
    overflow-y: auto;
    flex: 1;
}

.picker-scripts-list {
    max-height: 400px;
    overflow-y: auto;
}

.picker-script-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
}

.picker-script-item:hover {
    background: #e8f4fd;
}

.picker-script-info {
    flex: 1;
}

.picker-script-title {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 3px;
}

.picker-script-meta {
    font-size: 0.8rem;
    color: #95a5a6;
}

.picker-script-duration {
    font-weight: 600;
    color: #2c3e50;
}

.empty-picker {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding: 30px;
}

/* Newscast Picker Modal (Add to Cast) */
.newscast-picker-list {
    max-height: 350px;
    overflow-y: auto;
}

.newscast-picker-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    border: 2px solid transparent;
}

.newscast-picker-item:hover {
    background: #e8f4fd;
    border-color: #3498db;
}

.newscast-picker-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.newscast-picker-item.already-added {
    background: #e8f5e9;
    cursor: default;
    border-color: #27ae60;
}

.newscast-picker-item.already-added:hover {
    background: #e8f5e9;
}

.newscast-picker-info {
    flex: 1;
}

.newscast-picker-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.newscast-picker-meta {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-indicator {
    color: #27ae60;
    font-size: 1rem;
}

.already-text {
    color: #27ae60;
    font-style: italic;
    font-size: 0.75rem;
}

.newscast-picker-new {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

.newscast-picker-new .btn {
    width: 100%;
}

/* ===== PRESENTATION MODE ===== */
.present-mode {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    z-index: 2000;
    flex-direction: column;
}

.present-mode.active {
    display: flex;
}

.present-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background: #16213e;
    border-bottom: 2px solid #e74c3c;
}

.present-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.present-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #ecf0f1;
    font-size: 1rem;
}

.present-divider {
    color: #7f8c8d;
}

.present-exit-btn {
    padding: 10px 25px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.present-exit-btn:hover {
    background: #c0392b;
}

.present-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
    scroll-behavior: smooth;
}

.present-script {
    max-width: 900px;
    margin: 0 auto 60px auto;
    padding-bottom: 60px;
    border-bottom: 3px solid #e74c3c;
}

.present-script:last-child {
    border-bottom: none;
}

.present-script-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2d3748;
}

.present-script-number {
    width: 50px;
    height: 50px;
    background: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.present-script-title-area {
    flex: 1;
}

.present-script-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.present-script-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #95a5a6;
}

.present-script-duration {
    font-weight: 600;
    color: #27ae60;
}

.present-script-body {
    font-size: 1.4rem;
    line-height: 1.9;
    color: #ecf0f1;
    font-family: 'Georgia', serif;
    white-space: pre-wrap;
}

.present-inline-clip {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 16px;
    background: #16213e;
    border-radius: 6px;
    margin: 15px 0;
    border: 2px solid #3498db;
}

.present-inline-clip-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #3498db;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    padding-left: 3px;
}

.present-inline-clip-play:hover {
    background: #2980b9;
}

.present-inline-clip-play.playing {
    background: #e74c3c;
}

.present-inline-clip-info {
    flex: 1;
}

.present-inline-clip-label {
    font-size: 0.7rem;
    color: #3498db;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.present-inline-clip-duration {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-right: 15px;
}

.present-inline-clip-outwords {
    font-size: 1rem;
    color: #bdc3c7;
}

.present-inline-clip-outwords strong {
    color: #f1c40f;
}

.present-text-segment {
    white-space: pre-wrap;
}

.present-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background: #16213e;
    border-top: 2px solid #2d3748;
}

.present-nav-btn {
    padding: 15px 40px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.present-nav-btn:hover {
    background: #2980b9;
}

.present-nav-btn:disabled {
    background: #2d3748;
    color: #7f8c8d;
    cursor: not-allowed;
}

.present-current-info {
    text-align: center;
    color: white;
}

.present-current-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.present-current-duration {
    color: #27ae60;
}

/* Recording Controls */
.present-recording-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.present-record-btn {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.present-record-btn:hover {
    background: #c0392b;
}

.present-record-btn.recording {
    background: #27ae60;
    animation: pulse-record 1.5s infinite;
}

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

.present-record-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e74c3c;
    display: none;
}

.present-record-indicator.active {
    display: block;
    animation: blink-record 1s infinite;
}

@keyframes blink-record {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.present-record-timer {
    font-size: 1rem;
    font-weight: 600;
    color: #ecf0f1;
    font-family: monospace;
    min-width: 50px;
    display: none;
}

.present-record-timer.active {
    display: block;
}

.present-recording-preview {
    display: none;
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #16213e;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    z-index: 100;
}

.present-recording-preview.active {
    display: block;
}

.recording-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.recording-preview-label {
    font-size: 1rem;
    font-weight: 600;
    color: #27ae60;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.present-recording-preview audio {
    width: 300px;
}

.recording-preview-actions {
    display: flex;
    gap: 10px;
}

/* ===== STATUS BADGES (for script picker) ===== */
.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.status-ready { background: #27ae60; color: white; }
.status-badge.status-for-edit { background: #f1c40f; color: #7d6608; }
.status-badge.status-do-not-air { background: #e74c3c; color: white; }

.type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #3498db;
    color: white;
}

.type-badge.type-script { background: #9b59b6; }
.type-badge.type-clip { background: #3498db; }
.type-badge.type-voicer { background: #e67e22; }
.type-badge.type-other { background: #95a5a6; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-header h1,
    .sidebar-section-title,
    .sidebar-folder-name,
    .sidebar-folder-count,
    .sidebar-nav-btn span:not(.nav-icon),
    .sidebar-user .user-name {
        display: none;
    }

    .sidebar-folder {
        justify-content: center;
        padding: 10px;
    }

    .sidebar-nav-btn {
        justify-content: center;
        padding: 12px;
    }

    .sidebar-user .btn {
        padding: 8px;
        font-size: 0;
    }

    .sidebar-user .btn::before {
        content: "↗";
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
    }

    .sidebar-header {
        padding: 0 10px;
        border: none;
    }

    .sidebar-section {
        padding: 5px 10px;
    }

    .sidebar-nav {
        flex-direction: row;
    }

    .sidebar-user {
        margin-top: 0;
        border: none;
        padding: 5px 10px;
    }

    .main-content {
        height: calc(100vh - 80px);
    }

    .table-controls {
        flex-wrap: wrap;
    }

    #newscasts-view {
        flex-direction: column;
    }

    .newscasts-list-section {
        width: 100%;
        max-height: 200px;
    }

    .present-content {
        padding: 20px;
    }

    .present-script-body {
        font-size: 1.1rem;
    }

    .present-header,
    .present-footer {
        padding: 10px 15px;
    }

    .present-nav-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}
