/* ============================================
   CSS Variables - Professional Stock Market Theme
   ============================================ */
:root {
    /* Primary Colors - Modern Stock Market Theme */
    --primary-color: #00d4ff;
    --secondary-color: #0099cc;
    --accent-color: #ff6b35;
    
    /* Background Colors */
    --bg-dark: #0a0e1a;
    --bg-darker: #050710;
    --bg-card: rgba(10, 14, 26, 0.95);
    
    /* Text Colors */
    --text-primary: #e8f4f8;
    --text-secondary: #8b9dc3;
    
    /* Stock Market Colors */
    --success-color: #00ff88;
    --danger-color: #ff4757;
    --warning-color: #ffa502;
    --chart-green: #00ff88;
    --chart-red: #ff4757;
    
    /* UI Elements */
    --grid-color: rgba(0, 212, 255, 0.12);
    --glow-color: rgba(0, 212, 255, 0.5);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50px;
    
    /* Transitions */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto Mono', 'Courier New', monospace, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Background & Grid System
   ============================================ */
.stock-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-darker);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 80px 80px, 80px 80px, 20px 20px, 20px 20px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    z-index: -1;
    animation: stockGridMove 40s linear infinite;
}

@keyframes stockGridMove {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 80px 80px, 80px 80px, 20px 20px, 20px 20px;
    }
}

/* ============================================
   Main Content Container
   ============================================ */
.stock-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    background: var(--bg-dark);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
        linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px, 60px 60px, 15px 15px, 15px 15px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    animation: stockGridMove 30s linear infinite, stockContainerGlow 4s ease-in-out infinite alternate;
    box-shadow: 
        inset 0 0 100px rgba(0, 212, 255, 0.12),
        0 0 200px rgba(0, 212, 255, 0.06),
        inset 0 0 60px rgba(255, 107, 53, 0.06);
    min-height: 100vh;
    border-left: 1px solid rgba(0, 212, 255, 0.25);
    border-right: 1px solid rgba(0, 212, 255, 0.25);
    position: relative;
    overflow-x: hidden;
}

.stock-container::before,
.stock-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    z-index: 1;
}

.stock-container::before {
    top: 0;
    animation: stockBorderFlow 3s linear infinite;
}

.stock-container::after {
    bottom: 0;
    animation: stockBorderFlow 3s linear infinite reverse;
}

@keyframes stockContainerGlow {
    0% {
        box-shadow: 
            inset 0 0 100px rgba(0, 212, 255, 0.12),
            0 0 200px rgba(0, 212, 255, 0.06),
            inset 0 0 60px rgba(255, 107, 53, 0.06);
    }
    100% {
        box-shadow: 
            inset 0 0 120px rgba(0, 212, 255, 0.18),
            0 0 250px rgba(0, 212, 255, 0.1),
            inset 0 0 80px rgba(255, 107, 53, 0.1);
    }
}

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

.stock-logo-image {
    width: 100%;
    max-width: 500px;
    display: block;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ============================================
   Container & Layout
   ============================================ */
.stock-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ============================================
   Hero Section
   ============================================ */
.stock-header {
    padding: var(--spacing-lg) 0 var(--spacing-xl);
    text-align: center;
    position: relative;
    z-index: 2;
}

.stock-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-md);
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 40px var(--glow-color), 0 0 80px var(--glow-color);
    animation: stockFloat 3s ease-in-out infinite;
    display: block;
}

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

.stock-header h1 {
    font-size: 2.8rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    filter: drop-shadow(0 0 30px var(--glow-color));
    animation: stockGlow 2s ease-in-out infinite alternate;
    font-weight: 700;
    letter-spacing: -1px;
}

@keyframes stockGlow {
    from {
        filter: drop-shadow(0 0 10px var(--glow-color));
    }
    to {
        filter: drop-shadow(0 0 20px var(--glow-color));
    }
}

.stock-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

/* ============================================
   Search Widget - Stock Symbol Input
   ============================================ */
.stock-search {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.stock-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.1rem;
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-normal);
    box-shadow: 0 0 20px var(--glow-color);
    font-family: 'Roboto Mono', monospace;
}

