/* Google Fonts for cute typography */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&display=swap');

/* カスタムCSS変数 */
:root {
    --primary-color: #ff6b9d;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe066;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-background: rgba(255, 255, 255, 0.95);
    --shadow: 0 15px 35px rgba(50, 50, 93, 0.1);
    --border-radius: 20px;
}

/* 基本リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 背景の装飾要素 */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    animation: float 20s infinite linear;
    z-index: -1;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
    }
}

/* メインコンテナ */
main {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 650px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

main::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: var(--border-radius);
    z-index: -1;
    opacity: 0.7;
}

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

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    position: relative;
}

header h1::after {
    content: '✨';
    position: absolute;
    top: -10px;
    right: -30px;
    font-size: 1.5rem;
    animation: sparkle 2s infinite ease-in-out;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

header p {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 400;
}

/* 入力セクション */
.input-section {
    margin-bottom: 30px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    border: 2px solid transparent;
    border-radius: 15px;
    font-family: inherit;
    font-size: 1rem;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

textarea::placeholder {
    color: var(--text-light);
    font-style: italic;
}

/* かわいいボタン */
.generate-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary-color), #ff8fab);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.5px;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 107, 157, 0.4);
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(-1px);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 結果表示セクション */
.results-section {
    margin-top: 30px;
}

/* ローディング */
.loader {
    text-align: center;
    padding: 40px 20px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.loader::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 15px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none;
}

/* 結果リスト */
.results-list {
    margin: 0;
    padding: 0;
}

.results-list dt {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 25px 0 8px 0;
    position: relative;
    padding-left: 30px;
}

.results-list dt::before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.results-list dt:first-child {
    margin-top: 15px;
}

.results-list dd {
    margin: 0 0 15px 30px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9ff, #f0f8ff);
    border-radius: 12px;
    border-left: 4px solid var(--secondary-color);
    color: var(--text-dark);
    line-height: 1.6;
    font-weight: 400;
    position: relative;
    transition: transform 0.2s ease;
}

.results-list dd:hover {
    transform: translateX(5px);
}

.results-list dd::before {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 空状態メッセージ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
    background: linear-gradient(135deg, #f8f9ff, #f0f8ff);
    border-radius: 15px;
    border: 2px dashed #e0e6ed;
}

.empty-state::before {
    content: '🎯';
    display: block;
    font-size: 3rem;
    margin-bottom: 15px;
}

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

    header h1 {
        font-size: 1.8rem;
    }

    header h1::after {
        right: -20px;
        font-size: 1.2rem;
    }

    textarea {
        min-height: 100px;
        padding: 15px;
    }

    .generate-btn {
        padding: 15px 25px;
        font-size: 1rem;
    }

    .results-list dt {
        font-size: 1.2rem;
        padding-left: 25px;
    }

    .results-list dd {
        margin-left: 25px;
        padding: 12px 15px;
    }
}

/* フォーカス時のアクセシビリティ改善 */
*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.generate-btn:focus {
    outline-color: white;
}

/* Notification CSS (from original script) */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    20%,
    80% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.copyright {
    text-align: center;
    margin-top: 30px;
    font-size: 0.9em;
    color: var(--text-light);
}