/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* ヘッダー */
.header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 32px;
}

.nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.category-select,
.country-select {
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.category-select:hover,
.country-select:hover {
    background: #667eea;
    color: white;
}

/* メイン */
.main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* ローディング */
.loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 18px;
    color: #666;
    font-weight: 500;
}

/* エラーメッセージ */
.error {
    background: #fff5f5;
    border: 2px solid #fc8181;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.error i {
    font-size: 48px;
    color: #fc8181;
    margin-bottom: 15px;
}

.error p {
    font-size: 16px;
    color: #742a2a;
    margin-bottom: 20px;
}

.retry-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ニュースコンテナ */
.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* ニュースカード */
.news-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.news-source {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #999;
}

.source-name {
    font-weight: 600;
    color: #667eea;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

.news-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-link:hover {
    color: #5568d3;
    gap: 8px;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
}

.page-button {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.page-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

/* フッター */
.footer {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    padding: 25px 0;
    margin-top: 40px;
    backdrop-filter: blur(10px);
}

.footer p {
    font-size: 14px;
}

/* デモモード通知 */
.demo-notice {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border: 2px solid #fdcb6e;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(253, 203, 110, 0.3);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.demo-notice i.fa-info-circle {
    font-size: 24px;
    color: #d63031;
    flex-shrink: 0;
    margin-top: 2px;
}

.demo-notice > div {
    flex-grow: 1;
}

.demo-notice strong {
    display: block;
    font-size: 16px;
    color: #2d3436;
    margin-bottom: 5px;
}

.demo-notice p {
    font-size: 14px;
    color: #2d3436;
    line-height: 1.5;
    margin: 0;
}

.demo-notice-close {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.demo-notice-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.demo-notice-close i {
    color: #2d3436;
    font-size: 14px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo {
        font-size: 24px;
    }

    .logo i {
        font-size: 28px;
    }

    .nav {
        width: 100%;
    }

    .category-select,
    .country-select {
        flex: 1;
        min-width: 0;
    }

    .news-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 10px;
    }

    .page-button {
        padding: 10px 20px;
        font-size: 13px;
    }

    .demo-notice {
        flex-direction: column;
        gap: 10px;
    }

    .demo-notice-close {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .main {
        padding: 20px 0;
    }

    .news-title {
        font-size: 16px;
    }

    .news-description {
        font-size: 13px;
    }
}
