/* ============================================
   PROMPT ENHANCER PAGE STYLES
   ============================================ */

/* Page Header */
.prompt-page-header {
    margin-bottom: 20px;
}

.prompt-page-header .page-title {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.prompt-page-header .page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Two-column layout - desktop */
.prompt-enhancer-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Cards */
.prompt-card-main,
.prompt-card-context {
    padding: 20px;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.optional-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--tc-glass-bg-hover);
    border-radius: var(--tc-radius-md);
    color: var(--text-muted);
    font-weight: normal;
}

/* Style pills for enhancement options */
.style-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-pill {
    display: inline-block;
    cursor: pointer;
}

.radio-pill input {
    display: none;
}

.radio-pill span {
    display: inline-block;
    padding: 8px 16px;
    background: var(--tc-glass-bg-input);
    border-radius: var(--tc-radius-xl);
    font-size: 0.85rem;
    transition: all 0.2s;
    border: var(--tc-glass-border);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.radio-pill input:checked + span {
    background: var(--primary);
    color: white;
}

/* Enhance button - full width only on prompt enhancer page */
.prompt-card-main .btn-enhance,
#page-prompt .btn-enhance:not(.prompt-header .btn-enhance) {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin: 16px 0;
}

/* Result header */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.btn-copy {
    padding: 6px 12px;
    background: var(--tc-glass-bg);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-sm);
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.result-textarea {
    background: var(--tc-glass-bg-input) !important;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

/* Context buttons */
.context-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.context-buttons .btn-secondary,
.context-buttons .btn-primary {
    flex: 1;
    padding: 12px;
}

/* File path display */
.file-path-display {
    padding: 10px 12px;
    background: var(--tc-glass-bg-input);
    border-radius: var(--tc-radius-md);
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 8px;
    border: var(--tc-glass-border);
}

/* OR divider */
.divider-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.divider-or::before,
.divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(148,163,184,0.08);
}

/* Folder input group */
.folder-input-group {
    display: flex;
    gap: 8px;
}

.folder-input-group input {
    flex: 1;
}

.folder-input-group .btn-secondary {
    flex-shrink: 0;
    padding: 12px 16px;
}

/* Analysis status */
.analysis-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--tc-radius-md);
    border: 1px solid rgba(168, 85, 247, 0.2);
    margin-top: 12px;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.analysis-status .status-text {
    flex: 1;
}

.analysis-status .status-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* File tree */
.file-tree {
    max-height: 200px;
    overflow-y: auto;
    background: var(--tc-glass-bg-input);
    border-radius: var(--tc-radius-md);
    padding: 12px;
    font-family: monospace;
    font-size: 0.75rem;
    margin-top: 12px;
    border: var(--tc-glass-border);
}

/* Project summary */
.project-summary {
    margin-top: 12px;
    padding: 12px;
    background: var(--tc-glass-bg-input);
    border-radius: var(--tc-radius-md);
    border: var(--tc-glass-border);
}

.project-summary .summary-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.project-summary .summary-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================
   PROMPT ENHANCER MOBILE STYLES
   ============================================ */
@media (max-width: 768px) {
    .prompt-page-header {
        text-align: center;
        padding: 0 12px;
        margin-bottom: 16px;
    }

    .prompt-page-header .page-title {
        font-size: 1.3rem;
    }

    .prompt-page-header .page-subtitle {
        font-size: 0.85rem;
    }

    /* Stack cards vertically, main card first */
    .prompt-enhancer-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 0;
    }

    .prompt-card-main {
        order: 1;
    }

    .prompt-card-context {
        order: 2;
    }

    .prompt-card-main,
    .prompt-card-context {
        padding: 16px;
        margin: 0;
        border-radius: var(--tc-radius-lg);
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    /* Style pills - 2x2 grid */
    .style-pills {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .radio-pill {
        display: block;
    }

    .radio-pill span {
        display: block;
        text-align: center;
        padding: 12px;
        font-size: 0.9rem;
    }

    /* Textareas */
    #originalPrompt {
        min-height: 100px;
    }

    #enhancedPrompt {
        min-height: 120px;
    }

    /* Enhance button */
    .btn-enhance {
        padding: 16px;
        font-size: 1.1rem;
    }

    /* Context buttons - stack */
    .context-buttons {
        flex-direction: column;
    }

    .context-buttons .btn-secondary,
    .context-buttons .btn-primary {
        width: 100%;
    }

    /* Folder input - stack */
    .folder-input-group {
        flex-direction: column;
    }

    .folder-input-group .btn-secondary {
        width: 100%;
    }

    /* Hide project context by default, show as collapsible */
    .prompt-card-context {
        background: var(--tc-glass-bg);
    }

    .prompt-card-context .card-title {
        cursor: pointer;
    }

    /* File tree smaller */
    .file-tree {
        max-height: 150px;
        font-size: 0.7rem;
    }

    /* History section */
    #page-prompt .card:last-child {
        margin-top: 16px !important;
    }
}

