/**
 * vibes.css - Styles for Vibes Feature
 * Mood-based global filtering system
 */

/* ========================================
   VIBE BUTTON (Header)
   ======================================== */

.vibe-button-container {
    position: relative;
    display: inline-block;
}

.vibe-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--mv-border-color);
    border-radius: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.vibe-button:hover {
    border-color: #adb5bd;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.vibe-button.active {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #0d6efd;
    color: #0d6efd;
}

.vibe-button.active:hover {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 12px rgba(13, 110, 253, 0.2);
}

/* Scene active - light yellow background */
.vibe-button.scene-active {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-color: #ffc107;
}

.vibe-button.scene-active:hover {
    background: linear-gradient(135deg, #fffdf5 0%, #fff9e6 100%);
    box-shadow: 0 2px 12px rgba(255, 193, 7, 0.3);
}

/* Both Vibe and Scene active */
.vibe-button.active.scene-active {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

.vibe-button .vibe-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.vibe-button .vibe-label {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vibe-button .vibe-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 2px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    font-size: 0.7rem;
    font-weight: bold;
    transition: background 0.2s;
}

.vibe-button .vibe-clear:hover {
    background: rgba(255,255,255,0.4);
}

/* Scene toggle button states */
.vibe-button .vibe-clear.scene-toggle {
    color: #ffc107;
}

.vibe-button .vibe-clear.scene-toggle.paused {
    color: #6c757d;
}

/* ========================================
   VIBE PICKER OVERLAY
   ======================================== */

.vibe-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.vibe-picker-overlay.show {
    opacity: 1;
    visibility: visible;
}

.vibe-picker {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.vibe-picker-overlay.show .vibe-picker {
    transform: translateY(0);
}

.vibe-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.vibe-picker-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.vibe-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vibe-manage-btn,
.vibe-close-btn {
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.vibe-manage-btn:hover,
.vibe-close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.vibe-close-btn:hover {
    color: #dc3545;
}

/* Info buttons */
.vibe-info-btn {
    padding: 2px 6px;
    border: none;
    background: transparent;
    color: var(--mv-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 4px;
}

.vibe-info-btn:hover {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

/* Vibe section header (for "Vibes" label) */
.vibe-section {
    padding: 12px 20px 0;
}

.vibe-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.vibe-section-header i {
    color: #6c757d;
}

.vibe-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.vibe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ========================================
   VIBE CARDS
   ======================================== */

.vibe-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.vibe-card:hover {
    border-color: #0d6efd;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.vibe-card.active {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

.vibe-card-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 8px;
}

.vibe-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.vibe-card-desc {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
}

/* New Vibe Card */
.vibe-card-new {
    border-style: dashed;
    border-color: #adb5bd;
    background: #f8f9fa;
}

.vibe-card-new:hover {
    border-color: #0d6efd;
    background: #f8f9ff;
}

.vibe-card-new .vibe-card-icon {
    color: #6c757d;
}

/* Hidden indicator */
.vibe-card.is-hidden {
    opacity: 0.5;
}

.vibe-card .hidden-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    color: #6c757d;
}

/* Modified indicator */
.vibe-card .modified-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.65rem;
    color: #fd7e14;
}

/* ========================================
   VIBE PICKER FOOTER
   ======================================== */

.vibe-picker-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.vibe-clear-btn {
    padding: 8px 20px;
    border: 1px solid var(--mv-border-color);
    border-radius: 8px;
    background: white;
    color: #6c757d;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.vibe-clear-btn:hover {
    border-color: #adb5bd;
    color: #495057;
}

.vibe-clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   VIBE MANAGEMENT MODAL
   ======================================== */

.vibe-manage-list {
    max-height: none;
    overflow-y: visible;
}

.vibe-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
}

.vibe-manage-item:last-child {
    margin-bottom: 0;
}

.vibe-manage-item.is-hidden {
    opacity: 0.6;
    background: #f8f9fa;
}

.vibe-manage-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.vibe-manage-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.vibe-manage-details {
    flex: 1;
    min-width: 0;
}

.vibe-manage-name {
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vibe-manage-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.vibe-manage-actions {
    display: flex;
    gap: 4px;
}

.vibe-manage-actions .btn {
    padding: 4px 8px;
}

/* ========================================
   EMOJI PICKER
   ======================================== */

.emoji-picker-container {
    position: relative;
}

.emoji-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: 2px dashed var(--mv-border-color);
    border-radius: 12px;
    background: #f8f9fa;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-picker-trigger:hover {
    border-color: #0d6efd;
    background: #f8f9ff;
}

.emoji-picker-trigger.has-emoji {
    border-style: solid;
    border-color: var(--mv-border-color);
    background: white;
}

.emoji-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1060;
    width: 420px;
    max-height: none;
    overflow-y: visible;
    background: white;
    border: 1px solid var(--mv-border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 12px;
    display: none;
}

.emoji-picker-dropdown.show {
    display: block;
}

.emoji-picker-category {
    margin-bottom: 12px;
}

.emoji-picker-category:last-child {
    margin-bottom: 0;
}

.emoji-picker-category-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 4px;
}

.emoji-picker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.emoji-picker-item:hover {
    background: #e9ecef;
}

/* ========================================
   ACTIVE VIBE INDICATOR (Global)
   ======================================== */

.vibe-active-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 16px;
    background: #0d6efd;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

.vibe-active-banner .vibe-icon {
    font-size: 1rem;
}

.vibe-active-banner .vibe-clear-link {
    color: rgba(255,255,255,0.8);
    text-decoration: underline;
    cursor: pointer;
}

.vibe-active-banner .vibe-clear-link:hover {
    color: white;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 576px) {
    .vibe-picker {
        max-width: calc(100% - 16px);
        margin: 0 8px;
    }

    .vibe-picker-body {
        padding: 10px;
    }

    /* 2 columns on mobile */
    .vibe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Compact vibe cards for mobile */
    .vibe-card {
        padding: 10px 6px;
        border-radius: 10px;
    }

    .vibe-card-icon {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }

    .vibe-card-name {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }

    .vibe-card-desc {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    .vibe-button .vibe-label {
        max-width: 100px;
    }

    /* Compact picker header and footer */
    .vibe-picker-header {
        padding: 10px 12px;
    }

    .vibe-picker-header h5 {
        font-size: 1rem;
    }

    .vibe-picker-footer {
        padding: 8px 12px;
    }

    .vibe-section {
        padding: 8px 12px 0;
    }
}

/* ========================================
   DARK MODE OVERRIDES
   ======================================== */

[data-bs-theme="dark"] .vibe-button {
    border-color: var(--mv-border-color);
    background: var(--mv-bg-surface);
    color: var(--mv-text-secondary);
}
[data-bs-theme="dark"] .vibe-button:hover {
    border-color: #6c757d;
    background: var(--mv-bg-hover);
}
[data-bs-theme="dark"] .vibe-button.active {
    background: rgba(13, 110, 253, 0.1);
    border-color: #0d6efd;
    color: #6ea8fe;
}
[data-bs-theme="dark"] .vibe-button.scene-active {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}
[data-bs-theme="dark"] .vibe-button.active.scene-active {
    background: rgba(255, 193, 7, 0.1);
}
[data-bs-theme="dark"] .vibe-picker {
    background: var(--mv-bg-card);
    box-shadow: var(--mv-shadow-lg);
}
[data-bs-theme="dark"] .vibe-picker-header {
    border-bottom-color: var(--mv-border-color);
}
[data-bs-theme="dark"] .vibe-picker-header h5 {
    color: var(--mv-text-primary);
}
[data-bs-theme="dark"] .vibe-manage-btn,
[data-bs-theme="dark"] .vibe-close-btn {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .vibe-manage-btn:hover,
[data-bs-theme="dark"] .vibe-close-btn:hover {
    background: var(--mv-bg-hover);
    color: var(--mv-text-secondary);
}
[data-bs-theme="dark"] .vibe-section-header {
    color: var(--mv-text-secondary);
}
[data-bs-theme="dark"] .vibe-section-header i {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .vibe-card {
    border-color: var(--mv-border-color);
    background: var(--mv-bg-card);
}
[data-bs-theme="dark"] .vibe-card:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}
[data-bs-theme="dark"] .vibe-card.active {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.15);
}
[data-bs-theme="dark"] .vibe-card-name {
    color: var(--mv-text-primary);
}
[data-bs-theme="dark"] .vibe-card-desc {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .vibe-card-new {
    border-color: var(--mv-text-muted);
    background: var(--mv-bg-surface);
}
[data-bs-theme="dark"] .vibe-card-new:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}
[data-bs-theme="dark"] .vibe-card-new .vibe-card-icon {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .vibe-picker-footer {
    border-top-color: var(--mv-border-color);
    background: var(--mv-bg-surface);
}
[data-bs-theme="dark"] .vibe-clear-btn {
    border-color: var(--mv-border-color);
    background: var(--mv-bg-card);
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .vibe-clear-btn:hover {
    border-color: #6c757d;
    color: var(--mv-text-secondary);
}
[data-bs-theme="dark"] .vibe-manage-item {
    border-color: var(--mv-border-color);
    background: var(--mv-bg-card);
}
[data-bs-theme="dark"] .vibe-manage-item.is-hidden {
    background: var(--mv-bg-surface);
}
[data-bs-theme="dark"] .vibe-manage-name {
    color: var(--mv-text-primary);
}
[data-bs-theme="dark"] .vibe-manage-meta {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .emoji-picker-dropdown {
    background: var(--mv-bg-dropdown);
    border-color: var(--mv-border-color);
    box-shadow: var(--mv-shadow-lg);
}
[data-bs-theme="dark"] .emoji-picker-category-label {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .emoji-picker-item:hover {
    background: var(--mv-bg-hover);
}
[data-bs-theme="dark"] .emoji-picker-trigger {
    border-color: var(--mv-border-color);
    background: var(--mv-bg-surface);
}
[data-bs-theme="dark"] .emoji-picker-trigger.has-emoji {
    background: var(--mv-bg-card);
    border-color: var(--mv-border-color);
}
