/* insightstock AI - Premium Stock Analysis Platform */
:root {
    --primary: #0F172A;
    --secondary: #2563EB;
    --success: #16A34A;
    --danger: #DC2626;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --text: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 48px rgba(15, 23, 42, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
    --header-height: 72px;
}

[data-theme="dark"] {
    --bg: #0B1120;
    --card: #1E293B;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --border: #334155;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    padding: 0.75rem 0;
}

[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.95);
}

.site-header.scrolled {
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
}

.logo-img { height: 40px; width: auto; }

.nav-link {
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.nav-link:hover { color: var(--secondary); }

.btn-primary-custom {
    background: var(--secondary);
    border: none;
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary-custom:hover {
    background: #1D4ED8;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-outline-custom {
    border: 2px solid var(--secondary);
    color: var(--secondary);
    background: transparent;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-custom:hover {
    background: var(--secondary);
    color: #fff;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

/* Ticker */
.market-ticker {
    background: var(--primary);
    color: #fff;
    padding: 0.6rem 0;
    overflow: hidden;
}

.ticker-wrap {
    display: flex;
    animation: ticker 40s linear infinite;
    white-space: nowrap;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 2rem;
    font-size: 0.85rem;
}

.ticker-item .name { font-weight: 600; opacity: 0.9; }
.ticker-item .value { font-weight: 700; }
.ticker-item .change.positive { color: #4ADE80; }
.ticker-item .change.negative { color: #F87171; }

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Hero */
.hero-section {
    padding: calc(var(--header-height) + 3rem) 0 4rem;
    background: linear-gradient(135deg, var(--bg) 0%, #EFF6FF 50%, var(--bg) 100%);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, var(--bg) 0%, #1E293B 50%, var(--bg) 100%);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.hero-title span { color: var(--secondary); }

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 540px;
}

.hero-chart {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    min-height: 360px;
}

.floating-card {
    position: absolute;
    background: var(--card);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    font-size: 0.85rem;
    animation: float 3s ease-in-out infinite;
    border: 1px solid var(--border);
}

.floating-card:nth-child(1) { top: 10%; right: -10%; animation-delay: 0s; }
.floating-card:nth-child(2) { bottom: 20%; left: -5%; animation-delay: 1s; }
.floating-card:nth-child(3) { top: 50%; right: 5%; animation-delay: 2s; }

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

/* Cards */
.section { padding: 5rem 0; }

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    text-align: center;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.premium-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.index-card .index-name { font-weight: 600; font-size: 0.9rem; color: var(--text-muted); }
.index-card .index-value { font-size: 1.5rem; font-weight: 700; margin: 0.25rem 0; }
.index-card .index-change.positive { color: var(--success); }
.index-card .index-change.negative { color: var(--danger); }

.sparkline { height: 40px; margin-top: 0.75rem; }

/* Tables */
.stock-table {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stock-table table { margin: 0; }

.stock-table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 1rem;
    border: none;
}

.stock-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 0.9rem;
}

.stock-table tr:hover td { background: rgba(37, 99, 235, 0.04); }

.change-positive { color: var(--success); font-weight: 600; }
.change-negative { color: var(--danger); font-weight: 600; }

/* Trending Cards */
.trending-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: var(--transition);
    height: 100%;
}

.trending-card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-lg);
}

.stock-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--secondary), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
}

.score-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.score-high { background: rgba(22, 163, 74, 0.15); color: var(--success); }
.score-medium { background: rgba(37, 99, 235, 0.15); color: var(--secondary); }
.score-low { background: rgba(220, 38, 38, 0.15); color: var(--danger); }

.risk-low { color: var(--success); }
.risk-medium { color: #EAB308; }
.risk-high { color: var(--danger); }

/* Feature Cards */
.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(22, 163, 74, 0.1));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

/* Pricing */
.pricing-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
    position: relative;
}

.pricing-card.popular {
    border-color: var(--secondary);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.pricing-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
    color: #fff;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

[data-theme="dark"] .pricing-price { color: var(--text); }

.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
}

.pricing-features li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pricing-features li i { color: var(--success); margin-right: 0.5rem; }

/* Testimonials */
.testimonial-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
    height: 100%;
}

.testimonial-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

/* FAQ */
.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover { background: rgba(37, 99, 235, 0.04); }

.faq-answer {
    padding: 0 1.5rem 1.25rem;
    color: var(--text-muted);
    display: none;
}

.faq-item.active .faq-answer { display: block; }
.faq-item.active .faq-question i { transform: rotate(180deg); }

/* Newsletter */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1E3A5F 100%);
    color: #fff;
    padding: 4rem 0;
    border-radius: var(--radius);
}

.newsletter-form .form-control {
    border-radius: 8px 0 0 8px;
    border: none;
    padding: 0.75rem 1.25rem;
}

.newsletter-form .btn {
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1.5rem;
    background: var(--secondary);
    border: none;
    font-weight: 600;
}

/* Footer */
.site-footer {
    background: var(--primary);
    color: #94A3B8;
    padding: 4rem 0 2rem;
}

.site-footer h5 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.site-footer a {
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.25rem 0;
    transition: var(--transition);
}

.site-footer a:hover { color: #fff; }

.social-icons a {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--secondary);
    color: #fff;
}

/* Carousel */
.screenshot-carousel .carousel-item img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, transparent 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 991.98px) {
    .hero-section { padding: calc(var(--header-height) + 2rem) 0 3rem; }
    .pricing-card.popular { transform: none; }
    .floating-card { display: none; }
}

@media (max-width: 767.98px) {
    .section { padding: 3rem 0; }
}
