/* style.css - TradingView Style Guide with Liquid Glassmorphism */

:root {
    --primary-color: #2962ff;
    --primary-hover: #1e4bd8;
    --bg-dark: #0a0e17;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-dim: #b2b5be;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --accent-gradient: linear-gradient(135deg, #2962ff 0%, #9c27b0 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(41, 98, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(156, 39, 176, 0.15) 0%, transparent 40%);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 14, 23, 0.7);
    border-bottom: 1px solid var(--glass-border);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-container img {
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 500;
    transition: 0.3s;
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

.nav-links a.active {
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Hero Section - General (for subpages) */
.hero {
    padding: 100px 2rem 50px;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #fff 40%, #b2b5be 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Section - Home Only (with background image) */
.hero.home-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    background: url('images/bg.webp') no-repeat center center;
    background-size: cover;
    width: 100%;
    max-width: none;
    overflow: hidden;
    margin: 0;
}

.hero.home-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 14, 23, 0.4) 0%, rgba(10, 14, 23, 0.2) 50%, rgba(10, 14, 23, 0.8) 100%);
    z-index: 1;
}

.hero.home-hero > * {
    position: relative;
    z-index: 2;
}

.hero.home-hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 2rem;
    line-height: 1.2;
}

.hero.home-hero p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
}

.hero .btn-primary {
    background: var(--primary-color);
    color: white;
}

.hero .btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(41, 98, 255, 0.4);
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    transition: transform 0.3s, border-color 0.3s;
    box-shadow: var(--glass-shadow);
}

.glass-card:hover {
    transform: translateY(-10px);
    border-color: rgba(41, 98, 255, 0.4);
}

/* Chart Mockup Section */
.chart-preview-section {
    padding: 100px 2rem;
    text-align: center;
    background: #0a0e17;
    overflow: hidden;
}

.chart-preview-header h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: #fff;
}

.chart-preview-header p {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 4rem;
}

.mockup-container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px;
    border-radius: 12px;
    background: #131722;
    box-shadow: 0 0 100px rgba(41, 98, 255, 0.2), 0 0 50px rgba(156, 39, 176, 0.2);
}

/* Glow Effect behind mockup */
.mockup-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(41, 98, 255, 0.15) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.chart-mockup {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #131722;
    border: 1px solid #2a2e39;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mockup-toolbar {
    height: 45px;
    background: #1e222d;
    border-bottom: 1px solid #2a2e39;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
}

.toolbar-item {
    height: 30px;
    padding: 0 10px;
    background: transparent;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: 0.2s;
    gap: 6px;
}

.toolbar-item:hover {
    background: #2a2e39;
    color: #fff;
}

.toolbar-item:first-child {
    font-weight: 700;
    color: #fff;
    border-right: 1px solid #2a2e39;
    padding-right: 15px;
}

.mockup-content {
    flex: 1;
    display: grid;
    grid-template-columns: 50px 1fr 200px;
}

.mockup-sidebar {
    background: #1e222d;
    border-right: 1px solid #2a2e39;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 5px;
}

.sidebar-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.1rem;
}

.sidebar-icon:hover, .sidebar-icon.active {
    background: #2a2e39;
    color: var(--primary-color);
}

.mockup-main-chart {
    position: relative;
    background: #131722;
    padding: 0;
    overflow: hidden;
}

.chart-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(42, 46, 57, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42, 46, 57, 0.5) 1px, transparent 1px);
    background-size: 50px 50px;
}

.chart-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(41, 98, 255, 0.25) 0%, rgba(41, 98, 255, 0.05) 50%, transparent 100%);
    clip-path: polygon(0% 60%, 10% 55%, 20% 65%, 30% 40%, 40% 50%, 50% 30%, 60% 70%, 70% 50%, 80% 60%, 90% 20%, 100% 45%, 100% 100%, 0% 100%);
}

.chart-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2962ff;
    clip-path: polygon(0% 60%, 10% 55%, 20% 65%, 30% 40%, 40% 50%, 50% 30%, 60% 70%, 70% 50%, 80% 60%, 90% 20%, 100% 45%, 100% 46%, 90% 21%, 80% 61%, 70% 51%, 60% 71%, 50% 31%, 40% 51%, 30% 41%, 20% 66%, 10% 56%, 0% 61%);
    filter: drop-shadow(0 0 10px rgba(41, 98, 255, 0.8));
}

.chart-points .point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border: 2px solid #2962ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(41, 98, 255, 0.8);
    z-index: 5;
}

.chart-label {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(30, 34, 45, 0.8);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #2a2e39;
    color: #fff;
    z-index: 10;
}

