/* Modern White & Black Theme - Add Metrics Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

@font-face {
    font-family: 'GmarketSansMedium';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'GmarketSansBold';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'GmarketSansLight';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff') format('woff');
    font-weight: 300;
    font-style: normal;
}

:root {
    --bg-color: #ffffff;
    --accent-cyan: #000000;
    --accent-blue: #333333;
    --text-primary: #111111;
    --text-secondary: #555555;
    --glass-border: #e5e5e5;
    --card-bg: #ffffff;
}

body {
    font-family: 'GmarketSansMedium', sans-serif !important;
    background: #ffffff !important;
    background-image: none !important;
    color: var(--text-primary) !important;
}

.glow-bg {
    display: none !important;
}

/* Fix Hero Text Visibility */
.gradient-text {
    background: none !important;
    -webkit-text-fill-color: #000000 !important;
    color: #000000 !important;
}

.hero-content p,
.subtitle {
    color: #333333 !important;
    font-weight: 500 !important;
}

/* Layout & Containers */
section {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 6rem 2rem !important;
    box-sizing: border-box !important;
}

nav {
    max-width: 100% !important;
    padding: 1.5rem 5% !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid #eee !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.nav-links a {
    color: #333 !important;
    font-weight: 600 !important;
    font-family: 'GmarketSansMedium', sans-serif !important;
    font-size: 0.95rem !important;
}

.nav-links a:hover {
    color: #000 !important;
    text-decoration: underline !important;
}

.logo,
.logo span {
    color: #000 !important;
    font-family: 'GmarketSansBold', sans-serif !important;
}

/* Typography */
h1,
h2,
h3,
h4,
.section-title,
.subsection-title {
    font-family: 'GmarketSansBold', sans-serif !important;
    color: #000 !important;
}

.section-title {
    color: #000000 !important;
    border-bottom: 2px solid #000;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    display: block;
    width: 100%;
    text-align: left;
}

.section-desc {
    color: #666 !important;
    font-family: 'GmarketSansLight', sans-serif !important;
    margin-bottom: 3rem !important;
    text-align: left !important;
}

.subsection-title {
    border-left: 4px solid #000;
    padding-left: 1rem;
    margin-top: 4rem !important;
    font-size: 1.5rem;
}

/* Cards */
.stock-card,
.watch-card,
.chart-card,
.insight-card,
.results-wrapper,
.safety-card {
    display: flex !important;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem !important;
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    color: #000 !important;
    width: 100% !important;
    transition: all 0.2s ease !important;
}

/* Horizontal List Item Style for Stocks */
.stock-card,
.watch-card {
    flex-direction: row !important;
    align-items: center !important;
    /* Center vertically */
    padding: 1.5rem !important;
    min-height: 100px;
    justify-content: space-between !important;
}

.stock-card:hover,
.watch-card:hover {
    transform: translateY(-3px) !important;
    border-color: #000000 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
    background: #fdfdfd !important;
}

