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

body {
    font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3e9d0 100%);
    min-height: 100vh;
    color: #333;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.ball-icon {
    font-size: 2.5rem;
    animation: bounce 2s infinite;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: bold;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin-left: 3.5rem;
}

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

/* タブコンテナ */
.tab-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 3px solid #e0e0e0;
}

.tab-button {
    flex: 1;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.tab-button:hover {
    background: rgba(76, 175, 80, 0.1);
}

.tab-button.active {
    background: white;
    color: #2e7d32;
    border-bottom: 3px solid #ff9800;
    margin-bottom: -3px;
}

.tab-content {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 検索セクション */
.search-section {
    margin-bottom: 2rem;
}

.search-section h2 {
    color: #2e7d32;
    margin-bottom: 1rem;
}

.search-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#searchInput {
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    outline: none;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    border-color: #4caf50;
}

.category-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.7rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-btn:hover {
    background: #f5f5f5;
}

.category-btn.active {
    background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%);
    color: white;
    border-color: #ff9800;
}

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

.resource-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-color: #4caf50;
}

.resource-type {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.resource-card h3 {
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.resource-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* AI機能のタブコンテナ */
.ai-tabs-container {
    margin-top: -1rem;
}

/* AI機能の内部タブ */
.ai-tabs {
    display: flex;
    background: #f0f7f1;
    border-radius: 15px 15px 0 0;
    padding: 0.5rem;
    gap: 0.5rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.ai-tab-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-weight: 500;
    position: relative;
}

.ai-tab-button:hover {
    background: rgba(255, 255, 255, 0.5);
}

.ai-tab-button.active {
    background: white;
    color: #2e7d32;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ai-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%);
    border-radius: 2px;
}

.ai-tab-icon {
    font-size: 1.2rem;
}

.ai-tab-text {
    font-size: 1rem;
}

/* AI機能のタブコンテンツ */
.ai-tab-content {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 0 0 15px 15px;
    animation: fadeIn 0.3s ease;
}

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

.ai-tool-description {
    background: linear-gradient(135deg, #f8fffe 0%, #e8f5e9 100%);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #4caf50;
}

.ai-tool-description h3 {
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.ai-tool-description p {
    color: #666;
    line-height: 1.6;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.close-button {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #333;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2e7d32;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4caf50;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ボタン */
.btn-primary {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    padding: 1rem 2rem;
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 0 1rem;
    }
    
    .ai-tab-button {
        padding: 0.8rem 0.5rem;
    }
    
    .ai-tab-text {
        font-size: 0.85rem;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}