.mockup-watchlist {
    background: #1e222d;
    border-left: 1px solid #2a2e39;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.watchlist-item {
    height: 45px;
    border-bottom: 1px solid #2a2e39;
    display: flex;
    align-items: center;
    padding: 0 15px;
    justify-content: space-between;
    font-size: 0.85rem;
    transition: background 0.2s;
    cursor: pointer;
}

.watchlist-item:hover {
    background: #2a2e39;
}

.watchlist-item .price {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 65px;
    text-align: right;
}

.watchlist-item .price.up {
    color: #089981;
}

.watchlist-item .price.down {
    color: #f23645;
}

.watchlist-item::after {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(41, 98, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: white;
}

/* AI Section */
.ai-section {
    padding: 100px 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ai-header {
    text-align: center;
    margin-bottom: 4rem;
}

.ai-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.ai-feature {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-feature i {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* New Sections Styles */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.section-header p {
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* Download Grid */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.download-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.download-card i {
    font-size: 4rem;
    color: var(--primary-color);
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.user-info h4 {
    margin-bottom: 2px;
}

.user-info span {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.stars {
    color: #ffc107;
    display: flex;
    gap: 4px;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    padding: 2rem;
    text-align: left;
}

.faq-item h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #fff;
}

.faq-item p {
    color: var(--text-dim);
}

/* Documentation Portal Styles */
.docs-container {
    padding-top: 4rem;
}

.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 100px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-group h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-group ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-group ul li a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.95rem;
    transition: 0.3s;
}

.sidebar-group ul li a:hover, .sidebar-group ul li a.active {
    color: #fff;
    padding-left: 5px;
}

.docs-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.doc-section {
    padding: 3rem;
    text-align: left;
}

.doc-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.doc-section h3 {
    font-size: 1.3rem;
    margin: 2rem 0 1rem;
    color: #fff;
}

.doc-section p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.info-box {
    background: rgba(41, 98, 255, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-box i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.doc-list {
    padding-left: 1.5rem;
    color: var(--text-dim);
}

.doc-list li {
    margin-bottom: 1rem;
}

.code-header {
    background: #1e222d;
    padding: 0.8rem 1.5rem;
    border-radius: 8px 8px 0 0;
    font-size: 0.85rem;
    color: var(--text-dim);
    border: 1px solid var(--glass-border);
    border-bottom: none;
}

.code-block {
    background: #0a0e17;
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--glass-border);
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block code {
    color: #b2b5be;
}

.feature-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step-num {
    font-size: 2rem;
    font-weight: 800;
    color: rgba(41, 98, 255, 0.2);
}

.step h4 {
    color: #fff;
}

.step p {
    font-size: 0.9rem;
}

/* Download Page Specifics */
.download-card-full {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 3rem 2rem;
}

.download-card-full i {
    font-size: 4rem;
    color: var(--primary-color);
}

.version-tag {
    background: rgba(41, 98, 255, 0.15);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.file-info {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.system-requirements, .changelog-section {
    margin-top: 6rem;
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.changelog-item {
    padding: 2rem;
    text-align: left;
}

.changelog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.changelog-header .version {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.changelog-header .date {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.changelog-content {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.changelog-content li {
    display: flex;
    gap: 12px;
    color: var(--text-dim);
    line-height: 1.5;
}

.tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.tag-new { background: rgba(8, 153, 129, 0.2); color: #089981; }
.tag-improve { background: rgba(41, 98, 255, 0.2); color: #2962ff; }
.tag-fix { background: rgba(242, 54, 69, 0.2); color: #f23645; }

/* Advanced Doc Elements */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.doc-table th, .doc-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.doc-table th {
    background: rgba(41, 98, 255, 0.1);
    color: var(--primary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.doc-table td {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.doc-table tr:last-child td {
    border-bottom: none;
}

.doc-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Grid Layouts */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Footer */
footer {
    padding: 4rem 2rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.3);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: var(--text-dim);
    text-decoration: none;
    transition: 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.copyright {
    text-align: center;
    margin-top: 4rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* Mobile menu logic in JS */
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding-top: 120px;
    }
    
    .hero h1 {
        font-size: 3rem;
    }

    .mockup-content {
        grid-template-columns: 40px 1fr;
    }

    .mockup-watchlist {
        display: none;
    }

    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
        margin-bottom: 2rem;
    }

    .doc-section {
        padding: 1.5rem;
    }
}

/* Mobile Menu Button */
.menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-btn {
        display: block;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeInUp 0.8s ease forwards;
}
