/* IRA (Indian Research Association) Design System */
:root {
    --primary-blue: #1A73E8;
    --dark-blue: #0D47A1;
    --accent-cyan: #00E5FF;
    --bg-light: #F8F9FA;
    --surface-light: #FFFFFF;
    --text-primary-light: #1A1C1E;
    --text-secondary-light: #5F6368;
    --border-light: #E0E0E0;

    --bg-dark: #121418;
    --surface-dark: #1E2025;
    --text-primary-dark: #E2E2E6;
    --text-secondary-dark: #9AA0A6;
    --border-dark: #2D3038;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.light-theme {
    background-color: var(--bg-light);
    color: var(--text-primary-light);
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-primary-dark);
}

/* Top App Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--surface-light);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

body.dark-theme .top-bar {
    background: var(--surface-dark);
    border-bottom-color: var(--border-dark);
}

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

.brand-logo-box {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: white;
    font-weight: 900;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary-light);
}

body.dark-theme .brand-subtitle {
    color: var(--text-secondary-dark);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #F1F3F4;
    border-radius: 24px;
    padding: 8px 16px;
    width: 320px;
}

body.dark-theme .search-box {
    background: #2A2D35;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    padding-left: 8px;
    width: 100%;
    color: inherit;
    font-size: 14px;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: inherit;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark-theme .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn {
    border: none;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;

    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.3);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
    border-radius: 12px;
}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--surface-light);
    border-bottom: 1px solid var(--border-light);
}

body.dark-theme .nav-tabs {
    background: var(--surface-dark);
    border-bottom-color: var(--border-dark);
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary-light);
}

body.dark-theme .nav-tab {
    color: var(--text-secondary-dark);
}

.nav-tab.active {
    background: var(--primary-blue);
    color: white;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.view-section.hide {
    display: none;
}

/* Category Chips */
.category-chips-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--surface-light);
    border: 1px solid var(--border-light);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

body.dark-theme .chip {
    background: var(--surface-dark);
    border-color: var(--border-dark);
}

.chip.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Feed Grid */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* Article Cards */
.article-card {
    background: var(--surface-light);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

body.dark-theme .article-card {
    background: var(--surface-dark);
    border-color: var(--border-dark);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-image-box {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.type-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;

    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.type-badge.paper {
    background: var(--dark-blue);
    color: white;
}

.type-badge.news {
    background: var(--primary-blue);
    color: white;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.card-summary {
    font-size: 13px;
    color: var(--text-secondary-light);
    line-height: 1.5;
    margin-bottom: 16px;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-theme .card-summary {
    color: var(--text-secondary-dark);
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
}

body.dark-theme .card-footer {
    border-top-color: var(--border-dark);
}

.source-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-blue);
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hide {
    display: none;
}

.modal-content {
    background: var(--surface-light);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 28px;
    position: relative;
}

body.dark-theme .modal-content {
    background: var(--surface-dark);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    color: inherit;
}

/* Support Modal */
.support-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.heart-icon-box {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: white;
    border-radius: 50%;
    margin: 0 auto 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
}

.tiers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.tier-card {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border: 2px solid var(--border-light);
    border-radius: 14px;
    cursor: pointer;
}

body.dark-theme .tier-card {
    border-color: var(--border-dark);
}

.tier-card.active {
    border-color: var(--primary-blue);
    background: rgba(26, 115, 232, 0.05);
}

.tier-info {
    margin-left: 12px;
    flex-grow: 1;
}

.tier-title {
    font-weight: 700;
    font-size: 15px;
}

.tier-desc {
    font-size: 12px;
    color: var(--text-secondary-light);
}

.tier-price {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary-blue);
}

.billing-policy-note {
    font-size: 11px;
    color: var(--text-secondary-light);
    text-align: center;
    margin-bottom: 16px;
}

/* Settings View */
.about-hero-card {
    background: linear-gradient(135deg, var(--surface-light), #E8F0FE);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 28px;
    text-align: center;
    margin-bottom: 24px;
}

body.dark-theme .about-hero-card {
    background: linear-gradient(135deg, var(--surface-dark), #1A233A);
    border-color: var(--border-dark);
}

.hero-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: white;
    font-size: 24px;
    font-weight: 900;
    border-radius: 16px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-group {
    background: var(--surface-light);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

body.dark-theme .settings-group {
    background: var(--surface-dark);
    border-color: var(--border-dark);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.setting-item.clickable {
    cursor: pointer;
}

/* Shimmer Loading */
.shimmer-card {
    height: 260px;
    border-radius: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

body.dark-theme .shimmer-card {
    background: linear-gradient(90deg, #252830 25%, #1E2025 50%, #252830 75%);
}

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

/* Site Footer */
.site-footer {
    background: var(--surface-light);
    border-top: 1px solid var(--border-light);
    padding: 40px 24px 24px;
    margin-top: 60px;
    font-size: 14px;
}

body.dark-theme .site-footer {
    background: var(--surface-dark);
    border-top-color: var(--border-dark);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-brand-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand-desc {
    color: var(--text-secondary-light);
    line-height: 1.6;
    max-width: 480px;
}

body.dark-theme .footer-brand-desc {
    color: var(--text-secondary-dark);
}

.footer-col h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: var(--text-secondary-light);
    text-decoration: none;
    transition: color 0.2s;
}

body.dark-theme .footer-links a {
    color: var(--text-secondary-dark);
}

.footer-links a:hover {
    color: var(--primary-blue);
}

.footer-bottom {
    max-width: 1200px;
    margin: 32px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary-light);
}

body.dark-theme .footer-bottom {
    border-top-color: var(--border-dark);
    color: var(--text-secondary-dark);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }

    .top-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        width: 100%;
        flex-grow: 1;
    }

    .support-btn span {
        display: none;
    }

    .nav-tabs {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 10px 16px;
    }

    .nav-tab {
        white-space: nowrap;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .feed-grid {
        grid-template-columns: 1fr;
    }
}