/* Inner Layout for Stock Cards */
/* Left: Logo */
.logo-wrapper {
    width: 52px !important;
    height: 52px !important;
    background: #fff !important;
    border-radius: 10px !important;
    padding: 2px !important;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.official-logo {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    padding: 4px !important;
}

.stock-logo {
    font-family: 'GmarketSansBold', sans-serif !important;
    border-radius: 8px !important;
    background: #f0f0f0 !important;
    color: #111 !important;
    border: 1px solid #ccc !important;
}

/* Middle: Info (Name + Desc) & Metrics */
.stock-info-wrapper {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    margin-left: 1.5rem !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

.stock-name {
    margin: 0 !important;
    font-size: 1.2rem !important;
    color: #000 !important;
    font-family: 'GmarketSansBold', sans-serif !important;
    line-height: 1.2;
}

.stock-desc {
    font-size: 0.9rem !important;
    color: #666 !important;
    font-family: 'GmarketSansMedium', sans-serif !important;
}

/* Metrics Grid - New Feature */
.stock-metrics {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem !important;
    margin-top: 0.2rem !important;
    flex-wrap: wrap;
}

.metric-item {
    font-size: 0.8rem !important;
    color: #444 !important;
    background: #f5f5f5 !important;
    padding: 0.2rem 0.6rem !important;
    border-radius: 4px !important;
    font-family: 'GmarketSansMedium', sans-serif !important;
    border: 1px solid #eee !important;
}

.metric-label {
    color: #888;
    margin-right: 4px;
    font-size: 0.75rem;
}

.metric-value {
    color: #000;
    font-weight: 700;
}

/* Right: Arrow or Badge */
.card-arrow {
    margin-left: auto !important;
    color: #ccc !important;
    font-size: 1.5rem !important;
}

.stock-card:hover .card-arrow,
.watch-card:hover .card-arrow {
    color: #000 !important;
    transform: translateX(5px);
}

/* Legacy Support for Top Key Players existing structure overrides */
/* Header Row Styling (Dynamic) */
.header-row {
    font-weight: 700 !important;
    background: #f4f4f4 !important;
    border-bottom: 2px solid #000 !important;
    color: #000 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

/* Summary Stats Styling */
.total-summary {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    margin-top: 1.5rem !important;
    padding-top: 1.5rem !important;
    border-top: 1px solid #eee !important;
    width: 100% !important;
    gap: 1rem !important;
}

.summary-item {
    text-align: center !important;
    flex: 1 !important;
}

.summary-item h4 {
    font-size: 0.9rem !important;
    color: #666 !important;
    margin-bottom: 0.5rem !important;
}

.big-number {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #000 !important;
}

.big-number.profit {
    color: #d32f2f !important;
    /* Red for profit */
}

.big-number.loss {
    color: #0044cc !important;
    /* Blue for loss */
}

/* Trade Row Colors */
.trade-row .profit {
    color: #d32f2f !important;
    font-weight: 700 !important;
}

.trade-row .loss {
    color: #0044cc !important;
    font-weight: 700 !important;
}

/* PC Table Layout Override */
@media (min-width: 769px) {
    .trade-log-list {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    .trade-row {
        display: grid !important;
        grid-template-columns: 1.5fr 2fr 2fr 1fr 1fr !important;
        /* Flexible columns for PC */
        width: 100% !important;
        gap: 1rem !important;
        padding: 1rem !important;
        border-bottom: 1px solid #eee !important;
        align-items: center !important;
    }

    .trade-row:first-child {
        font-weight: bold !important;
        border-bottom: 2px solid #000 !important;
        background: #f9f9f9 !important;
    }
}

/* Responsive */
@media (max-width: 768px) {

    /* Fix Hero Text being too large */
    h1,
    .gradient-text {
        font-size: 1.7rem !important;
        /* Reduced further */
        line-height: 1.3 !important;
        word-break: keep-all !important;
        text-align: center !important;
        width: 100% !important;
    }

    .hero-content p,
    .subtitle {
        font-size: 0.95rem !important;
        text-align: center !important;
        word-break: keep-all !important;
        padding: 0 1rem;
    }

    /* Fix Big Numbers (Stats) */
    .stat-value,
    .big-number {
        font-size: 1.8rem !important;
        /* Prevent huge numbers */
        line-height: 1.2 !important;
        word-break: break-all !important;
    }

    .stat-item {
        margin-bottom: 2rem !important;
        /* Add spacing between stacked stats */
    }

    /* Mobile Summary Stats */
    .total-summary {
        flex-wrap: wrap !important;
        gap: 1.5rem !important;
    }

    .summary-item {
        min-width: 45% !important;
        /* 2 items per row on mobile */
    }

    /* Fix Table Layout on Mobile (Horizontal Scroll) */
    .trade-log-list {
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 10px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Mobile-Specific Grid */
    .trade-row {
        display: grid !important;
        grid-template-columns: 90px 100px 100px 80px 70px !important;
        /* Adjusted for mobile */
        width: max-content !important;
        gap: 8px !important;
        padding: 0.8rem 0.5rem !important;
        font-size: 0.85rem !important;
        /* Smaller text on mobile */
        align-items: center !important;
    }

    .trade-row div {
        white-space: normal !important;
        /* Allow wrapping */
        word-break: keep-all !important;
        line-height: 1.2 !important;
    }

    /* Keep headers aligned */
    .trade-row:first-child {
        font-weight: bold !important;
        border-bottom: 2px solid #000 !important;
        background: #f9f9f9 !important;
    }

    /* Fix Nav Bar squashing */
    nav {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }

    .nav-links {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.8rem !important;
        width: 100% !important;
    }

    .nav-links a {
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }

    /* Fix Cards Stacking */
    .stock-card,
    .watch-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        min-height: auto;
    }

    .stock-info-wrapper {
        margin-left: 0 !important;
        margin-top: 1rem !important;
        width: 100%;
    }

    .stock-metrics {
        width: 100%;
        gap: 0.5rem;
    }
}