/* ============================================
   VOICEOVER PAGE MOBILE STYLES
   ============================================ */
@media (max-width: 768px) {
    /* Voiceover Hero */
    .voiceover-hero {
        flex-direction: column !important;
        padding: 20px 16px !important;
        text-align: center !important;
    }

    .voiceover-hero .hero-content {
        max-width: 100% !important;
    }

    .voiceover-hero .hero-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    .voiceover-hero .hero-title br {
        display: none;
    }

    .voiceover-hero .hero-subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 16px !important;
    }

    .voiceover-hero .btn-hero {
        width: 100% !important;
        padding: 14px !important;
    }

    .voiceover-hero .hero-visual {
        display: none !important;
    }

    /* Voice Type Tabs - horizontal scroll */
    .voice-type-tabs {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        padding: 12px 16px !important;
        scrollbar-width: none !important;
    }

    .voice-type-tabs::-webkit-scrollbar {
        display: none;
    }

    .voice-type-tab {
        flex-shrink: 0 !important;
        padding: 10px 16px !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        border-radius: var(--tc-radius-xl) !important;
    }

    /* Voice Explorer */
    .voice-explorer {
        padding: 16px !important;
    }

    .voice-explorer .section-title {
        font-size: 1.1rem !important;
        text-align: center !important;
        margin-bottom: 16px !important;
    }

    /* Voice Filters - stack vertically */
    .voice-filters {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .voice-filters .filter-item {
        width: 100% !important;
    }

    .voice-filters .filter-select {
        width: 100% !important;
        padding: 12px !important;
        font-size: 0.9rem !important;
    }

    .voice-filters .filter-spacer {
        display: none !important;
    }

    .voice-filters .btn-clone-voice {
        width: 100% !important;
        padding: 14px !important;
        justify-content: center !important;
    }

    /* Voice Cards - single column */
    .voice-cards {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        margin-top: 16px !important;
    }

    .voice-card {
        padding: 16px !important;
        border-radius: var(--tc-radius-lg) !important;
    }

    .voice-card .voice-avatar {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.5rem !important;
    }

    .voice-card .voice-info h4 {
        font-size: 1rem !important;
    }

    .voice-card .voice-info p {
        font-size: 0.85rem !important;
    }

    .voice-card .btn-preview {
        width: 44px !important;
        height: 44px !important;
        font-size: 1rem !important;
    }

    /* Music Page Hero */
    .music-hero {
        padding: 20px 16px !important;
        text-align: center !important;
    }

    .music-hero .hero-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    .music-hero .hero-title br {
        display: none;
    }

    .music-hero .hero-subtitle {
        font-size: 0.9rem !important;
    }

    .music-hero .hero-buttons {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .music-hero .btn-hero,
    .music-hero .btn-hero-outline {
        width: 100% !important;
        padding: 14px !important;
    }

    /* Brand Logos - hide on mobile */
    .brand-logos {
        display: none !important;
    }

    /* Music Filters - horizontal scroll */
    .music-filters {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        padding: 12px 16px !important;
        scrollbar-width: none !important;
    }

    .music-filters::-webkit-scrollbar {
        display: none;
    }

    .music-filters .filter-select,
    .music-filters .filter-select-small {
        flex-shrink: 0 !important;
        padding: 10px 14px !important;
        font-size: 0.8rem !important;
    }

    .music-filters .filter-spacer {
        display: none !important;
    }

    .music-filters .filter-toggle {
        flex-shrink: 0 !important;
    }

    .music-filters .btn-filters {
        flex-shrink: 0 !important;
        padding: 10px 14px !important;
    }

    /* Track List */
    .track-list {
        padding: 0 12px !important;
    }

    .track-item {
        padding: 12px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .track-item .track-play {
        width: 40px !important;
        height: 40px !important;
    }

    .track-item .track-thumb {
        width: 40px !important;
        height: 40px !important;
    }

    .track-item .track-info {
        flex: 1 !important;
        min-width: 120px !important;
    }

    .track-item .track-info h4 {
        font-size: 0.9rem !important;
    }

    .track-item .track-info .track-artist {
        font-size: 0.75rem !important;
    }

    .track-item .track-genre,
    .track-item .track-duration {
        font-size: 0.7rem !important;
    }

    .track-item .track-waveform {
        display: none !important;
    }

    .track-item .track-actions {
        width: 100% !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        padding-top: 8px !important;
        border-top: var(--tc-glass-border) !important;
    }

    .track-item .track-actions button {
        width: 36px !important;
        height: 36px !important;
    }

    /* Audio player bar - fixed at bottom above nav */
    .audio-player-bar {
        bottom: calc(64px + env(safe-area-inset-bottom)) !important;
        padding: 8px 12px !important;
    }
}

/* ============================================
   VOICEOVER PAGE - FUNCTIONAL UI
   ============================================ */
.voiceover-page {
    padding: 20px;
}

.voiceover-header {
    margin-bottom: 24px;
}

.voiceover-header .page-title {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.voiceover-header .page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Two-column layout */
.voiceover-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Input card */
.voiceover-input-card {
    padding: 20px;
}

.voiceover-input-card .card-title {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text);
}

/* Upload area in voiceover */
.voiceover-input-card .upload-area {
    min-height: 180px;
    margin-bottom: 12px;
}

.voiceover-input-card .upload-preview {
    max-height: 200px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--tc-radius-md);
}

.btn-clear-avatar {
    margin-bottom: 16px;
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Voice settings grid */
.voice-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.voice-settings-grid .form-group {
    margin-bottom: 0;
}

.voice-settings-grid label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.voice-settings-grid select {
    width: 100%;
    padding: 10px;
    font-size: 0.85rem;
}

/* Generate button */
.btn-generate-avatar {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    font-size: 1rem;
}

/* Output section */
.voiceover-output {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.voiceover-progress-card,
.voiceover-result-card {
    padding: 20px;
}

.voiceover-progress-card .progress-bar-container {
    height: 8px;
    background: var(--tc-glass-bg-input);
    border-radius: var(--tc-radius-sm);
    overflow: hidden;
    margin: 12px 0;
}

.voiceover-progress-card .progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.voiceover-progress-card .progress-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Result video */
.voiceover-result-card .result-video {
    width: 100%;
    max-height: 300px;
    border-radius: var(--tc-radius-md);
    background: #000;
    margin-bottom: 12px;
}

.voiceover-result-card .result-actions {
    display: flex;
    gap: 10px;
}

.voiceover-result-card .result-actions .btn-primary,
.voiceover-result-card .result-actions .btn-secondary {
    flex: 1;
    padding: 12px;
    text-align: center;
    text-decoration: none;
}

/* Help card */
.voiceover-help-card {
    padding: 16px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--tc-radius-md);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.voiceover-help-card h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.voiceover-help-card ul {
    margin: 0;
    padding-left: 20px;
}

.voiceover-help-card li {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Mobile voiceover */
@media (max-width: 768px) {
    .voiceover-page {
        padding: 16px 12px;
    }

    .voiceover-header {
        text-align: center;
        margin-bottom: 16px;
    }

    .voiceover-header .page-title {
        font-size: 1.3rem;
    }

    .voiceover-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .voiceover-input-card {
        padding: 16px;
    }

    .voiceover-input-card .upload-area {
        min-height: 150px;
    }

    /* Voice settings - stack on mobile */
    .voice-settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .voice-settings-grid select {
        padding: 12px;
        font-size: 16px;
    }

    .btn-generate-avatar {
        padding: 16px;
        font-size: 1.1rem;
    }

    .voiceover-output {
        gap: 12px;
    }

    .voiceover-result-card .result-actions {
        flex-direction: column;
    }

    .voiceover-help-card {
        display: none; /* Hide tips on mobile to save space */
    }
}

/* ============================================
   NARRATION/TTS PAGE STYLES
   ============================================ */
.narrate-page {
    padding: 20px;
}

.narrate-header {
    margin-bottom: 24px;
}

.narrate-header .page-title {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.narrate-header .page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Two-column layout */
.narrate-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Main card */
.narrate-main-card {
    padding: 20px;
}

.narrate-textarea {
    min-height: 150px;
    resize: vertical;
}

.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Settings grid */
.narrate-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.narrate-settings-grid label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.narrate-settings-grid select {
    width: 100%;
    padding: 10px;
}

/* Buttons */
.btn-preview-voice {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
}

.btn-generate-narrate {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

/* Status */
.narrate-status {
    margin-top: 12px;
    padding: 12px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--tc-radius-md);
    text-align: center;
    color: var(--text-muted);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

/* Output section */
.narrate-output {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.narrate-result-card {
    padding: 20px;
}

.narrate-player {
    margin-bottom: 16px;
}

.narrate-audio {
    width: 100%;
    border-radius: var(--tc-radius-md);
}

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

.narrate-actions button {
    flex: 1;
    padding: 12px;
}

/* Tips card */
.narrate-tips-card {
    padding: 16px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--tc-radius-md);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.narrate-tips-card h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.narrate-tips-card ul {
    margin: 0;
    padding-left: 20px;
}

.narrate-tips-card li {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Mobile narration */
@media (max-width: 768px) {
    .narrate-page {
        padding: 16px 12px;
    }

    .narrate-header {
        text-align: center;
        margin-bottom: 16px;
    }

    .narrate-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .narrate-main-card {
        padding: 16px;
    }

    .narrate-settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .narrate-settings-grid select {
        padding: 12px;
        font-size: 16px;
    }

    .btn-generate-narrate {
        padding: 16px;
        font-size: 1.1rem;
    }

    .narrate-actions {
        flex-direction: column;
    }

    .narrate-tips-card {
        display: none;
    }
}

/* ============================================
   SCENE PLAYBOOK & DIALOGUE STYLES
   ============================================ */

/* Narrative Mode Toggle */
.mode-toggle .mode-btn {
    padding: 8px 16px;
    border-radius: var(--tc-radius-sm);
    border: var(--tc-glass-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}

.mode-toggle .mode-btn:hover {
    background: var(--tc-glass-bg);
    color: var(--text);
}

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

/* Script Import Section */
.script-import-section {
    background: rgba(37,99,235,0.15);
    padding: 12px;
    border-radius: var(--tc-radius-md);
    margin-bottom: 15px;
    border: 1px solid rgba(37,99,235,0.3);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

/* Scene Sets Panel */
.scene-sets-panel {
    background: rgba(16,185,129,0.10);
    padding: 12px;
    border-radius: var(--tc-radius-md);
    margin-bottom: 12px;
    border: 1px solid rgba(16,185,129,0.25);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

/* Scene Voice Settings */
.scene-voice-settings {
    background: rgba(124,58,237,0.15);
    padding: 12px;
    border-radius: var(--tc-radius-md);
    margin-bottom: 15px;
    border: 1px solid rgba(124,58,237,0.3);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

/* Scene Entry */
.scene-entry {
    background: var(--tc-glass-bg-input);
    padding: 12px;
    border-radius: var(--tc-radius-md);
    margin-bottom: 10px;
    border: var(--tc-glass-border);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.scene-entry:hover {
    border-color: rgba(124,58,237,0.4);
}

.scene-entry textarea {
    width: 100%;
    background: var(--tc-glass-bg-input);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-sm);
    color: var(--text);
    padding: 8px;
    font-size: 0.9em;
    resize: vertical;
}

.scene-entry textarea:focus {
    border-color: var(--primary);
    outline: none;
}

/* Scene Dialogue Section */
.scene-dialogue-section {
    margin-top: 8px;
    padding: 10px;
    background: rgba(167,139,250,0.1);
    border-radius: var(--tc-radius-sm);
    border-left: 3px solid #7c3aed;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

/* Character Dialogue Section */
.dialogue-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: var(--tc-glass-border);
}

.dialogue-section textarea {
    width: 100%;
    background: var(--tc-glass-bg-input);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-sm);
    color: var(--text);
    padding: 10px;
    font-size: 0.9em;
}

.dialogue-options {
    margin-top: 12px;
    padding: 12px;
    background: rgba(124,58,237,0.1);
    border-radius: var(--tc-radius-md);
    border: 1px solid rgba(124,58,237,0.2);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.voice-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.voice-option label {
    font-size: 0.8em;
    color: var(--text-muted);
}

.voice-option select {
    background: var(--tc-glass-bg-input);
    border: var(--tc-glass-border);
    color: var(--text);
    border-radius: var(--tc-radius-sm);
}

/* Audio Options Section */
.audio-options-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(37,99,235,0.1);
    border-radius: var(--tc-radius-md);
    border: 1px solid rgba(37,99,235,0.2);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.audio-option-row {
    margin-bottom: 8px;
}

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

/* Mobile responsiveness for playbook */
@media (max-width: 768px) {
    .mode-toggle {
        flex-wrap: wrap;
    }

    .mode-toggle .mode-btn {
        flex: 1;
        min-width: 120px;
    }

    .scene-voice-settings > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .dialogue-voice-row {
        flex-direction: column;
        gap: 10px !important;
    }

    .audio-option-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
}

/* User Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.settings-panel {
    background: var(--tc-glass-bg);
    border-radius: var(--tc-radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: var(--tc-glass-border);
    backdrop-filter: blur(var(--tc-glass-blur-heavy));
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: var(--tc-glass-border);
}

.settings-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.settings-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.settings-close-btn:hover {
    color: #fff;
}

.settings-content {
    padding: 24px;
}

.settings-section h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #fff;
}

.settings-hint {
    color: var(--text-muted, #94a3b8);
    font-size: 0.85rem;
    margin: 0 0 20px;
}

/* Theme color swatches inside settings panel */
.theme-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s;
    flex-shrink: 0;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.4); }

.api-key-group {
    margin-bottom: 16px;
}

.api-key-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #fff;
}

.api-key-input-row {
    display: flex;
    gap: 8px;
}

.api-key-input-row input {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--tc-radius-md);
    border: var(--tc-glass-border);
    background: var(--tc-glass-bg-input);
    color: #fff;
    font-size: 0.9rem;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.api-key-input-row input:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.api-key-input-row input::placeholder {
    color: var(--text-muted, #94a3b8);
}

.btn-show-key {
    padding: 10px 14px;
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-md);
    background: var(--tc-glass-bg-input);
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.btn-show-key:hover {
    background: var(--tc-glass-bg-hover);
    color: #fff;
}

.api-key-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-top: 4px;
}

.settings-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: var(--tc-glass-border);
}

.settings-actions .btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border: none;
    border-radius: var(--tc-radius-md);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.settings-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Settings gear icon in sidebar */
.settings-gear {
    margin-left: auto;
    opacity: 0.4;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.user-info-compact:hover .settings-gear {
    opacity: 1;
}

.user-info-compact {
    padding: 10px 12px;
    margin: -10px -12px;
    cursor: pointer !important;
}

.user-info-compact:hover {
    background: var(--tc-glass-bg-hover);
    border-radius: var(--tc-radius-md);
}

/* Mobile responsiveness for settings */
@media (max-width: 480px) {
    .settings-panel {
        width: 95%;
        max-height: 95vh;
        border-radius: var(--tc-radius-lg);
    }

    .settings-header {
        padding: 16px 20px;
    }

    .settings-content {
        padding: 20px;
    }
}

/* ============================================
   VOICEOVER SECTION MOBILE
   ============================================ */

/* Voiceover inline content */
.voiceover-inline-content {
    padding: 10px 0;
}

/* Tablets and medium screens */
@media (max-width: 768px) {
    .voiceover-settings-row {
        flex-wrap: wrap;
    }

    .voiceover-settings-row .form-group {
        min-width: 45% !important;
    }

    .mode-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mode-tab {
        padding: 8px 12px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .voiceover-settings-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .voiceover-settings-row .form-group {
        width: 100% !important;
        min-width: auto !important;
    }

    .mode-tabs {
        width: 100%;
        margin-left: 0;
    }

    .mode-tab {
        flex: 1;
        text-align: center;
        min-width: 80px;
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .mode-tab {
        padding: 10px 14px;
    }

    .btn-clear-image {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* ============================================
   ENHANCE PROGRESS OVERLAY
   ============================================ */
.enhance-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    border-radius: var(--tc-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(var(--tc-glass-blur));
}

.enhance-progress-content {
    text-align: center;
    padding: 20px;
}

.enhance-progress-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(168, 85, 247, 0.3);
    border-top-color: #a855f7;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: enhance-spin 1s linear infinite;
}

@keyframes enhance-spin {
    to { transform: rotate(360deg); }
}

.enhance-progress-text {
    color: #f1f5f9;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
}

.enhance-progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(168, 85, 247, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.enhance-progress-bar-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #a855f7, #8b5cf6);
    border-radius: 2px;
    animation: enhance-progress 1.5s ease-in-out infinite;
}

@keyframes enhance-progress {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}

.enhance-success-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 24px;
    color: white;
    animation: enhance-pop 0.3s ease-out;
}

@keyframes enhance-pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.enhance-progress-content.enhance-success .enhance-progress-text {
    color: #10b981;
    font-weight: 600;
}

/* ============================================
   PASTE MODAL - For clipboard paste on HTTP
   ============================================ */

.paste-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.paste-modal {
    background: var(--tc-glass-bg);
    border-radius: var(--tc-radius-lg);
    padding: 30px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    position: relative;
    border: var(--tc-glass-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(var(--tc-glass-blur-heavy));
}

.paste-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.paste-modal-close:hover {
    color: var(--text);
}

.paste-modal-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.paste-modal h3 {
    color: var(--text);
    margin: 0 0 10px 0;
    font-size: 20px;
}

.paste-modal p {
    color: var(--text-muted);
    margin: 0 0 20px 0;
}

.paste-modal kbd {
    background: var(--tc-glass-bg-input);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-sm);
    padding: 4px 8px;
    font-family: monospace;
    color: var(--text);
    font-size: 13px;
}

.paste-capture-area {
    width: 100%;
    height: 120px;
    background: var(--tc-glass-bg-input);
    border: 2px dashed var(--primary);
    border-radius: var(--tc-radius-md);
    color: var(--text-muted);
    resize: none;
    padding: 15px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}

.paste-capture-area:focus {
    outline: none;
    border-color: #9f7aea;
    background: var(--bg);
    color: var(--text);
}

.paste-capture-area::placeholder {
    color: var(--text-muted);
}

/* ============================================
   WATERMARK REMOVAL STYLES
   ============================================ */

/* Watermark canvas wrapper */
.watermark-canvas-wrapper {
    position: relative;
    display: inline-block;
}

.watermark-mask-canvas {
    position: absolute;
    top: 0;
    left: 0;
    touch-action: none;
    z-index: 10;
}

/* Watermark upload area */
#watermarkUploadArea {
    border: 2px dashed rgba(148,163,184,0.08);
    border-radius: var(--tc-radius-lg);
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--tc-glass-bg-input);
    cursor: pointer;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

#watermarkUploadArea:hover,
#watermarkUploadArea.dragover {
    border-color: var(--primary);
    background: rgba(168, 85, 247, 0.1);
}

#watermarkPreviewContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Watermark mode buttons */
#watermarkArea .mode-btn {
    flex: 1;
    max-width: 200px;
}

/* Comparison slider */
.comparison-slider {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.comparison-before,
.comparison-after {
    position: relative;
    max-width: 300px;
}

.comparison-before img,
.comparison-after img {
    width: 100%;
    border-radius: var(--tc-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comparison-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: var(--tc-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

/* Watermark result area */
#watermarkResult .comparison-after .comparison-label {
    background: rgba(0, 255, 136, 0.8);
}

/* Brush size slider */
#watermarkBrushSize {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--tc-glass-bg-input);
    border-radius: 3px;
    outline: none;
}

#watermarkBrushSize::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

#watermarkBrushSize::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ============================================
   TIPS/NOTES STYLES
   ============================================ */

/* Tips sidebar section */
.tips-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 5px 0;
}

.tip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 4px 8px;
    background: var(--tc-glass-bg);
    border-radius: var(--tc-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: var(--tc-glass-border-subtle);
}

.tip-item:hover {
    background: var(--tc-glass-bg-hover);
    border: var(--tc-glass-border-hover);
}

.tip-item-title {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.tip-item-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tips-empty {
    padding: 15px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

/* Tip Modal Styles */
.tip-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tip-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tip-modal-content {
    background: var(--tc-glass-bg);
    border-radius: var(--tc-radius-xl);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: var(--tc-glass-border);
    backdrop-filter: blur(var(--tc-glass-blur-heavy));
}

.tip-modal-overlay.active .tip-modal-content {
    transform: scale(1);
}

.tip-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: var(--tc-glass-border);
    background: var(--tc-glass-bg-sidebar);
}

.tip-modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text);
}

.tip-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s ease;
}

.tip-modal-close:hover {
    color: var(--danger);
}

.tip-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.tip-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: var(--tc-glass-border);
    background: var(--tc-glass-bg-sidebar);
}

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

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

.tip-form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--tc-glass-bg-input);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-md);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.tip-form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* Tip Modal specific overrides */
.tip-modal-content .form-group label {
    color: #ffffff !important;
    font-weight: 600;
}

.tip-modal-content .form-input,
.tip-modal-content .form-textarea {
    background: var(--tc-glass-bg-input);
    border: var(--tc-glass-border);
    color: #ffffff;
}

/* EasyMDE Customizations */
.EasyMDEContainer {
    border-radius: var(--tc-radius-md);
    overflow: hidden;
}

.EasyMDEContainer .CodeMirror {
    background: var(--tc-glass-bg-input) !important;
    color: var(--text) !important;
    border: var(--tc-glass-border) !important;
    border-radius: 0 0 var(--tc-radius-md) var(--tc-radius-md) !important;
    min-height: 300px;
}

.EasyMDEContainer .CodeMirror-cursor {
    border-left: 2px solid var(--primary) !important;
}

.EasyMDEContainer .CodeMirror-selected {
    background: rgba(168, 85, 247, 0.3) !important;
}

.EasyMDEContainer .CodeMirror-linenumber {
    color: var(--text-secondary) !important;
}

.EasyMDEContainer .CodeMirror-gutters {
    background: var(--tc-glass-bg-sidebar) !important;
    border-right: var(--tc-glass-border) !important;
}

.EasyMDEContainer .editor-toolbar {
    background: var(--tc-glass-bg-sidebar) !important;
    border: var(--tc-glass-border) !important;
    border-bottom: none !important;
    border-radius: var(--tc-radius-md) var(--tc-radius-md) 0 0 !important;
    padding: 8px !important;
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.EasyMDEContainer .editor-toolbar button {
    color: #ffffff !important;
    border: none !important;
    background: transparent !important;
    border-radius: var(--tc-radius-sm) !important;
    transition: background 0.2s ease !important;
}

.EasyMDEContainer .editor-toolbar button i,
.EasyMDEContainer .editor-toolbar button::before {
    color: #ffffff !important;
}

.EasyMDEContainer .editor-toolbar a {
    color: #ffffff !important;
}

.EasyMDEContainer .editor-toolbar button:hover {
    background: var(--tc-glass-bg-hover) !important;
}

.EasyMDEContainer .editor-toolbar button.active {
    background: var(--primary) !important;
    color: white !important;
}

.EasyMDEContainer .editor-toolbar i.separator {
    border-left: 1px solid rgba(148,163,184,0.08) !important;
    margin: 0 8px !important;
}

.EasyMDEContainer .editor-statusbar {
    background: var(--tc-glass-bg-sidebar) !important;
    color: var(--text-secondary) !important;
    border-top: var(--tc-glass-border) !important;
    padding: 8px 12px !important;
}

.EasyMDEContainer .editor-preview {
    background: var(--tc-glass-bg-input) !important;
    color: var(--text) !important;
}

.EasyMDEContainer .editor-preview-side {
    background: var(--tc-glass-bg-input) !important;
    color: var(--text) !important;
    border: var(--tc-glass-border) !important;
}

/* Markdown Content Rendering */
.markdown-content {
    line-height: 1.7;
    color: var(--text);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text);
    font-weight: 600;
}

.markdown-content h1 { font-size: 2rem; border-bottom: var(--tc-glass-border); padding-bottom: 8px; }
.markdown-content h2 { font-size: 1.5rem; border-bottom: var(--tc-glass-border); padding-bottom: 6px; }
.markdown-content h3 { font-size: 1.25rem; }
.markdown-content h4 { font-size: 1.1rem; }
.markdown-content h5 { font-size: 1rem; }
.markdown-content h6 { font-size: 0.9rem; color: var(--text-secondary); }

.markdown-content p {
    margin-bottom: 16px;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.markdown-content li {
    margin-bottom: 6px;
}

.markdown-content blockquote {
    margin: 16px 0;
    padding: 12px 20px;
    border-left: 4px solid var(--primary);
    background: var(--tc-glass-bg-input);
    border-radius: 0 var(--tc-radius-md) var(--tc-radius-md) 0;
    color: var(--text-secondary);
}

.markdown-content code {
    background: var(--tc-glass-bg-input);
    padding: 2px 6px;
    border-radius: var(--tc-radius-sm);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--accent);
}

.markdown-content pre {
    background: var(--tc-glass-bg-sidebar);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-md);
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text);
}

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

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content img {
    max-width: 100%;
    border-radius: var(--tc-radius-md);
    margin: 16px 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.markdown-content th,
.markdown-content td {
    border: var(--tc-glass-border);
    padding: 10px 12px;
    text-align: left;
}

.markdown-content th {
    background: var(--tc-glass-bg-sidebar);
    font-weight: 600;
}

.markdown-content tr:nth-child(even) {
    background: var(--tc-glass-bg-input);
}

.markdown-content hr {
    border: none;
    border-top: var(--tc-glass-border);
    margin: 24px 0;
}

/* Tip View Modal Specific */
.tip-view-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: var(--tc-glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tip-view-meta i {
    margin-right: 6px;
}

.tip-view-content {
    background: var(--tc-glass-bg-input);
    border-radius: var(--tc-radius-md);
    padding: 24px;
    min-height: 200px;
    border: var(--tc-glass-border);
}

.tip-view-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Export Dropdown */
.tip-export-dropdown {
    position: relative;
    display: inline-block;
}

.tip-export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tip-export-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--tc-glass-bg);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    padding: 8px 0;
    z-index: 1000;
    margin-bottom: 8px;
    backdrop-filter: blur(var(--tc-glass-blur-heavy));
}

.tip-export-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.tip-export-menu button:hover {
    background: var(--tc-glass-bg-hover);
}

.tip-export-menu button i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* Grammar Check Button */
.tip-grammar-btn {
    margin-left: auto;
}

.grammar-issues {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--tc-radius-md);
    backdrop-filter: blur(var(--tc-glass-blur-light));
}

.grammar-issue {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.grammar-issue:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.grammar-issue-text {
    color: var(--warning);
    font-weight: 500;
}

.grammar-issue-suggestion {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Toast Notification */
.tip-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--tc-glass-bg);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-md);
    padding: 16px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 20000;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: tipToastFade 0.3s ease;
    backdrop-filter: blur(var(--tc-glass-blur-heavy));
}

