/* sora.markets - Dopamine-charged tech tutorial marketplace */
/* Colors: #1a1a2e (deep base), #e8b84b (accent gold), #6c757d (muted gray), #f5f0e8 (warm off-white), #4a90d9 (primary blue) */
/* Fonts: Sora, Inter, Jost (Futura substitute) */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --deep-base: #1a1a2e;
    --primary-blue: #4a90d9;
    --warm-white: #f5f0e8;
    --accent-gold: #e8b84b;
    --muted-gray: #6c757d;
    --dopamine-pink: #ff6b9d;
    --dopamine-teal: #00c9a7;
    --dopamine-purple: #a855f7;
    --sidebar-width: 260px;
    --frost-bg: rgba(245, 240, 232, 0.08);
    --frost-border: rgba(245, 240, 232, 0.12);
}

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--deep-base);
    color: var(--warm-white);
    overflow: hidden;
}

body {
    display: flex;
}

/* ======== SIDEBAR ======== */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: rgba(26, 26, 46, 0.95);
    border-right: 1px solid var(--frost-border);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(20px);
}

#sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--frost-border);
}

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

#logo-svg {
    flex-shrink: 0;
}

#logo-text {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--warm-white);
    letter-spacing: -0.5px;
}

#logo-text .gold {
    color: var(--accent-gold);
}

#sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--muted-gray);
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--frost-bg);
    color: var(--warm-white);
}

.nav-item.active {
    background: rgba(74, 144, 217, 0.15);
    color: var(--warm-white);
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    border-radius: 0 3px 3px 0;
    background: var(--primary-blue);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active .nav-indicator {
    height: 24px;
}

.nav-icon {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-label {
    flex: 1;
}

.fish-mascot {
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover .fish-mascot,
.nav-item.active .fish-mascot {
    opacity: 1;
    transform: translateX(0);
}

.nav-item.active .fish-mascot svg {
    animation: fishSwim 3s ease-in-out infinite;
}

@keyframes fishSwim {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(-2deg); }
    75% { transform: translateY(3px) rotate(2deg); }
}

#sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--frost-border);
}

.annotation {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.annotation:hover {
    opacity: 1;
}

/* ======== MAIN CONTENT ======== */
#main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
}

#dopamine-bg {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 600px 400px at 20% 20%, rgba(74, 144, 217, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 60%, rgba(168, 85, 247, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 50% 80%, rgba(232, 184, 75, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 300px 300px at 10% 70%, rgba(0, 201, 167, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.6s ease;
}

#floating-fish-container {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-fish {
    position: absolute;
    opacity: 0.15;
    animation: floatFish linear infinite;
}

@keyframes floatFish {
    0% {
        transform: translateX(-60px) translateY(0) scaleX(1);
    }
    49.9% {
        transform: translateX(calc(100vw + 60px)) translateY(var(--drift-y, 20px)) scaleX(1);
    }
    50% {
        transform: translateX(calc(100vw + 60px)) translateY(var(--drift-y, 20px)) scaleX(-1);
    }
    100% {
        transform: translateX(-60px) translateY(0) scaleX(-1);
    }
}

#ripple-container {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(232, 184, 75, 0.4);
    animation: rippleExpand 0.8s cubic-bezier(0, 0.5, 0.5, 1) forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.6;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
        margin-left: -100px;
        margin-top: -100px;
    }
}

/* ======== TOP BAR ======== */
#top-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--frost-border);
}

#search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--frost-bg);
    border: 1px solid var(--frost-border);
    border-radius: 12px;
    padding: 10px 16px;
    flex: 1;
    max-width: 480px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

#search-wrapper:focus-within {
    border-color: var(--primary-blue);
    background: rgba(74, 144, 217, 0.08);
}

.search-icon {
    flex-shrink: 0;
}

#search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--warm-white);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    width: 100%;
}

#search-input::placeholder {
    color: var(--muted-gray);
}

#top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.action-btn {
    background: var(--frost-bg);
    border: 1px solid var(--frost-border);
    border-radius: 10px;
    padding: 8px;
    color: var(--muted-gray);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(232, 184, 75, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dopamine-pink);
    animation: pulse 2s ease-in-out infinite;
}

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

#user-avatar {
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.3s ease;
}

#user-avatar:hover {
    transform: scale(1.1);
}

/* ======== SECTIONS ======== */
.content-section {
    display: none;
    padding: 32px;
    position: relative;
    z-index: 3;
    animation: fadeInSection 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-section.active {
    display: block;
}

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

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.section-title {
    font-family: 'Sora', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--warm-white);
    letter-spacing: -1px;
}

