﻿/* ========================================
   ONTIVEROSSHOP - PROFESSIONAL DESIGN SYSTEM
   E-Commerce Community Platform
   Version 2.1 - Refactored for Responsiveness
   ======================================== */

/* Global Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   VARIABLES & THEME
   ======================================== */
:root {
    /* === Primary Background Colors === */
    --primary-bg: #0D0F1A;
    --secondary-bg: #151823;
    --card-bg: #1A1D2E;
    --elevated-bg: #1F2333;

    /* === Brand Colors === */
    --brand-primary: #6366F1;
    /* Indigo */
    --brand-secondary: #EC4899;
    /* Pink */
    --brand-accent: #8B5CF6;
    /* Purple */
    --brand-gradient: linear-gradient(135deg, #6366F1 0%, #EC4899 100%);

    /* === Semantic Colors === */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    /* === Text Colors === */
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;

    /* === Effects === */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-heavy: rgba(255, 255, 255, 0.08);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --glow-primary: 0 0 20px rgba(99, 102, 241, 0.3);

    /* === Typography === */
    --font-display: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    /* === Spacing & Radius === */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* === Transitions === */
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   BASE STYLES
   ======================================== */
body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal scroll on mobile */
    min-height: 100vh;

    /* Background Pattern */
    background-image:
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul {
    list-style: none;
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ========================================
   LAYOUT & GRID SYSTEM (CORE FIX)
   ======================================== */

/* Container Setup */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* The Main Layout Grid */
.layout-grid {
    display: grid;
    gap: 20px;
    width: 100%;
    margin: 20px auto;
    padding-bottom: 80px;
    /* Space for bottom nav on mobile */
}

/* Desktop Logic (Min Width 901px) */
@media (min-width: 901px) {
    .layout-grid {
        /* 3 Columns: Left Sidebar | Feed | Right Sidebar */
        grid-template-columns: 260px 1fr 300px;
        align-items: start;
        padding: 0 30px;
        max-width: 1600px;
    }

    .sidebar-left,
    .sidebar-right {
        display: block;
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    /* Hide Mobile Elements on PC */
    .mobile-only,
    .mobile-bottom-nav,
    .mobile-search-bar,
    .mobile-cat-bar {
        display: none !important;
    }

    /* PC Background Boost */
    body {
        background-image:
            radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
            radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 45%);
    }
}

/* Mobile Logic (Max Width 900px) */
@media (max-width: 900px) {
    body {
        /* Adjust padding for fixed mobile headers */
        padding-top: 120px;
        padding-bottom: 70px;
        /* Space for bottom nav */
    }

    .layout-grid {
        display: flex;
        flex-direction: column;
        padding: 0 10px;
        /* Prevents edge touching */
    }

    /* Hide PC Elements on Mobile */
    .pc-only,
    .sidebar-left,
    .sidebar-right {
        display: none !important;
    }

    /* Make Feed Full Width */
    .feed-container,
    .post-container {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Fix Glass Nav placement on Mobile */
    .glass-nav {
        padding: 10px 15px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        margin: 0;
        border-radius: 0;
        background: rgba(13, 15, 26, 0.95);
        border-bottom: 1px solid var(--border-default);
    }

    .glass-nav .links {
        display: none;
    }

    /* Hide desktop links on mobile */
}

/* ========================================
   COMPONENTS
   ======================================== */

/* --- Glass Card --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 20px;
    overflow-wrap: break-word;
    /* Prevent text overflow */
}

/* --- Navigation (Desktop) --- */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin: 0 20px;
    position: sticky;
    top: 20px;
    z-index: 1000;
    border-radius: var(--radius-lg);
    background: rgba(13, 15, 26, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-default);
}

.glass-nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--brand-primary);
    text-transform: uppercase;
}

.glass-nav .links a {
    margin-left: 20px;
    font-weight: 500;
    color: var(--text-secondary);
}

.glass-nav .links a:hover {
    color: var(--brand-primary);
}

/* --- Buttons --- */
.btn-primary {
    background: var(--brand-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-base);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* --- Viral Card (Feed Item) --- */
.viral-card {
    background: var(--card-bg);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .viral-card {
        border-radius: 0;
        /* Full width look on mobile */
        border-left: none;
        border-right: none;
        margin-bottom: 10px;
    }
}

.vc-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vc-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    object-fit: cover;
}

.vc-content {
    padding: 0 15px 15px;
}

.vc-actions {
    display: flex;
    border-top: 1px solid var(--border-default);
}

.btn-action {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* --- Product Card --- */
.product-card {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s;
    border: 1px solid var(--border-default);
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-primary);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.price-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin: 10px 0;
}

.price-new {
    color: var(--success);
    font-weight: bold;
    font-size: 1.2rem;
}

.price-old {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   MOBILE NAV & HEADERS
   ======================================== */

/* Mobile Top Search Bar */
.mobile-search-bar {
    position: fixed;
    top: 60px;
    /* Below Main Header */
    left: 0;
    width: 100%;
    padding: 8px 15px;
    background: var(--secondary-bg);
    z-index: 900;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
}

.mobile-search-bar input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-default);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
}

/* Mobile Category Pills */
.mobile-cat-bar {
    position: fixed;
    top: 110px;
    /* Below Search */
    left: 0;
    width: 100%;
    padding: 10px 15px;
    background: var(--primary-bg);
    z-index: 890;
    border-bottom: 1px solid var(--border-default);
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 10px;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.mobile-cat-bar::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome */
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.tag.active {
    background: var(--brand-primary);
    color: white;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(13, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-default);
    z-index: 2000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    gap: 4px;
    cursor: pointer;
}

.nav-item.active {
    color: var(--brand-primary);
}

.nav-item i {
    font-size: 1.4rem;
}

/* Center Floating Button on Mobile Nav */
.nav-item.ranking-btn {
    position: relative;
    top: -20px;
    background: var(--brand-gradient);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
    border: 4px solid var(--primary-bg);
}

.nav-item.ranking-btn i {
    font-size: 1.5rem;
    color: white;
}

/* ========================================
   MODALS
   ======================================== */
.ranking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3000;
    padding: 20px;
    padding-top: 80px;
    overflow-y: auto;
    display: none;
    /* JS toggles this */
    opacity: 0;
    transition: opacity 0.3s;
}

.ranking-modal.open {
    display: block;
    opacity: 1;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* --- Share Modal (Professional Glassmorphism) --- */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-modal.open {
    display: flex;
    opacity: 1;
}

.share-content {
    background: linear-gradient(145deg, rgba(20, 20, 25, 0.95), rgba(30, 30, 40, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.share-modal.open .share-content {
    transform: scale(1);
}

.share-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-title {
    color: var(--brand-primary);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.share-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.share-close:hover {
    color: white;
}

.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.share-copy-area {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-input-group {
    display: flex;
    gap: 10px;
}

.share-url-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: monospace;
}

.share-copy-btn {
    background: var(--brand-gradient);
    border: none;
    padding: 0 20px;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.share-copy-btn:hover {
    transform: scale(1.05);
}

/* ========================================
   UTILITIES
   ======================================== */
.hidden {
    display: none !important;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--elevated-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}