.stock-input:focus {
    box-shadow: 0 0 30px var(--glow-color);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.stock-btn-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: var(--spacing-sm) 2.5rem;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-full);
    color: var(--bg-dark);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Roboto Mono', monospace;
}

.stock-btn-search:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 5px 20px var(--glow-color);
}

/* ============================================
   Section Titles
   ============================================ */
.stock-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

.stock-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* ============================================
   Market Data Tables - Stock Trading Style
   ============================================ */
.stock-data {
    padding: var(--spacing-xl) 0;
    position: relative;
    z-index: 2;
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.stock-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border: 1px solid rgba(0, 212, 255, 0.25);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
}

.stock-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.25);
    transform: translateY(-4px);
}

.stock-card-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.35);
    padding-bottom: var(--spacing-sm);
}

/* Stock Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto Mono', monospace;
}

th {
    background: rgba(0, 212, 255, 0.1);
    padding: var(--spacing-sm);
    text-align: left;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    padding: var(--spacing-sm);
    border-bottom: 1px solid rgba(0, 212, 255, 0.12);
    font-family: 'Roboto Mono', monospace;
    transition: background-color var(--transition-fast);
}

tr:hover {
    background: rgba(0, 212, 255, 0.06);
}

tr:hover td {
    background: rgba(0, 212, 255, 0.06);
}

.stock-rank {
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
    width: 60px;
}

.stock-symbol {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.stock-score {
    font-weight: bold;
    color: var(--success-color);
    text-align: right;
    font-size: 1.1rem;
}

/* ============================================
   Learning/Insights Section
   ============================================ */
.stock-topics {
    padding: var(--spacing-xl) 0;
    position: relative;
    z-index: 2;
}

.stock-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.stock-topic-card {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 212, 255, 0.25);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
}

.stock-topic-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--glow-color);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stock-topic-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px var(--glow-color);
}

.stock-topic-card:hover::after {
    opacity: 1;
}

.stock-topic-card h3 {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    font-weight: 600;
}

.stock-topic-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ============================================
   CTA/Action Section
   ============================================ */
.stock-cta {
    padding: var(--spacing-xl) 0;
    text-align: center;
    background: rgba(0, 212, 255, 0.1);
    position: relative;
    z-index: 2;
}

.stock-cta h2 {
    font-size: 2.2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    font-weight: 600;
}

.stock-cta p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.stock-btn-cta {
    padding: 1.2rem var(--spacing-xl);
    font-size: 1.1rem;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-full);
    color: var(--bg-dark);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 5px 20px var(--glow-color);
    font-family: 'Roboto Mono', monospace;
}

.stock-btn-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--glow-color);
}

/* ============================================
   Footer
   ============================================ */
.stock-footer {
    background: var(--bg-darker);
    padding: var(--spacing-xl) 0 var(--spacing-sm);
    border-top: 1px solid var(--primary-color);
    position: relative;
    z-index: 2;
}

.stock-footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.stock-footer-wrap > div {
    flex: 1;
    min-width: 250px;
}

.stock-footer-wrap h3,
.stock-footer-wrap h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.stock-footer-wrap p {
    color: var(--text-secondary);
}

.stock-footer-menu {
    list-style: none;
}

.stock-footer-menu li {
    margin-bottom: var(--spacing-xs);
}

.stock-footer-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.stock-footer-menu a:hover {
    color: var(--primary-color);
}

.stock-footer-credits {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(0, 212, 255, 0.25);
    color: var(--text-secondary);
}

/* ============================================
   Modal Styles
   ============================================ */
.stock-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(10px);
    animation: stockModalFadeIn 0.3s ease-out;
}

.stock-modal-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes stockModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.stock-modal-box {
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 0 50px var(--glow-color), 0 0 100px var(--glow-color);
    animation: stockModalSlideIn 0.4s ease-out;
    text-align: center;
}

@keyframes stockModalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.stock-modal-close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-md);
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    background: none;
    border: none;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stock-modal-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
    background: rgba(0, 212, 255, 0.12);
}

.stock-modal-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--spacing-lg);
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 30px var(--glow-color);
    animation: stockPulse 2s ease-in-out infinite;
}

@keyframes stockPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 30px var(--glow-color);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 50px var(--glow-color);
    }
}

