/* Base & Reset */
:root {
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-color: #111827;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #111827;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    font-family: 'Playfair Display', serif;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
    padding: 23px 0;
}

.main-nav a:hover {
    color: #111827;
}

.main-nav a.active {
    color: #2962ff;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #2962ff;
    border-radius: 3px 3px 0 0;
}

.time-display {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #111827;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mobile-menu-btn:hover {
    background: #f3f4f6;
}

/* Ticker Tape */
.ticker-tape {
    background-color: #111827;
    color: #ffffff;
    padding: 8px 0;
    overflow: hidden;
    position: relative;
    font-size: 0.85rem;
    font-weight: 500;
}

.ticker-content {
    white-space: nowrap;
    animation: ticker 240s linear infinite;
    display: inline-block;
    padding-left: 100%;
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-block;
    margin-right: 40px;
}

.ticker-item a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s;
}

.ticker-item a:hover {
    color: #60a5fa;
}

.ticker-source {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-left: 8px;
    text-transform: uppercase;
}

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

/* Layout */
.news-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 24px;
}

.news-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

.mt-40 {
    margin-top: 40px;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: #111827;
}

.source-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.source-badge.et { background-color: #fef2f2; color: #dc2626; }
.source-badge.mint { background-color: #f0fdf4; color: #16a34a; }
.source-badge.mc { background-color: #eff6ff; color: #2563eb; }

/* Article Cards */
.article-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid #f3f4f6;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.article-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #e5e7eb;
    overflow: hidden;
}

.article-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-img {
    transform: scale(1.05);
}

.article-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-date {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: #1f2937;
}

.article-card:hover .article-title {
    color: #2962ff;
}

.article-desc {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hero Grid (ET News) */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.hero-grid .article-card:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
}

.hero-grid .article-card:first-child .article-img-wrapper {
    padding-top: 0;
    width: 60%;
    min-height: 350px;
}

.hero-grid .article-card:first-child .article-content {
    width: 40%;
    padding: 30px;
    justify-content: center;
}

.hero-grid .article-card:first-child .article-title {
    font-size: 1.8rem;
    font-family: 'Playfair Display', serif;
}

.hero-grid .article-card:first-child .article-desc {
    font-size: 1.05rem;
    -webkit-line-clamp: 4;
}

@media (max-width: 768px) {
    .hero-grid .article-card:first-child {
        flex-direction: column;
    }
    .hero-grid .article-card:first-child .article-img-wrapper,
    .hero-grid .article-card:first-child .article-content {
        width: 100%;
    }
    .hero-grid .article-card:first-child .article-img-wrapper {
        padding-top: 56.25%;
        min-height: auto;
    }
}

/* Article List (LiveMint) */
.article-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Compact List (MoneyControl) */
.sidebar-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.compact-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.compact-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.compact-item:hover .compact-title {
    color: #2962ff;
}

.compact-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #f3f4f6;
}

.compact-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.compact-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-date {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Promo Box */
.promo-box {
    margin-top: 30px;
    background: linear-gradient(135deg, #1e3a8a, #2962ff);
    border-radius: 12px;
    padding: 30px 24px;
    color: white;
    text-align: center;
}

.promo-box h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.promo-box p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    background-color: white;
    color: #2962ff;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-primary:hover {
    background-color: #f3f4f6;
    transform: translateY(-2px);
}

/* Loading Skeletons */
.loading-skeleton {
    background: #e5e7eb;
    border-radius: 12px;
    height: 300px;
    animation: pulse 1.5s infinite;
}

.compact-list .loading-skeleton {
    height: 100px;
    margin-bottom: 16px;
    background: transparent;
    border: none;
    display: flex;
    gap: 16px;
}

.compact-list .loading-skeleton::before {
    content: '';
    width: 80px;
    height: 80px;
    background: #e5e7eb;
    border-radius: 8px;
    animation: pulse 1.5s infinite;
}

.compact-list .loading-skeleton::after {
    content: '';
    flex-grow: 1;
    height: 40px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-top: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

footer {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 0.85rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 60px;
    background-color: #ffffff;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 12px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    transition: background 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.modal-body {
    padding: 0;
}

#modal-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    background: #e5e7eb;
}

.modal-content-inner {
    padding: 30px 40px;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #6b7280;
}

#modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 24px;
}

#modal-text {
    font-size: 1.1rem;
    color: #374151;
    line-height: 1.8;
}

@media (max-width: 768px) {
    #modal-img { height: 250px; }
    .modal-content-inner { padding: 20px; }
    #modal-title { font-size: 1.8rem; }
}


