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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.app-title i {
    margin-right: 12px;
    color: #ffd700;
}

.app-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
}

/* セクションタイトル */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: #667eea;
}

/* 記事追加フォーム */
.add-article-section {
    margin-bottom: 50px;
}

.form-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.article-form .form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group {
    display: flex;
    gap: 12px;
}

.form-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #a0aec0;
}

/* ボタン */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

/* ローディング・エラーメッセージ */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-weight: 500;
}

.loading-indicator i {
    margin-right: 8px;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    margin-top: 12px;
}

.hidden {
    display: none;
}

/* 記事一覧セクション */
.articles-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

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

.articles-count {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 記事グリッド */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

/* 記事カード */
.article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    position: relative;
}

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

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.article-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 3rem;
}

.article-content {
    padding: 20px;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-description {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.article-source {
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 500;
    background: #f0f4ff;
    padding: 4px 8px;
    border-radius: 12px;
}

.article-date {
    font-size: 0.8rem;
    color: #a0aec0;
}

.article-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.delete-btn {
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #c53030;
    transform: scale(1.1);
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #718096;
}

.empty-state p {
    font-size: 0.95rem;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #a0aec0;
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover {
    color: #718096;
    background: #f7fafc;
}

.modal-body {
    padding: 20px 24px;
}

.modal-body p {
    margin-bottom: 12px;
    color: #4a5568;
}

.modal-article-title {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.95rem;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .articles-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.8rem;
    }
    
    .form-container {
        padding: 16px;
    }
    
    .articles-section {
        padding: 16px;
    }
    
    .modal-content {
        width: 95%;
    }
}