/* ======== FROST CARDS ======== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.frost-card {
    background: var(--frost-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--frost-border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.frost-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%);
    pointer-events: none;
}

.frost-card:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 184, 75, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 40px rgba(232, 184, 75, 0.05);
}

.card-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(74, 144, 217, 0.2);
    color: var(--primary-blue);
    margin-bottom: 12px;
}

.card-badge.hot {
    background: rgba(255, 107, 157, 0.2);
    color: var(--dopamine-pink);
}

.card-chart {
    margin: 0 -24px;
    padding: 0 24px;
    margin-bottom: 16px;
    overflow: hidden;
}

.card-chart svg {
    width: 100%;
    height: auto;
}

.card-title {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.card-description {
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted-gray);
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-price {
    font-family: 'Jost', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--warm-white);
}

.card-trend {
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 8px;
}

.card-trend.positive {
    color: var(--dopamine-teal);
    background: rgba(0, 201, 167, 0.12);
}

.card-trend.negative {
    color: var(--dopamine-pink);
    background: rgba(255, 107, 157, 0.12);
}

/* ======== TRENDING SECTION ======== */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
}

.trending-rank {
    font-family: 'Jost', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
    min-width: 48px;
    text-align: center;
}

.trending-info {
    flex: 1;
}

.trending-info h3 {
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: 4px;
}

.trending-info p {
    font-size: 13px;
    color: var(--muted-gray);
}

/* ======== TUTORIALS ======== */
.tutorial-card {
    display: flex;
    flex-direction: column;
}

.tutorial-level {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    width: fit-content;
}

.tutorial-level.beginner {
    background: rgba(0, 201, 167, 0.15);
    color: var(--dopamine-teal);
}

.tutorial-level.intermediate {
    background: rgba(232, 184, 75, 0.15);
    color: var(--accent-gold);
}

.tutorial-level.advanced {
    background: rgba(168, 85, 247, 0.15);
    color: var(--dopamine-purple);
}

.tutorial-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--muted-gray);
}

.tutorial-progress {
    height: 4px;
    background: rgba(245, 240, 232, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--dopamine-teal));
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======== PORTFOLIO ======== */
.portfolio-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.portfolio-stat {
    text-align: center;
    padding: 28px 24px;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--muted-gray);
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
}

.stat-value {
    display: block;
    font-family: 'Jost', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--warm-white);
    margin-bottom: 8px;
}

.stat-value.positive-text {
    color: var(--dopamine-teal);
}

.stat-sub {
    font-size: 12px;
    color: var(--muted-gray);
}

.portfolio-holdings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.holding-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
}

.holding-name {
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--warm-white);
    min-width: 200px;
}

.holding-allocation {
    flex: 1;
    height: 8px;
    background: rgba(245, 240, 232, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.allocation-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.holding-value {
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--warm-white);
    min-width: 100px;
    text-align: right;
}

/* ======== COMMUNITY ======== */
.community-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.community-post {
    padding: 24px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.post-author {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--warm-white);
}

.post-time {
    font-size: 12px;
    color: var(--muted-gray);
}

.post-content {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(245, 240, 232, 0.85);
    margin-bottom: 16px;
}

.post-actions {
    display: flex;
    gap: 12px;
}

.post-action-btn {
    background: rgba(245, 240, 232, 0.05);
    border: 1px solid var(--frost-border);
    border-radius: 8px;
    padding: 6px 14px;
    color: var(--muted-gray);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.post-action-btn:hover {
    background: rgba(232, 184, 75, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ======== RIPPLE BUTTON EFFECT ======== */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple-btn .btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(232, 184, 75, 0.3);
    animation: btnRipple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes btnRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 150px;
        height: 150px;
        margin-left: -75px;
        margin-top: -75px;
        opacity: 0;
    }
}

/* ======== SCROLLBAR ======== */
#main-content::-webkit-scrollbar {
    width: 6px;
}

#main-content::-webkit-scrollbar-track {
    background: transparent;
}

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

#main-content::-webkit-scrollbar-thumb:hover {
    background: var(--muted-gray);
}

/* ======== RESPONSIVE ======== */
@media (max-width: 1024px) {
    .portfolio-overview {
        grid-template-columns: 1fr;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 200px;
    }
    .section-title {
        font-size: 24px;
    }
    .content-section {
        padding: 20px;
    }
    .holding-name {
        min-width: 120px;
    }
}