/* Custom Market Action Widget */
.custom-market-widget {
    padding: 15px 20px 20px;
}
.market-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.market-tab {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.market-tab.active {
    background: rgba(41, 98, 255, 0.1);
    border-color: #2962ff;
    color: #2962ff;
}
.market-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.market-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.market-symbol {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}
.market-price-box {
    text-align: right;
}
.market-price {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}
.market-change {
    font-size: 12px;
    font-weight: 600;
}
.market-change.positive {
    color: #00e676; /* Green */
}
.market-change.negative {
    color: #ff3d00; /* Red */
}



/* Market Expand Button Styles */
.market-expand-container {
    padding-top: 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 5px;
}

.market-expand-btn {
    background: transparent;
    border: none;
    color: #2962ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    transition: all 0.2s ease;
}

.market-expand-btn:hover {
    opacity: 0.8;
    transform: translateY(2px);
}

.market-expand-btn span {
    font-size: 10px;
}



/* Market Indices Overview Styles */
.indices-row {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.indices-row:last-child {
    border-bottom: none;
}

.indices-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.indices-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.indices-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.indices-change-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.indices-pts {
    font-size: 13px;
    font-weight: 500;
}

.indices-pct {
    font-size: 12px;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    padding: 3px 6px;
    border-radius: 4px;
}

.indices-pct.positive {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
}

.indices-pct.negative {
    background: rgba(255, 61, 0, 0.1);
    color: #ff3d00;
}



/* Responsive Market Analysis Grids */
@media (max-width: 1200px) {
    .analysis-grid {
        grid-template-columns: 1fr !important;
    }
    #symbol-overview-container { height: 350px !important; }
    #technical-analysis-container { height: 350px !important; }
    #mini-chart-container { height: 300px !important; }
    #financials-container { height: 300px !important; }
    #profile-container { height: 300px !important; }
}

.analysis-grid > div {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.analysis-grid > div:hover {
    transform: translateY(-5px);
}

/* Responsive News Page */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .sidebar-column {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .promo-box {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    .main-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #ffffff;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 99;
        display: none;
        flex-direction: column;
        gap: 0;
    }
    .main-nav.active {
        display: flex;
    }
    .main-nav a {
        padding: 12px 16px;
        border-radius: 8px;
        transition: background-color 0.2s;
    }
    .main-nav a:hover {
        background-color: #f3f4f6;
    }
    .main-nav a.active::after {
        display: none;
    }
    .main-nav a.active {
        background-color: #eff6ff;
    }
    .app-header {
        height: 60px;
    }
    .header-container {
        padding: 0 16px;
    }
    .logo h1 {
        font-size: 1.2rem;
    }
    .time-display {
        font-size: 0.8rem;
    }
    .news-container {
        margin: 20px auto;
        padding: 0 16px;
    }
    .sidebar-column {
        grid-template-columns: 1fr;
    }
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .hero-grid .article-card:first-child {
        flex-direction: column;
    }
    .hero-grid .article-card:first-child .article-img-wrapper,
    .hero-grid .article-card:first-child .article-content {
        width: 100%;
    }
    .hero-grid .article-card:first-child .article-img-wrapper {
        padding-top: 56.25%;
        min-height: auto;
    }
    .hero-grid .article-card:first-child .article-title {
        font-size: 1.5rem;
    }
    .article-list {
        grid-template-columns: 1fr;
    }
    .section-header h2 {
        font-size: 1.5rem;
    }
    .section-header[style] {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .section-header[style] .search-bar {
        width: 100%;
    }
    .section-header[style] .search-bar input {
        width: 100% !important;
    }
    #modal-img { height: 250px; }
    .modal-content-inner { padding: 20px; }
    #modal-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    .app-header {
        height: auto;
        padding: 12px 0;
    }
    .header-container {
        flex-wrap: wrap;
        gap: 10px;
        padding: 0 12px;
    }
    .logo {
        width: 100%;
        justify-content: center;
    }
    .time-display {
        width: 100%;
        text-align: center;
        font-size: 0.75rem;
    }
    .main-nav {
        top: auto;
        position: relative;
    }
    .news-container {
        margin: 16px auto;
        padding: 0 12px;
    }
    .section-header h2 {
        font-size: 1.3rem;
    }
    .article-content {
        padding: 16px;
    }
    .article-title {
        font-size: 1rem;
    }
    .article-desc {
        font-size: 0.85rem;
    }
    .compact-img {
        width: 70px;
        height: 70px;
    }
    .promo-box {
        padding: 24px 16px;
    }
    .promo-box h3 {
        font-size: 1.2rem;
    }
    footer {
        padding: 30px 12px;
        margin-top: 40px;
    }
}