.tip-toast.success {
    border-color: var(--success);
}

.tip-toast.success i {
    color: var(--success);
}

.tip-toast.error {
    border-color: var(--danger);
}

.tip-toast.error i {
    color: var(--danger);
}

@keyframes tipToastFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spell Check Error Styling */
.cm-spell-error {
    background: rgba(255, 0, 0, 0.1);
    border-bottom: 2px wavy red;
}

/* ==================== Tips Tree Structure ==================== */

/* Main topic container */
.tip-topic {
    margin-bottom: 4px;
}

/* Topic header row */
.tip-topic-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--tc-glass-bg);
    border-radius: var(--tc-radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 8px;
    border: var(--tc-glass-border-subtle);
}

.tip-topic-header:hover {
    background: var(--tc-glass-bg-hover);
}

/* Expand/collapse icon */
.tip-expand-icon {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.tip-topic.expanded .tip-expand-icon {
    transform: rotate(90deg);
}

/* Topic title */
.tip-topic-title {
    flex: 1;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add thread button */
.tip-add-thread-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--tc-radius-sm);
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tip-topic-header:hover .tip-add-thread-btn {
    opacity: 1;
}

.tip-add-thread-btn:hover {
    background: var(--primary);
    color: white;
}

/* Threads container */
.tip-threads {
    margin-left: 24px;
    padding-left: 12px;
    border-left: 1px solid rgba(148,163,184,0.08);
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.tip-threads.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.tip-threads.expanded {
    max-height: 1000px;
    opacity: 1;
}

/* Individual thread */
.tip-thread {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: var(--tc-radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 6px;
}

.tip-thread:hover {
    background: var(--tc-glass-bg-hover);
}

/* Thread tree connector icon */
.tip-thread-icon {
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.5;
    flex-shrink: 0;
}

/* Thread title */
.tip-thread-title {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tip-thread:hover .tip-thread-title {
    color: var(--text);
}

/* Empty state for tips */
.tips-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Tip modal form label visibility fix */
.tip-modal-content .form-group label {
    color: #ffffff !important;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

/* Parent topic selector in modal */
.tip-parent-selector {
    margin-bottom: 16px;
}

.tip-parent-selector label {
    color: var(--text) !important;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.tip-parent-selector select {
    width: 100%;
    padding: 10px 12px;
    background: var(--tc-glass-bg-input);
    border: var(--tc-glass-border);
    border-radius: var(--tc-radius-sm);
    color: var(--text);
    font-size: 0.9rem;
}

.tip-parent-selector select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Tips sidebar section specific styling */
#tipsList {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 0;
}

#tipsList::-webkit-scrollbar {
    width: 6px;
}

#tipsList::-webkit-scrollbar-track {
    background: transparent;
}

#tipsList::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

#tipsList::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

