:root {
    --primary-color: #1a73e8;
    --secondary-color: #f8f9fa;
    --text-color: #202124;
    --text-light: #5f6368;
    --border-color: #dadce0;
    --success-color: #0f9d58;
    --danger-color: #ea4335;
    --warning-color: #fbbc04;
    --neutral-color: #9e9e9e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 0.5rem 0;
    background-color: var(--secondary-color);
    margin-bottom: 1rem;
}

.hero-section h1 {
    font-size: 1.25rem;
    margin-bottom: 0.1rem;
    color: var(--primary-color);
    font-weight: bold;
}

.hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0;
}

/* Market Overview */
.market-overview-section {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.market-overview-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.overview-content {
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Market Summary Styles */
.market-summary {
    margin-bottom: 2rem;
}

.market-summary h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.top-movers {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.gainers, .losers {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.gainers {
    border-left: 4px solid #28a745;
}

.losers {
    border-left: 4px solid #dc3545;
}

.gainers h3 {
    color: #28a745;
    margin-bottom: 1rem;
}

.losers h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.top-movers ul {
    list-style: none;
    padding: 0;
}

.top-movers li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.top-movers li:last-child {
    border-bottom: none;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-card h3 {
    margin-bottom: 0.5rem;
}

.post-card h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.post-card h3 a:hover {
    color: var(--primary-color);
}

.post-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
}

.tag:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Stock Analysis Page */
.stock-analysis-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.stock-analysis h1 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.meta {
    color: var(--text-light);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.content {
    line-height: 1.8;
}

.content h2 {
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.content h3 {
    margin: 1.5rem 0 0.75rem;
    color: var(--text-color);
}

.content p {
    margin-bottom: 1rem;
}

.content ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--secondary-color);
    font-weight: 600;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat {
    text-align: center;
    padding: 1rem;
    background-color: var(--secondary-color);
    border-radius: 8px;
}

.stat .label {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat .value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat .value.positive {
    color: var(--success-color);
}

.stat .value.negative {
    color: var(--danger-color);
}

/* Support/Resistance Levels */
.sr-levels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1rem 0;
}

.resistance, .support {
    background-color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
}

.resistance h4, .support h4 {
    margin-bottom: 1rem;
}

/* Trading Signals */
.trading-signals {
    background-color: #f0f7ff;
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
}

.trading-signals li {
    margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
    background-color: var(--text-color);
    color: #fff;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Disclaimer */
.disclaimer {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 1rem;
    margin: 2rem 0;
}

.disclaimer p {
    margin: 0;
    color: #856404;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--secondary-color);
    border-radius: 8px;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}

.cta-button:hover {
    background-color: #1557b0;
}

/* Market Prediction Styles */
.market-prediction {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.prediction-header h3 {
    margin-bottom: 1rem;
}

.direction-bullish {
    color: var(--success-color);
    font-weight: bold;
}

.direction-bearish {
    color: var(--danger-color);
    font-weight: bold;
}

.direction-sideways {
    color: var(--warning-color);
    font-weight: bold;
}

.prediction-details h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Intraday Levels */
.intraday-levels {
    margin: 2rem 0;
}

.trading-zones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.buy-zone, .sell-zone {
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.buy-zone {
    background-color: #e8f5e9;
    border: 2px solid var(--success-color);
}

.sell-zone {
    background-color: #ffebee;
    border: 2px solid var(--danger-color);
}

.zone-range {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

.buy-zone .zone-range {
    color: var(--success-color);
}

.sell-zone .zone-range {
    color: var(--danger-color);
}

.zone-action {
    font-size: 0.9rem;
    color: var(--text-light);
}

.pivot-table {
    margin: 1rem 0;
}

.pivot-row {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.targets-stoploss {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.long-positions, .short-positions {
    background-color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
}

.long-positions h5 {
    color: var(--success-color);
    margin-bottom: 1rem;
}

.short-positions h5 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* SEO-friendly hidden text for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Better link styling for SEO */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

article a {
    font-weight: 500;
}

/* Unified Analysis Styles */
.market-prediction.unified {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8eaf6 100%);
    border: 2px solid var(--primary-color);
}

/* Ensure market prediction gets same AI styling */
.market-prediction.ml-enhanced {
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 8px;
}

.direction-neutral {
    color: var(--neutral-color);
    font-weight: bold;
}

.confidence-meter {
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.confidence-meter .meter {
    flex: 1;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.confidence-meter .meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger-color) 0%, var(--warning-color) 50%, var(--success-color) 100%);
    transition: width 0.3s ease;
}

.confidence-value {
    font-weight: bold;
    min-width: 50px;
}

.trading-signals.unified {
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary-color);
}

.unified-signal {
    font-weight: 500;
}

.conflicts {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
}

.conflict-warning {
    color: var(--warning-color);
    font-style: italic;
}

.ml-enhanced {
    border: 2px solid #673ab7;
    background: linear-gradient(135deg, #f3e5f5 0%, #ede7f6 100%);
}

.ml-note {
    background-color: #e8eaf6;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-style: italic;
    color: #5e35b1;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 15px;
    }
    
    /* Hide Header on Mobile */
    .site-header {
        display: none;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }
    
    .hero-section h1 {
        font-size: 1.2rem;
    }
    
    .hero-subtitle {
        font-size: 0.8rem;
    }
    
    /* Posts Grid */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .post-card {
        padding: 1rem;
    }
    
    .post-card h3 {
        font-size: 1.1rem;
    }
    
    .post-excerpt {
        font-size: 0.9rem;
    }
    
    /* Market Overview */
    .market-overview-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .market-overview-section h2 {
        font-size: 1.3rem;
    }
    
    /* Top Movers - Stack on mobile */
    .top-movers {
        flex-direction: column;
        gap: 1rem;
    }
    
    .gainers, .losers {
        padding: 1rem;
    }
    
    /* Tables */
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    /* Quick Stats */
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat {
        padding: 0.75rem;
    }
    
    .stat .value {
        font-size: 1.2rem;
    }
    
    /* Support/Resistance */
    .sr-levels {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .resistance, .support {
        padding: 1rem;
    }
    
    /* Trading Zones */
    .trading-zones {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .zone-range {
        font-size: 1.2rem;
    }
    
    /* Targets/Stoploss */
    .targets-stoploss {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .site-footer {
        padding: 2rem 0 1rem;
    }
    
    /* Stock Analysis Page */
    .stock-analysis-page {
        padding: 1rem 0;
    }
    
    .stock-analysis h1 {
        font-size: 1.5rem;
    }
    
    /* Ad Banners */
    .ad-banner {
        margin: 1rem auto;
    }
    
    .ad-banner img {
        max-width: 100%;
        height: auto;
    }
    
    /* CTA Section */
    .cta-section {
        padding: 2rem 1rem;
    }
    
    .cta-section h2 {
        font-size: 1.3rem;
    }
    
    /* Blog Cards */
    .blog-card {
        padding: 1.5rem 0;
    }
    
    .blog-card h3 {
        font-size: 1.2rem;
    }
    
    /* Content sections */
    .content h2 {
        font-size: 1.3rem;
        margin: 1.5rem 0 0.75rem;
    }
    
    .content h3 {
        font-size: 1.1rem;
    }
    
    /* Market Prediction */
    .market-prediction {
        padding: 1.5rem;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem;
        padding: 0.25rem 0;
    }
}

/* Very small devices */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    
    .hero-section h1 {
        font-size: 1.1rem;
    }
    
    .post-card h3 {
        font-size: 1rem;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.4rem;
    }
}

/* Stocks List Page */
.stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stock-item {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s;
}

.stock-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stock-item h3 {
    margin-bottom: 0.5rem;
}

.stock-item .symbol {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.latest-analysis {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.latest-analysis time {
    font-size: 0.85rem;
    color: var(--text-light);
}

.no-analysis {
    color: var(--text-light);
    font-style: italic;
}

/* Archive and History Pages */
.archive-posts, .history-posts {
    margin: 2rem 0;
}

.archive-item, .history-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.archive-item:last-child, .history-item:last-child {
    border-bottom: none;
}

.archive-item h2, .history-item h2 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 3rem 0;
    padding: 1rem;
}

.pagination a {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.pagination a:hover {
    background-color: #1557b0;
    text-decoration: none;
}

.page-info {
    color: var(--text-light);
}

/* ML Enhanced Styles */
.ml-enhanced {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border: 2px solid var(--primary-color);
    position: relative;
}

.ml-enhanced::before {
    content: "AI";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.ml-note {
    background-color: #e3f2fd;
    padding: 0.75rem;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    font-style: italic;
}

.prediction-header p {
    margin: 0.5rem 0;
}

.volatility-info {
    background-color: #fff3cd;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.volatility-info h4 {
    margin-bottom: 0.5rem;
    color: #856404;
}

/* Advertisement Banner Styles */
.ad-banner {
    width: 100%;
    max-width: 728px;
    margin: 2rem auto;
    text-align: center;
}

.ad-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ad-banner a {
    display: inline-block;
    text-decoration: none;
}

/* Specific Ad Banner Positions */
.ad-banner-top {
    margin-top: 0;
    margin-bottom: 2rem;
}

.ad-banner-middle {
    margin: 3rem auto;
}

.ad-banner-article-top {
    margin-top: 0;
    margin-bottom: 2rem;
}

.ad-banner-article-bottom {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Blog Style Layout */
.blog-style {
    max-width: 800px;
    margin: 0 auto;
}

.blog-style .posts-grid {
    grid-template-columns: 1fr;
    gap: 0;
}

.blog-card {
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 2rem 0;
    margin-bottom: 0;
}

.blog-card:first-child {
    padding-top: 0;
}

.blog-card:last-child {
    border-bottom: none;
}

.blog-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-card .post-excerpt {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
    opacity: 0.9;
}

/* In-feed Ad Style */
.in-feed-ad {
    border: none;
    background-color: transparent;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.in-feed-ad .ad-banner {
    margin: 0 auto;
}

/* Responsive Ad Banners */
@media (max-width: 768px) {
    .ad-banner {
        max-width: 320px;
        height: 50px;
    }
    
    .ad-placeholder span {
        font-size: 12px;
    }
}