.stock-modal-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.stock-modal-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

.stock-modal-btn {
    padding: 1.2rem var(--spacing-xl);
    font-size: 1.1rem;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-full);
    color: var(--bg-dark);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 5px 20px var(--glow-color);
    font-family: 'Roboto Mono', monospace;
}

.stock-modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px var(--glow-color);
}

/* ============================================
   Cookie Consent Banner
   ============================================ */
.stock-cookie {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--primary-color);
    padding: var(--spacing-md);
    z-index: 9998;
    box-shadow: 0 -5px 30px var(--glow-color);
    transform: translateY(100%);
    transition: transform 0.4s ease-out;
}

.stock-cookie-visible {
    transform: translateY(0);
}

.stock-cookie-wrap {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.stock-cookie-info {
    flex: 1;
    min-width: 300px;
}

.stock-cookie-info h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
    font-size: 1.2rem;
    font-weight: 600;
}

.stock-cookie-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.stock-cookie-info a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.stock-cookie-info a:hover {
    color: var(--primary-color);
}

.stock-cookie-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.stock-cookie-btn {
    padding: 0.8rem var(--spacing-lg);
    border: none;
    border-radius: var(--radius-full);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.95rem;
    font-family: 'Roboto Mono', monospace;
}

.stock-cookie-btn-accept {
    background: var(--primary-color);
    color: var(--bg-dark);
    box-shadow: 0 3px 15px var(--glow-color);
}

.stock-cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px var(--glow-color);
}

.stock-cookie-btn-decline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

.stock-cookie-btn-decline:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   Animations
   ============================================ */
@keyframes stockFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stock-fade-in {
    animation: stockFadeIn 0.6s ease-out;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Mobile: <= 798px */
@media (max-width: 798px) {
    .stock-container {
        max-width: 100%;
    }
    
    .stock-wrapper {
        padding: 0 var(--spacing-sm);
    }

    .stock-header {
        padding: var(--spacing-md) 0 var(--spacing-xl);
    }

    .stock-logo {
        width: 100px;
        height: 100px;
        margin-bottom: var(--spacing-sm);
    }

    .stock-header h1 {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }

    .stock-header p {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }

    .stock-search {
        padding: 0 var(--spacing-sm);
    }

    .stock-input {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 1rem;
    }

    .stock-btn-search {
        position: static;
        transform: none;
        width: 100%;
        margin-top: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .stock-title {
        font-size: 1.8rem;
    }

    .stock-subtitle {
        font-size: 0.95rem;
        padding: 0 var(--spacing-sm);
        margin-bottom: var(--spacing-lg);
    }

    .stock-grid,
    .stock-topics-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .stock-card,
    .stock-topic-card {
        padding: var(--spacing-md);
    }

    table {
        min-width: 100%;
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.8rem 0.5rem;
        font-size: 0.85rem;
    }

    .stock-cta h2 {
        font-size: 1.8rem;
        padding: 0 var(--spacing-sm);
    }

    .stock-cta p {
        font-size: 1rem;
        padding: 0 var(--spacing-sm);
    }

    .stock-btn-cta {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 1rem;
    }

    .stock-footer {
        padding: var(--spacing-lg) 0 var(--spacing-sm);
    }

    .stock-footer-wrap {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .stock-cookie-wrap {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 var(--spacing-sm);
    }

    .stock-cookie-actions {
        width: 100%;
    }

    .stock-cookie-btn {
        flex: 1;
        padding: 0.7rem var(--spacing-md);
    }

    .stock-modal-box {
        padding: var(--spacing-lg) var(--spacing-md);
        width: 95%;
        max-width: 100%;
    }

    .stock-modal-title {
        font-size: 1.5rem;
    }

    .stock-modal-text {
        font-size: 1rem;
    }

    .stock-modal-logo {
        width: 80px;
        height: 80px;
    }

    .stock-modal-btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 1rem;
        width: 100%;
    }
}

/* Desktop: > 798px */
@media (min-width: 799px) {
    .stock-container {
        max-width: 500px;
    }
    
    .stock-grid,
    .stock-topics-grid {
        grid-template-columns: 1fr;
    }
}
