/* Root Variables */
:root {
    --bg-color: #F0EEE6;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #6a6a6a;
    --border-color: #d4d2ca;
    --active-color: #2c2c2c;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --header-height: 56px;
    --nav-height: 64px;
}

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

body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

/* App Container */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Tabs */
.nav-tabs {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: #025999;
    border-bottom: none;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background-color: #025999;
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: white;
    margin-right: 24px;
    white-space: nowrap;
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Articles List */
.articles-list {
    padding: 16px 16px 16px 16px;
    max-width: 800px;
    margin: 0 auto;
}

/* Article Card */
.article-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: row-reverse;
    text-decoration: none;
    color: inherit;
}

.article-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.article-image {
    width: 140px;
    min-width: 140px;
    height: 140px;
    object-fit: cover;
    background: var(--border-color);
    display: block;
}

.article-card.no-image .article-image {
    display: none;
}

.article-card.no-image {
    padding-left: 0;
}

.article-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-section {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
}

.meta-separator {
    margin: 0 6px;
    color: var(--text-tertiary);
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.article-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
    flex: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.article-date {
    font-weight: 400;
}


.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 12px 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
    min-width: 44px;
    min-height: 44px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.nav-tab svg {
    transition: transform 0.2s;
}

.nav-tab:hover {
    color: white;
}

.nav-tab:active svg {
    transform: scale(0.9);
}

.nav-tab.active {
    color: white;
}

.nav-tab.active span {
    font-weight: 700;
}

.nav-tab.active svg {
    stroke-width: 2.5;
}

.nav-tab span {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .nav-tab {
        flex-direction: column;
        gap: 4px;
        padding: 10px 6px;
    }
    .nav-tab svg {
        width: 20px;
        height: 20px;
    }
    .nav-tab span {
        font-size: 11px;
    }
    .nav-title {
        font-size: 15px;
        margin-right: auto;
        display: block;
    }
    .nav-tabs {
        gap: 2px;
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .nav-title {
        font-size: 14px;
    }
    .nav-tabs {
        padding: 0 8px;
        gap: 0;
    }
    .nav-tab {
        padding: 10px 4px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #c54545;
}

.error-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 500;
}

.error-state p {
    font-size: 14px;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .articles-list {
        padding: 24px 24px 24px 24px;
    }

    .article-card {
        margin-bottom: 20px;
    }

    .article-image {
        width: 180px;
        min-width: 180px;
        height: 180px;
    }

    .article-content {
        padding: 20px;
    }

    .article-title {
        font-size: 20px;
    }

    .article-description {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .article-card {
        flex-direction: column;
    }

    .article-image {
        width: 100%;
        min-width: 100%;
        height: 180px;
        border-radius: 0;
        margin-bottom: 0;
    }

    .article-content {
        padding: 12px;
    }

    .article-title {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .article-description {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .article-meta {
        font-size: 11px;
    }
}

/* Footer */
.footer {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 11px;
    color: var(--text-tertiary);
    max-width: 800px;
    margin: 0 auto;
}

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

.footer a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0 32px 0;
}

.load-more-button {
    background-color: #025999;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 4px 12px rgba(2, 89, 153, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.load-more-button:hover {
    background-color: #014477;
    box-shadow: 0 6px 16px rgba(2, 89, 153, 0.4);
    transform: translateY(-2px);
}

.load-more-button:active {
    transform: translateY(0) scale(0.98);
}

@media (max-width: 480px) {
    .load-more-button {
        padding: 12px 28px;
        font-size: 14px;
    }
}

/* Refresh Button */
.refresh-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #025999;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(2, 89, 153, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    z-index: 1000;
    -webkit-tap-highlight-color: transparent;
}

.refresh-button svg {
    width: 28px;
    height: 28px;
}

.refresh-button svg {
    color: white;
    transition: transform 0.3s ease;
}

.refresh-button:hover {
    background-color: #014477;
    box-shadow: 0 6px 16px rgba(2, 89, 153, 0.5);
    transform: translateY(-2px);
}

.refresh-button:active {
    transform: translateY(0) scale(0.95);
}

.refresh-button.refreshing svg {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .refresh-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .refresh-button svg {
        width: 24px;
        height: 24px;
    }
}

/* Print Styles */
@media print {
    .nav-tabs,
    .footer,
    .refresh-button,
    .load-more-container {
        display: none;
    }
}
