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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* メインコンテンツ */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* レベルタブ */
.level-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.level-tab {
    padding: 0.75rem 2rem;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
}

.level-tab:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.level-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* レベルコンテンツ */
.level-content {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.level-panel {
    display: none;
}

.level-panel.active {
    display: block;
}

.level-panel h2 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.level-description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* カテゴリグリッド */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    display: block;
    padding: 1.5rem;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--category-color, #667eea) 0%, var(--category-color-end, #764ba2) 100%);
}

.category-card.flex {
    --category-color: #FF6B6B;
    --category-color-end: #FF8E8E;
}

.category-card.grid {
    --category-color: #4CAF50;
    --category-color-end: #6BC56F;
}

.category-card.position {
    --category-color: #2196F3;
    --category-color-end: #42A5F5;
}

.category-card.display {
    --category-color: #FF9800;
    --category-color-end: #FFB74D;
}

.category-card.margin {
    --category-color: #9C27B0;
    --category-color-end: #BA68C8;
}

.category-card.padding {
    --category-color: #00BCD4;
    --category-color-end: #26C6DA;
}

.category-card.width-height {
    --category-color: #795548;
    --category-color-end: #8D6E63;
}

.category-card.text-font {
    --category-color: #607D8B;
    --category-color-end: #78909C;
}

.category-card.z-index {
    --category-color: #E91E63;
    --category-color-end: #F06292;
}

.category-card.background {
    --category-color: #3F51B5;
    --category-color-end: #5C6BC0;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--category-color);
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.3rem;
}

.category-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.problem-count {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #f5f5f5;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* フッター */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
    margin-top: 4rem;
    border-top: 1px solid #e0e0e0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .level-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .level-tab {
        width: 100%;
        text-align: center;
    }

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