/* ============================================
   Research, Settings, Bloomberg TV, Modals
   ============================================ */

/* Research */
.research-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; }
.research-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.research-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.research-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.research-source { font-size: 10px; color: var(--accent-orange); font-weight: 600; text-transform: uppercase; }
.research-date { font-size: 10px; color: var(--text-muted); }
.research-title { font-size: 15px; font-weight: 500; margin-bottom: 10px; line-height: 1.4; }
.research-summary { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.research-tags { display: flex; gap: 6px; margin-top: 12px; }

/* Custom Layout */
.custom-container { height: 100%; display: flex; flex-direction: column; }
.custom-toolbar { padding: 12px 16px; background: var(--bg-panel); border-bottom: 1px solid var(--border-primary); display: flex; gap: 8px; }
.custom-grid { flex: 1; display: grid; gap: 1px; background: var(--border-primary); }
.custom-grid[data-cols="2"] { grid-template-columns: 1fr 1fr; }
.custom-grid[data-cols="3"] { grid-template-columns: 1fr 1fr 1fr; }
.custom-grid[data-cols="4"] { grid-template-columns: 1fr 1fr 1fr 1fr; }
.custom-panel { background: var(--bg-terminal); display: flex; flex-direction: column; min-height: 200px; }
.custom-panel-header { padding: 8px 12px; background: var(--bg-panel); border-bottom: 1px solid var(--border-primary); display: flex; justify-content: space-between; align-items: center; }
.custom-panel-content { flex: 1; overflow: auto; }

/* Settings */
.settings-container { display: grid; grid-template-columns: 240px 1fr; gap: 24px; height: 100%; }
.settings-nav { background: var(--bg-card); border-radius: 8px; padding: 8px; height: fit-content; }
.settings-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.settings-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav-item.active { background: var(--accent-orange); color: #000; }
.settings-nav-item i { width: 16px; }
.settings-section { background: var(--bg-card); border-radius: 8px; padding: 24px; }
.settings-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.settings-group { margin-bottom: 24px; }
.settings-group-title { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; }
.settings-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-primary);
}
.settings-option:last-child { border-bottom: none; }
.settings-label { font-size: 13px; }
.settings-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Toggle Switch */
.toggle-switch {
    width: 44px; height: 24px;
    background: var(--bg-hover);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-switch.active { background: var(--accent-orange); }
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-switch.active::after { transform: translateX(20px); }

/* Settings Enhancements */
.settings-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; margin-top: -12px; }
.settings-select {
    padding: 8px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    min-width: 140px;
}
.settings-select:focus { outline: none; border-color: var(--accent-orange); }

.settings-logout {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
    color: var(--accent-red) !important;
}
.settings-logout:hover { background: rgba(239, 68, 68, 0.1) !important; color: var(--accent-red) !important; }

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}
.volume-btn:hover { background: var(--accent-orange); color: #000; border-color: var(--accent-orange); }

.volume-slider {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-hover);
    border-radius: 2px;
    cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-orange);
    border-radius: 50%;
    cursor: pointer;
}
.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-orange);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-value {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    min-width: 40px;
}

/* Playback Control */
.playback-control {
    display: flex;
    gap: 8px;
}

.playback-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}
.playback-btn:hover { background: var(--accent-orange); color: #000; border-color: var(--accent-orange); }
.playback-btn i { font-size: 12px; }

/* About Section */
.about-info {
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 16px;
}

.about-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-primary);
}
.about-row:last-child { border-bottom: none; }

.about-label { font-size: 12px; color: var(--text-muted); }
.about-value { font-size: 12px; color: var(--text-primary); font-family: var(--font-mono); }

.about-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-hover);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.15s;
}
.about-link:hover { background: var(--accent-orange); color: #000; }
.about-link i { width: 16px; }

.about-credits {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 11px;
}
.about-credits p { margin-bottom: 4px; }

/* Bloomberg TV Mini */
.bloomberg-tv-mini {
    position: fixed;
    bottom: 20px; right: 20px;
    width: 360px; height: 220px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    min-width: 300px; min-height: 180px;
}
.bloomberg-tv-mini.visible { display: flex; }
.bloomberg-tv-mini.minimized { width: 200px; height: 40px; resize: none; }
.bloomberg-tv-mini.minimized .tv-content { display: none; }

.tv-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
    cursor: move;
}
.tv-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; }
.tv-title i { color: var(--accent-orange); }
.tv-badge { font-size: 8px; background: var(--accent-red); color: #fff; padding: 2px 6px; border-radius: 2px; animation: pulse 1.5s infinite; }
.tv-controls { display: flex; gap: 4px; }
.tv-btn {
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 3px;
    color: var(--text-muted);
    cursor: pointer; font-size: 10px;
}
.tv-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.tv-btn.close:hover { background: var(--accent-red); color: #fff; }
.tv-content { flex: 1; background: #000; }
.tv-content iframe { width: 100%; height: 100%; border: none; }

/* Notification Settings */
.notif-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-hover);
    border-radius: 8px;
    font-size: 12px;
}

.notif-status i {
    font-size: 20px;
}

.notif-status.granted i { color: var(--accent-green); }
.notif-status.denied i { color: var(--accent-red); }
.notif-status.default i { color: var(--accent-orange); }

.notif-enable-btn {
    margin-left: auto;
    padding: 8px 16px;
    background: var(--accent-orange);
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.notif-enable-btn:hover {
    background: #ff8c00;
}

.notif-test-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.notif-test-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.notif-test-btn:hover {
    background: var(--accent-orange);
    color: #000;
    border-color: var(--accent-orange);
}

.notif-test-btn i {
    font-size: 12px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 60px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
}

.toast-notification i {
    font-size: 18px;
}

.toast-notification span {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.toast-notification button {
    padding: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
}

.toast-notification button:hover {
    color: var(--text-primary);
}

.toast-info { border-left: 3px solid var(--accent-blue); }
.toast-info i { color: var(--accent-blue); }

.toast-success { border-left: 3px solid var(--accent-green); }
.toast-success i { color: var(--accent-green); }

.toast-warning { border-left: 3px solid var(--accent-orange); }
.toast-warning i { color: var(--accent-orange); }

.toast-error { border-left: 3px solid var(--accent-red); }
.toast-error i { color: var(--accent-red); }

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