/* ===== CUSTOM STYLING FOR GENG DAYE WEB CLIENT ===== */

:root {
    --bg: #030712;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --bg-pane: rgba(15, 23, 42, 0.4);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    /* Neon glow color scheme */
    --cyan: #06b6d4;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --lime: #84cc16;
    
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --gradient-main: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 50%, var(--pink) 100%);
    --gradient-alt: linear-gradient(135deg, var(--pink) 0%, #ff8a00 100%);
    
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE & RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
}

body {
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* ===== CORE BACKGROUNDS & EFFECTS ===== */
.background-wrapper {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 50%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 50%, transparent 85%);
}

.bg-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.25;
    animation: orbFloat 25s ease-in-out infinite alternate;
}

.orb-purple {
    width: 600px;
    height: 600px;
    background: var(--purple);
    top: -15%;
    right: -10%;
}

.orb-cyan {
    width: 500px;
    height: 500px;
    background: var(--cyan);
    bottom: -10%;
    left: -15%;
    animation-delay: -6s;
}

.orb-pink {
    width: 400px;
    height: 400px;
    background: var(--pink);
    top: 35%;
    left: 40%;
    animation-delay: -12s;
    opacity: 0.12;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 40px) scale(1.15); }
}

.cursor-glow {
    position: fixed;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

body:hover .cursor-glow {
    opacity: 1;
}

/* ===== APP HEADER / NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.nav-logo-text {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.accent-dot {
    color: var(--cyan);
}

.btn-nav-cta {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-nav-cta:hover {
    background: var(--gradient-main);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

/* ===== WORKSPACE CONTAINER ===== */
.main-container {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 10;
}

/* ===== SEARCH PANEL ===== */
.search-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.search-box-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    z-index: 30;
}

.search-box-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.search-box-wrapper input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.15);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.clear-search-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

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

/* Search Dropdown Results */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-hover);
    border-radius: 18px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 100;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding-right: 16px;
}

.result-name {
    font-size: 15px;
    font-weight: 700;
    color: white;
}

.result-brief {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.result-score {
    font-size: 11px;
    font-weight: 700;
    color: var(--pink);
    background: rgba(236, 72, 153, 0.1);
    padding: 3px 8px;
    border-radius: 50px;
    border: 1px solid rgba(236, 72, 153, 0.15);
}

.search-no-results {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== CONTENT GRID ===== */
.content-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    flex: 1;
}

/* Panes Styling */
.pane {
    background: var(--bg-pane);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

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

.pane-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pane-title h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
}

.pulse-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 10px var(--lime);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.4; }
}

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

.btn-action {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    color: white;
}

/* Canvas Area styling */
.canvas-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 480px;
    background: rgba(0, 0, 0, 0.15);
}

#bubbleCanvas {
    display: none;
}

/* Graffiti Wall Layout styling */
.graffiti-wall {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;
    background: rgba(11, 10, 18, 0.95);
    gap: 12px;
    user-select: none;
}

.graffiti-wall::-webkit-scrollbar {
    width: 6px;
}
.graffiti-wall::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.graffiti-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0;
    padding: 2px 10px;
    transition: var(--transition);
}

.graffiti-word {
    font-family: var(--font-display);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 0.25s ease, opacity 0.2s ease, filter 0.2s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    opacity: 0.95;
}

.graffiti-word:hover {
    transform: scale(1.08) rotate(1.5deg);
    opacity: 1;
    filter: brightness(1.25);
    text-shadow: 0 0 10px currentColor;
}

.graffiti-word.active {
    opacity: 1;
    text-shadow: 0 0 18px currentColor, 0 0 35px currentColor, 0 2px 4px rgba(0, 0, 0, 0.8);
    transform: scale(1.15) rotate(-1deg);
    filter: brightness(1.4);
    z-index: 5;
}

.canvas-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(3, 7, 18, 0.8);
    z-index: 10;
    transition: opacity 0.5s ease;
}

.canvas-loading p {
    font-size: 14px;
    color: var(--text-muted);
}

.helper-text {
    padding: 12px 24px;
    font-size: 12px;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
}

/* Spinner Component */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== DETAIL CARD (RIGHT PANEL) ===== */
.detail-card-wrapper {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Custom scrollbar for detail panel */
.detail-card-wrapper::-webkit-scrollbar {
    width: 6px;
}
.detail-card-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.detail-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.placeholder-icon {
    font-size: 56px;
    margin-bottom: 20px;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.detail-placeholder h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
}

.detail-placeholder p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 320px;
    margin-bottom: 32px;
}

/* Ad glow card inside placeholder */
.glow-card-ad {
    width: 100%;
    max-width: 340px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.ad-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--pink);
    background: rgba(236, 72, 153, 0.1);
    padding: 3px 8px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 12px;
}

.glow-card-ad h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.glow-card-ad p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
    max-width: 100%;
    text-align: left;
}

.glow-card-ad .btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    background: var(--gradient-main);
    color: white;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
    transition: var(--transition);
}

.glow-card-ad .btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

/* Detail Loading State */
.detail-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
}

.detail-loading p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Detail Content State */
.detail-content {
    animation: fadeIn 0.4s ease forwards;
}

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

.detail-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.detail-rank {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--cyan);
}

.detail-score {
    font-size: 11px;
    font-weight: 700;
    color: var(--pink);
    background: rgba(236, 72, 153, 0.1);
    padding: 4px 10px;
    border-radius: 50px;
    border: 1px solid rgba(236, 72, 153, 0.15);
}

.detail-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
}

.detail-brief {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tag {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.tag.emotion {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
}

.tag.tag-scout {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
    color: #a5f3fc;
}

.tag.year-meta {
    background: rgba(132, 204, 22, 0.08);
    border-color: rgba(132, 204, 22, 0.2);
    color: #bef264;
}

/* Deep Dive Accordion / Boxes */
.deep-dive-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.deep-dive-section {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 16px;
}

.section-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-body {
    font-size: 14px;
    line-height: 1.6;
    color: #d1d5db;
    white-space: pre-wrap;
}

/* Chat Simulator inside Details */
.dialog-simulator {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
}

.msg.receiver {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.msg.sender {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--purple) 0%, rgba(139, 92, 246, 0.6) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* iOS Banner Promo inside Detail */
.ios-promo-footer {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.promo-text h5 {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.promo-text p {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
    max-width: 200px;
}

.promo-badge-btn {
    flex-shrink: 0;
    transition: var(--transition);
}

.promo-badge-btn:hover {
    transform: scale(1.03);
}

.promo-badge-img {
    height: 38px;
    width: auto;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
    z-index: 10;
}

.footer a {
    color: var(--cyan);
    transition: var(--transition);
}

.footer a:hover {
    color: var(--purple);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .pane-left {
        order: 1;
    }
    
    .pane-right {
        order: 2;
    }
    
    .canvas-wrapper {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 16px;
    }
    
    .canvas-wrapper {
        min-height: 320px;
    }
    
    .navbar {
        padding: 12px 0;
    }
    
    .nav-logo-text {
        font-size: 18px;
    }
    
    .search-box-wrapper input {
        font-size: 14px;
        padding: 12px 16px 12px 42px;
    }
    
    .search-icon {
        left: 16px;
        font-size: 14px;
    }
    
    .ios-promo-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
