/* assets/css/style.css */

:root {
    --primary-color: #000000;
    --secondary-color: #666666;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --active-tab-color: #000000;
    --inactive-tab-color: #94a3b8;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--background-color);
    color: var(--primary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Header */
.header {
    background-color: var(--card-background);
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.85);
}

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

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary-color);
    font-weight: 300;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Filters */
.filters-container {
    margin: 40px 0 32px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filters {
    display: flex;
    gap: 12px;
}

.filter-btn {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--secondary-color);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

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

/* News Card */
.news-card {
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.source-badge {
    background-color: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
}

.publish-time {
    font-size: 12px;
    color: #94a3b8;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 24px;
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tabs */
.tabs-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tabs-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0 0 8px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--inactive-tab-color);
    position: relative;
    transition: color 0.3s;
}

.tab-btn:hover {
    color: var(--secondary-color);
}

.tab-btn.active {
    color: var(--active-tab-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--active-tab-color);
    border-radius: 2px 2px 0 0;
}

.tab-btn.hidden {
    display: none;
}

.tab-content {
    display: none;
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.7;
    color: var(--secondary-color);
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Footer */
.card-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.read-more-btn:hover {
    opacity: 0.6;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--secondary-color);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

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

/* Auth Styles */
.auth-bg {
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
    padding: 24px;
}

.auth-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-hover);
    text-align: center;
}

.auth-logo {
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-error {
    background-color: #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    text-align: left;
}

.auth-form {
    text-align: left;
}

.auth-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.auth-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.auth-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

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

/* User Menu in Header */
.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-color);
}

.logout-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #f1f5f9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: var(--card-background);
    margin: 5% auto;
    padding: 32px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    width: 90%;
    max-width: 800px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: var(--inactive-tab-color);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-header {
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-start;
    gap: 16px;
    align-items: center;
}

.modal-body {
    margin: 24px 0;
    font-size: 15px;
    line-height: 1.8;
    color: var(--primary-color);
    overflow-wrap: break-word;
}

/* Markdown Styles */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.markdown-body h1 {
    font-size: 22px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-body h2 {
    font-size: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-body h3 {
    font-size: 16px;
}

.markdown-body p {
    margin-bottom: 12px;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 12px;
    padding-left: 20px;
}

.markdown-body li {
    margin-bottom: 4px;
}

.markdown-body strong {
    font-weight: 700;
}

.markdown-body blockquote {
    padding: 0 16px;
    color: var(--secondary-color);
    border-left: 4px solid var(--border-color);
    margin-bottom: 12px;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 4px;
}

.markdown-body a {
    color: #2563eb;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
}