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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* メインコンテナ */
.main-container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
}

/* 広告コンテナ */
.ad-container {
    flex: 0 0 300px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.ad-wrapper {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.affiliate-area {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.affiliate-area h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.affiliate-link img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.affiliate-link:hover img {
    transform: scale(1.05);
}

.related-content {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* メインコンテンツ */
.content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

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

.header-content h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

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

.tagline {
    font-size: 1.2em;
    font-weight: 300;
    opacity: 0.9;
}

/* タブ */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    flex: 1;
    padding: 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button i {
    margin-right: 8px;
}

.tab-button:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    background: white;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #667eea;
}

/* タブコンテンツ */
.tab-content {
    display: none;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

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

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

/* 入力セクション */
.input-section h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #2c3e50;
}

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

.input-info {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #1976d2;
}

.input-info i {
    margin-right: 5px;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: #fafafa;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.char-counter {
    text-align: right;
    margin-top: 5px;
    font-size: 0.85em;
    color: #666;
}

.char-counter.warning {
    color: #f39c12;
}

.char-counter.danger {
    color: #e74c3c;
}

/* アクションボタン */
.action-button {
    margin-top: 20px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.action-button:active {
    transform: translateY(0);
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.action-button i {
    margin-right: 8px;
}

/* 結果セクション */
.result-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    animation: slideIn 0.5s ease;
}

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

.result-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #2c3e50;
}

.result-section h3 i {
    margin-right: 10px;
    color: #27ae60;
}

.result-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

.corrected-text {
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.suggestions {
    margin-top: 20px;
}

.suggestion-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #fff9e6;
    border-radius: 8px;
    border-left: 4px solid #f39c12;
}

.reply-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reply-option {
    padding: 20px;
    background: #f0f8ff;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.reply-option:hover {
    border-color: #3498db;
    transform: translateX(5px);
}

.reply-option h4 {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.copy-button {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* ローディング */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* エラーメッセージ */
.error-message {
    background: #fee;
    color: #c33;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #c33;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 利用規約同意 */
.terms-notice {
    margin-top: 30px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
}

.terms-notice a {
    color: #667eea;
    text-decoration: none;
}

.terms-notice a:hover {
    text-decoration: underline;
}

/* Cookie同意バナー */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(45, 52, 54, 0.95);
    color: white;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-content p {
    flex: 1;
    margin: 0;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-button {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cookie-button.accept {
    background: #667eea;
    color: white;
}

.cookie-button.accept:hover {
    background: #5a67d8;
}

.cookie-button.reject {
    background: transparent;
    color: white;
    border: 1px solid white;
}

.cookie-button.reject:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* フッター */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 20px 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
    font-size: 0.9em;
    opacity: 0.8;
}

.footer-copyright {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.7;
}

.footer-copyright a {
    color: white;
    text-decoration: none;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* レスポンシブデザイン */
@media (max-width: 1200px) {
    .ad-container {
        display: none;
    }
    
    .main-container {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.8em;
    }
    
    .tab-button {
        padding: 15px 10px;
        font-size: 0.95em;
    }
    
    .tab-button i {
        display: block;
        margin: 0 auto 5px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    textarea {
        min-height: 150px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .copy-button {
        position: static;
        margin-top: 15px;
        width: 100%;
    }
}