/* リスティング広告キーワード設計ツール - スタイルシート */

:root {
    --primary-color: #3498db;
    --secondary-color: #95a5a6;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header h1 i {
    margin-right: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* メインコンテンツ */
main {
    padding: 30px;
}

.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.keyword-group {
    background: var(--light-color);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.keyword-group:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.keyword-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.keyword-group h2 {
    font-size: 1.2rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.keyword-group h2 i {
    color: var(--primary-color);
}

.btn-suggest {
    padding: 8px 15px;
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
    white-space: nowrap;
}

.btn-suggest:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.btn-suggest i {
    font-size: 0.9rem;
}

.help-text {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    line-height: 1.4;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.keyword-count {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: right;
}

.keyword-count span {
    font-weight: 600;
    color: var(--success-color);
}

/* コントロールセクション */
.control-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

/* 結果セクション */
.result-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid var(--light-color);
}

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

.result-header h2 {
    font-size: 1.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.result-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.result-count strong {
    font-size: 1.3rem;
    font-weight: 700;
}

.result-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.result-preview h3 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.preview-area {
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.keyword-item {
    padding: 10px;
    margin-bottom: 5px;
    background: white;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.keyword-item:hover {
    background: #e8f4f8;
}

.keyword-item.more {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    background: transparent;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--danger-color);
}

.notification.info {
    background: var(--info-color);
}

.notification.warning {
    background: var(--warning-color);
}

/* フッター */
footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* スクロールバー */
.preview-area::-webkit-scrollbar {
    width: 8px;
}

.preview-area::-webkit-scrollbar-track {
    background: #ecf0f1;
    border-radius: 4px;
}

.preview-area::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 4px;
}

.preview-area::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    main {
        padding: 20px;
    }

    .input-section {
        grid-template-columns: 1fr;
    }

    .keyword-group-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-suggest {
        width: 100%;
        justify-content: center;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .control-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .result-actions {
        flex-direction: column;
    }

    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .keyword-group {
        padding: 15px;
    }

    textarea {
        font-size: 0.9rem;
    }
}

/* モーダルスタイル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    font-size: 1.2rem;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.suggestion-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-color);
}

.category-btn {
    padding: 10px 18px;
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-color);
}

.category-btn:hover {
    background: #d5dbdb;
    transform: translateY(-2px);
}

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

.category-btn i {
    font-size: 1rem;
}

.category-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-btn.active .category-count {
    background: rgba(255, 255, 255, 0.3);
}

.suggestion-keywords {
    min-height: 200px;
}

.keywords-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.keywords-header h3 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin: 0;
}

.btn-select-all {
    padding: 8px 15px;
    background: var(--info-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-select-all:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.keywords-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-chip {
    padding: 8px 14px;
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--dark-color);
}

.keyword-chip:hover {
    background: #d5dbdb;
    transform: scale(1.05);
}

.keyword-chip.selected {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.keyword-chip i {
    font-size: 0.8rem;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 2px solid var(--light-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* モーダル内のスクロールバー */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #ecf0f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}

/* モーダルのレスポンシブ */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 20px;
    }

    .suggestion-categories {
        gap: 8px;
    }

    .category-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .keywords-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-select-all {
        width: 100%;
        justify-content: center;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}