/**
 * Heracles - Quant Research Pro Styles
 * Extracted from quant-research-pro.html
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --bg-dark: #0a0a0a;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #FFD700;
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
}

* {
    box-sizing: border-box;
    outline: none;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
@keyframes skeleton-loading {
    0% {
        background-color: rgba(255, 255, 255, 0.1);
    }
    50% {
        background-color: rgba(255, 255, 255, 0.2);
    }
    100% {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.skeleton-pl {
    display: inline-block;
    width: 70px;
    height: 14px;
    border-radius: 4px;
    margin-left: 8px;
    animation: skeleton-loading 1.2s infinite ease-in-out;
    vertical-align: middle;
}

/* ============================================
   BODY
   ============================================ */
body {
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
}

/* ============================================
   SIDEBAR (Dock)
   ============================================ */
.sidebar {
    width: 80px;
    background: rgba(0, 0, 0, 0.8);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.app-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.app-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.app-icon svg {
    width: 24px;
    height: 24px;
    opacity: 0.8;
}

/* Gradient hues for icons */
.hue-1 svg { color: #4facfe; }
.hue-2 svg { color: #f093fb; }
.hue-3 svg { color: #43e97b; }
.hue-4 svg { color: #fa709a; }

.app-label {
    position: absolute;
    left: 60px;
    background: #222;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    white-space: nowrap;
    border: 1px solid #333;
}

.app-icon:hover .app-label {
    opacity: 1;
}

.user-avatar {
    margin-top: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    cursor: pointer;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   USER MENU
   ============================================ */
.user-menu {
    position: absolute;
    left: 20px;
    bottom: 80px;
    width: 200px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transform-origin: bottom left;
    animation: menuPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes menuPop {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.user-menu.open {
    display: flex;
}

.user-menu-item {
    padding: 12px 16px;
    color: #ccc;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.user-initials {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background: #333;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   LOGOUT MODAL
   ============================================ */
.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.logout-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.logout-modal-content {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    width: 350px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.logout-modal-overlay.open .logout-modal-content {
    transform: translateY(0);
}

.logout-modal-title {
    font-size: 1.5rem;
    color: #fff;
    margin: 0 0 10px 0;
}

.logout-modal-text {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.logout-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-logout-yes {
    background: #ff4444;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout-yes:hover {
    background: #cc0000;
}

.btn-logout-no {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout-no:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   MAIN DESKTOP AREA
   ============================================ */
.desktop {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at top right, #1a1a1a, #000000);
    overflow: hidden;
}

/* ============================================
   SCROLLABLE TICKER
   ============================================ */
.ticker-bar {
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    font-size: 12px;
    color: var(--text-dim);
}

.ticker-content {
    display: flex;
    width: max-content;
    animation: ticker 120s linear infinite;
}

.ticker-content:hover {
    animation-play-state: paused;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* ============================================
   WINDOW (App Container)
   ============================================ */
.window {
    position: absolute;
    top: 50px;
    left: 50px;
    right: 50px;
    bottom: 50px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
}

.window.open {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.window-header {
    height: 50px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
}

.window-title {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.window-controls div {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
}

.wc-red { background: #ff5f56; }
.wc-yel { background: #ffbd2e; }
.wc-grn { background: #27c93f; }

.window-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ============================================
   FEED STYLES
   ============================================ */
.feed-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: background 0.2s;
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.feed-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.feed-tag {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================
   FAB (Floating Action Button)
   ============================================ */
.fab {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    font-size: 24px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 200;
    display: none;
}

.fab:hover {
    transform: scale(1.1);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal {
    background: #1a1a1a;
    border: 1px solid #333;
    width: 500px;
    max-width: 90%;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.form-group {
    margin-bottom: 15px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
    font-family: inherit;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    color: #000;
}

.btn-close {
    background: transparent;
    border: none;
    color: #888;
    float: right;
    cursor: pointer;
    font-size: 20px;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #00ff88;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* ============================================
   HELPER CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   REPORT CARD DESIGN (Premium)
   ============================================ */
.report-card {
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.report-hero-image {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.report-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, #0f0f0f, transparent);
}

.report-content-wrapper {
    padding: 30px;
}

.report-title {
    font-size: 2rem;
    margin: 0 0 20px 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.report-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.report-body {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    white-space: pre-wrap;
    font-weight: 300;
}

.report-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.report-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: opacity 0.2s;
}

.report-gallery img:hover {
    opacity: 0.8;
}

/* Accordion Header */
.report-header {
    padding: 20px 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
}

.report-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.report-header-title {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 600;
}

.report-header-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 20px;
}

.toggle-icon {
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.3s;
}

.report-card.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Hidden Details */
.report-details {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease;
}

.report-card.expanded .report-details {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.open {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.open .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
}

/* ============================================
   MOBILE OPTIMIZATION (iPhone/Android)
   ============================================ */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    /* Bottom Navigation Bar */
    .sidebar {
        width: 100%;
        height: 70px;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        background: rgba(10, 10, 10, 0.95);
    }

    .app-icon {
        margin-bottom: 0;
        width: 40px;
        height: 40px;
    }

    .app-icon svg {
        width: 20px;
        height: 20px;
    }

    .user-avatar {
        margin-top: 0;
        width: 35px;
        height: 35px;
    }

    /* Spacer hide on mobile */
    .sidebar>div[style*="height: 1px"] {
        display: none;
    }

    /* Full Screen Windows (with space for bottom nav) */
    .window {
        top: 0;
        left: 0;
        right: 0;
        bottom: 70px;
        border-radius: 0;
        border: none;
    }

    .logo-watermark {
        font-size: 80px;
    }

    /* Report Cards */
    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* CHAT: Stack layout */
    #window-content>div[style*="display: flex"] {
        flex-direction: column !important;
    }

    /* Channel List (Top horizontal scroll or collapsible) */
    #window-content>div>div:first-child {
        width: 100% !important;
        height: 60px !important;
        flex-direction: row !important;
        overflow-x: auto;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0 10px !important;
        align-items: center;
    }

    .channel-item {
        white-space: nowrap;
        border-left: none !important;
        border-bottom: 2px solid transparent;
        padding: 10px 15px !important;
    }

    .channel-item.active {
        border-bottom: 2px solid #FFD700 !important;
        background: transparent !important;
    }

    /* Signals Accordion Mobile Fix */
    .signal-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        height: auto !important;
    }

    /* Inner wrapper for horizontal alignment of Badge/Ticker */
    .signal-header>div:first-child {
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: space-between;
    }

    /* Title on its own line */
    .signal-header>div:nth-child(2) {
        width: 100%;
        white-space: normal;
    }

    .signal-meta {
        display: none;
    }

    /* Font Adjustments */
    h2 {
        font-size: 1.5rem;
    }

    p {
        font-size: 0.95rem;
    }
}
