@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #fd79a8 0%, #fab1a0 100%);
    --secondary-gradient: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    --accent-gradient: linear-gradient(135deg, #ff7675 0%, #fd79a8 100%);
    --success-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    
    --bg-primary: #fafbfc;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.25);
    --bg-dark: #1a1d29;
    --bg-dark-card: #262936;
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-inverse: #ffffff;
    
    --border-light: #e2e8f0;
    --border-primary: #cbd5e0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh; /* Safari対応 */
}

/* Modern hero header */
header {
    background: 
        url('header-bg.svg') center center / cover no-repeat,
        linear-gradient(135deg, #ffeaa7 0%, #fab1a0 50%, #fd79a8 100%) !important;
    background-color: #ffeaa7 !important; /* フォールバック色 */
    color: #2d3748 !important;
    text-align: center;
    padding: 2rem 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    /* Safari対応 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* iOS Safari固有の修正 */
    -webkit-appearance: none;
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="rgba(45,55,72,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.4;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    text-align: left;
}

.header-robot {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.header-robot:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

header h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #2d3748 !important; /* Safari フォールバック */
    /* iOS Safari固有の修正 */
    -webkit-text-fill-color: #2d3748 !important;
    text-align: left;
    position: relative;
}

/* Safari専用のフォールバック */
@supports (-webkit-background-clip: text) and (not (background-clip: text)) {
    header h1 {
        color: #2d3748 !important;
        background: none !important;
        -webkit-background-clip: initial !important;
        -webkit-text-fill-color: initial !important;
    }
}

/* Safari専用のヘッダー色強制 */
@media screen and (-webkit-min-device-pixel-ratio: 1) {
    header * {
        color: #2d3748 !important;
    }
    
    header h1 {
        color: #2d3748 !important;
        background: none !important;
        -webkit-background-clip: initial !important;
        -webkit-text-fill-color: initial !important;
    }
    
    header p {
        color: #4a5568 !important;
    }
}


header p {
    font-size: 1.1rem;
    opacity: 0.85;
    font-weight: 400;
    margin-bottom: 0;
    color: #4a5568 !important;
}


/* Modern navigation */
nav {
    background: var(--bg-card);
    padding: 1.5rem 2rem;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.nav-tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.filter-toggle {
    display: none;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    min-width: 44px;
    justify-content: center;
}

.filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* フィルター使用中のスタイル */
.filter-toggle.filtered {
    background: linear-gradient(135deg, rgba(253, 121, 168, 0.9) 0%, rgba(250, 177, 160, 0.9) 100%);
    border: 2px solid #fd79a8;
    box-shadow: 0 2px 8px rgba(253, 121, 168, 0.3);
    animation: filter-pulse 2s infinite;
}

.filter-toggle.filtered:hover {
    background: linear-gradient(135deg, #fd79a8 0%, #fab1a0 100%);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(253, 121, 168, 0.4);
}

.filter-toggle.filtered .filter-icon,
.filter-toggle.filtered .toggle-icon {
    stroke: white !important;
}

/* フィルター使用中のパルスアニメーション */
@keyframes filter-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(253, 121, 168, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(253, 121, 168, 0.5);
    }
}

.filter-icon {
    transition: transform var(--transition-normal);
}

.toggle-icon {
    transition: transform var(--transition-normal);
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.filter-panel {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.filter-panel.hidden {
    display: none;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: var(--radius-full);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-tab {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.nav-tab:hover::before {
    opacity: 0.1;
}

.nav-tab.active {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.nav-tab.active::before {
    opacity: 1;
}

/* Modern form controls */
.filter-container, .search-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

select, input[type="text"] {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition-normal);
    min-height: 44px; /* iOS minimum touch target */
}

/* iOS Safari specific fixes for select */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #fd79a8;
    box-shadow: 0 0 0 3px rgba(253, 121, 168, 0.1);
}

button {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#search-btn {
    padding: 0.75rem;
    width: auto;
    min-width: 44px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

button:active {
    transform: translateY(0);
}

/* Main content area */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Modern card grid */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.article-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(253, 121, 168, 0.2);
}

.article-card:hover::before {
    opacity: 1;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

.article-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.article-title a:hover {
    color: #fd79a8;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-source {
    font-weight: 600;
    color: var(--text-primary);
}

.article-category {
    background: var(--accent-gradient);
    color: var(--text-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.ai-badge {
    background: var(--secondary-gradient);
    color: var(--text-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-sm);
}

/* Enhanced AI summary */
.ai-summary {
    background: linear-gradient(135deg, #f8faff 0%, #e8f2ff 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    /* margin: 1.5rem 0; */
    position: relative;
    overflow: hidden;
}

.ai-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.ai-summary-label {
    font-weight: 600;
    color: #fd79a8;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-summary-text {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.article-keywords {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.keyword-tag:hover {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    transform: translateY(-1px);
}

.article-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.article-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    gap: 0.4rem;
}

.article-date {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
}

.article-date-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.4rem;
}

.article-attribution {
    color: var(--text-muted);
}

.article-attribution a {
    color: #fd79a8;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.article-attribution a:hover {
    color: #fab1a0;
}

/* Trending topics */
.trends-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--success-gradient);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.trends-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.trends-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.trends-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.trends-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.trend-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.trend-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.trend-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.trend-card:hover::before {
    opacity: 1;
}

.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.trend-topic {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.trend-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.trend-articles, .trend-timespan {
    background: var(--accent-gradient);
    color: var(--text-inverse);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.trend-analysis {
    background: linear-gradient(135deg, #fff8f0 0%, #fff0e8 100%);
    border: 1px solid rgba(230, 126, 34, 0.2);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.trend-analysis::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
}

.trend-analysis-label {
    font-weight: 700;
    color: #e67e22;
    margin-bottom: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trend-analysis-text {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 1rem;
}

.trend-sources {
    margin: 2rem 0;
    color: var(--text-secondary);
    font-weight: 500;
}

.source-tag {
    display: inline-block;
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.25rem;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.source-tag:hover {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    transform: translateY(-1px);
}

.trend-articles-list {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 2rem 0;
}

.trend-articles-header {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.trend-article-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.trend-article-item:last-child {
    border-bottom: none;
}

.trend-article-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 0 -1rem;
}

.trend-article-item a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.trend-article-item a:hover {
    color: #fd79a8;
}

.trend-article-source {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.5rem;
    font-weight: 500;
}

.trend-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    margin-top: 2rem;
}

.trend-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Modern Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pagination-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.pagination-btn:hover {
    color: var(--text-inverse);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-btn:hover::before {
    opacity: 1;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: var(--bg-primary);
    color: var(--text-muted);
}

.pagination-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-primary);
}

.pagination-btn:disabled::before {
    opacity: 0;
}

.pagination-btn svg {
    transition: transform var(--transition-fast);
}

.prev-btn:hover svg {
    transform: translateX(-2px);
}

.next-btn:hover svg {
    transform: translateX(2px);
}

.page-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--primary-gradient);
    color: var(--text-inverse);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.page-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.page-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.page-label {
    font-size: 0.7rem;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination {
        flex-direction: row;
        gap: 1rem;
        padding: 1rem;
        justify-content: center;
    }
    
    .pagination-btn {
        width: auto;
        justify-content: center;
        padding: 0.75rem;
        min-width: 48px;
        border-radius: 50%;
    }
    
    .page-indicator {
        order: -1;
        padding: 1rem;
    }
    
    .page-number {
        font-size: 2rem;
    }
    
    .page-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 2.5rem;
        padding: 0.75rem;
    }
    
    .pagination-btn {
        font-size: 0.8rem;
        padding: 0.6rem;
        min-width: 40px;
    }
    
    .pagination-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Loading and error states */
.loading, .error {
    text-align: center;
    padding: 3rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.loading {
    color: #fd79a8;
    background: linear-gradient(135deg, #fdf8f8 0%, #fef2f2 100%);
    font-weight: 500;
}

.error {
    color: #e53e3e;
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 1px solid #fc8181;
}

.no-articles, .no-trends {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-primary);
    font-size: 1.1rem;
}

.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Modern footer */
footer {
    background: linear-gradient(135deg, #2c1810 0%, #3d2817 50%, #2c1810 100%);
    color: #f7f3f0;
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
    border-top: 3px solid transparent;
    border-image: var(--primary-gradient) 1;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0.8;
}

footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(253, 121, 168, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(250, 177, 160, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.copyright {
    text-align: left;
}

.copyright p:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.disclaimer {
    font-size: 0.85rem;
    color: rgba(247, 243, 240, 0.7);
    margin-top: 0.5rem;
    line-height: 1.5;
    max-width: 600px;
}

/* Share Buttons */
.share-buttons {
    margin-top: 0;
    padding-top: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    background: transparent;
}

.x-share {
    color: #1da1f2;
    border: 1px solid #1da1f2;
    background: rgba(29, 161, 242, 0.05);
}

.x-share:hover {
    background: #1da1f2;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.x-share svg {
    width: 16px;
    height: 16px;
}

.legal-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.legal-links a {
    color: rgba(247, 243, 240, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    border: 1px solid rgba(253, 121, 168, 0.2);
    background: rgba(253, 121, 168, 0.05);
    backdrop-filter: blur(10px);
}

.legal-links a:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 121, 168, 0.3);
}

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

.modal-content {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-light);
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    padding-bottom: 1rem;
    border-bottom: 2px solid transparent;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-content h3 {
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-text {
    line-height: 1.7;
    color: var(--text-secondary);
    font-size: 1rem;
}

.modal-text ul {
    margin: 1rem 0 1.5rem 1.5rem;
}

.modal-text li {
    margin-bottom: 0.75rem;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-normal);
    z-index: 1001;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
}

.close:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    transform: rotate(90deg);
}

/* デスクトップ版でフィルターボタンを非表示 */
@media (min-width: 769px) {
    .filter-toggle {
        display: none !important;
    }
    
    .nav-main {
        justify-content: flex-start;
        align-items: center;
        gap: 2rem;
    }
    
    .nav-tabs-container {
        width: auto;
        justify-content: flex-start;
        flex-shrink: 0;
    }
    
    .filter-panel {
        display: flex !important;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex: 1;
        justify-content: flex-end;
    }
    
    .filter-panel.hidden {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        padding: 1.5rem 1rem;
        background-size: cover;
        background-position: center center;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-icon {
        margin-top: 0.5rem;
    }
    
    .header-text {
        text-align: center;
    }
    
    .header-robot {
        width: 70px;
        height: 70px;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
        text-align: center;
    }
    
    header p {
        font-size: 0.9rem;
        margin-bottom: 0;
        text-align: center;
    }
    
    nav {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    
    .nav-main {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-tabs {
        justify-content: center;
    }
    
    .filter-container, .search-container {
        justify-content: center;
    }
    
    .articles-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-card {
        padding: 1.5rem;
    }
    
    .trend-card {
        padding: 1.5rem;
    }
    
    .trends-header {
        padding: 1.5rem;
    }
    
    .trends-header h2 {
        font-size: 1.5rem;
    }
    
    .trend-topic {
        font-size: 1.5rem;
    }
    
    .trend-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .header-icon {
        margin-top: 0.75rem;
    }
    
    .header-text {
        text-align: center;
    }
    
    .header-robot {
        width: 60px;
        height: 60px;
    }
    
    header h1 {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
        text-align: center;
        /* line-height: 1.1; */
    }
    
    header p {
        font-size: 0.8rem;
        opacity: 0.8;
        margin-bottom: 0;
        text-align: center;
    }
    
    nav {
        padding: 0.75rem 1rem;
    }
    
    .nav-main {
        gap: 0.75rem;
    }
    
    .nav-tabs {
        gap: 0.5rem;
    }
    
    .nav-tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .filter-toggle {
        display: flex;
        padding: 0.5rem;
        font-size: 0.85rem;
        min-width: 40px;
    }
    
    .filter-panel {
        flex-direction: column;
        gap: 1rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        width: 100%;
    }
    
    .filter-container,
    .search-container {
        gap: 0.5rem;
        width: 100%;
    }
    
    
    #category-filter,
    #search-input {
        font-size: 16px;
        padding: 0.75rem 1rem;
        width: 100%;
        min-height: 48px; /* モバイル用のより大きなタッチターゲット */
        border: 2px solid var(--border-light);
        border-radius: var(--radius-md);
        background: var(--bg-card);
    }
    
    /* モバイルでのselect要素の特別な処理 */
    #category-filter {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px;
        padding-right: 40px;
    }
    
    #search-btn {
        padding: 0.5rem;
        font-size: 0.9rem;
        min-width: 40px;
    }
    
    .article-card {
        padding: 1rem;
    }
    
    .share-buttons {
        margin-top: 0;
    }
    
    .share-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .article-footer {
        margin-top: 0.75rem;
        padding-top: 0.5rem;
        font-size: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    
    .article-date-share {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 0.4rem;
    }
    
    .article-date {
        font-size: 0.75rem;
    }
    
    .article-attribution {
        font-size: 0.75rem;
    }
    
    .trend-card {
        padding: 1rem;
    }
    
    .ai-summary {
        padding: 1rem;
    }
    
    .trend-analysis {
        padding: 1rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 320px) {
    header {
        padding: 1rem 0.75rem;
    }
    
    header h1 {
        font-size: 1.25rem;
        margin-bottom: 0.125rem;
        line-height: 1.1;
    }
    
    header p {
        font-size: 0.8rem;
        opacity: 0.7;
        margin-bottom: 0;
    }
    
    nav {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .nav-tabs {
        padding: 2px;
    }
    
    .nav-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    main {
        padding: 1rem 0.75rem;
    }
    
    .article-card {
        padding: 0.75rem;
    }
    
    .trend-card {
        padding: 0.75rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* Selection styles */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}

/* Focus styles */
*:focus {
    outline: 2px solid rgba(253, 121, 168, 0.5);
    outline-offset: 2px;
}

/* Highlighted article styles */
.article-card.highlighted {
    border: 3px solid #fd79a8;
    box-shadow: 0 8px 32px rgba(253, 121, 168, 0.3);
    background: linear-gradient(135deg, rgba(253, 121, 168, 0.05) 0%, rgba(250, 177, 160, 0.05) 100%);
}

/* Highlight pulse animation */
@keyframes highlight-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(253, 121, 168, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 12px 40px rgba(253, 121, 168, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(253, 121, 168, 0.3);
    }
}

/* AI Trendsタブを一時的に非表示 */
#trends-tab {
    display: none !important;
}

/* iOS Safari専用修正 */
@supports (-webkit-touch-callout: none) {
    header {
        background: #ffeaa7 !important;
        background-image: 
            url('header-bg.svg'),
            linear-gradient(135deg, #ffeaa7 0%, #fab1a0 50%, #fd79a8 100%) !important;
        background-size: cover, 100% 100% !important;
        background-position: center, center !important;
        background-repeat: no-repeat, no-repeat !important;
        background-attachment: scroll !important;
    }
    
    header h1 {
        color: #2d3748 !important;
        -webkit-text-fill-color: #2d3748 !important;
        background: none !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
    }
    
    header p {
        color: #4a5568 !important;
        -webkit-text-fill-color: #4a5568 !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card, .trend-card {
    animation: fadeIn 0.5s ease-out;
}

/* Print styles */
@media print {
    .nav-tabs, .filter-container, .search-container, .pagination, footer {
        display: none;
    }
    
    .article-card, .trend-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}