@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700&display=swap');

:root {
    /* Candy Pop Palette */
    --bg-primary: #fef7f0;
    --bg-secondary: #fff5eb;
    --bg-card: #ffffff;

    /* Text Colors */
    --text-primary: #4a4a4a;
    --text-secondary: #6b6b6b;
    --text-muted: #999999;

    /* Accent Colors */
    --accent-pink: #ff6b9d;
    --accent-orange: #ff9f43;
    --accent-yellow: #ffc048;
    --accent-green: #26de81;
    --accent-blue: #45aaf2;
    --accent-purple: #a55eea;

    /* Functional */
    --success: #26de81;
    --border: #ffe0cc;
    --border-strong: #ffd0b0;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.1);
    --shadow-md: 0 4px 16px rgba(255, 107, 157, 0.15);
    --shadow-lg: 0 8px 32px rgba(255, 107, 157, 0.2);

    /* Typography */
    --font-main: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic Pro', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Transitions */
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff0f5 50%, #f0f8ff 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.8;
    font-size: 15px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

/* ===== HEADER ===== */
header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding: var(--space-xl) 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.logo-icon {
    font-size: 2.5rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

header h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange), var(--accent-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-top: var(--space-sm);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.feedback-link {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    transition: all 0.3s var(--ease-bounce);
}

.feedback-link:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.share-buttons {
    display: flex;
    gap: var(--space-xs);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-sm);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 18px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s var(--ease-bounce);
}

.share-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-sm);
}

.share-btn-line {
    background: #06C755;
    border-color: #06C755;
    color: white;
    font-size: 0.7rem;
}

.share-btn-line:hover {
    background: #05b34d;
}

/* ===== EDITOR SECTION ===== */
.editor-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.input-area,
.output-area {
    display: flex;
    flex-direction: column;
}

.input-area label,
.output-area label {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.label-icon {
    font-size: 1.2rem;
}

textarea {
    width: 100%;
    height: 180px;
    padding: var(--space-lg);
    border: 3px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-main);
    line-height: 1.8;
    resize: vertical;
    transition: all 0.3s var(--ease-out);
}

textarea:hover {
    border-color: var(--border-strong);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.15);
}

textarea::placeholder {
    color: var(--text-muted);
}

#outputText {
    background: linear-gradient(135deg, #fff 0%, #fff5f8 100%);
    border-color: var(--accent-pink);
}

.arrow-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) 0;
}

.arrow-divider span:first-child {
    font-size: 2rem;
    animation: bounce 1s ease-in-out infinite;
}

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

.arrow-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-pink);
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-stats,
.output-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-copy {
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-main);
    transition: all 0.3s var(--ease-bounce);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.btn-copy:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.btn-copy:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-copy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-regenerate {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-main);
    transition: all 0.3s var(--ease-bounce);
}

.btn-regenerate:hover {
    background: var(--bg-card);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-2px);
}

/* ===== OPTIONS SECTION ===== */
.options-section {
    background: var(--bg-card);
    border-radius: 30px;
    padding: var(--space-xl);
    border: 3px solid var(--border);
    box-shadow: var(--shadow-md);
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px dashed var(--border);
}

.options-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-buttons {
    display: flex;
    gap: var(--space-sm);
}

.btn-small {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-main);
    transition: all 0.3s var(--ease-bounce);
}

.btn-small:hover {
    background: var(--bg-card);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-2px);
}

/* Option Groups */
.option-group {
    margin-bottom: var(--space-xl);
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(90deg, var(--bg-secondary), transparent);
    border-radius: 10px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-sm);
}

/* Individual Options */
.option {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.option:hover {
    background: var(--bg-card);
    border-color: var(--border);
    transform: translateX(5px);
}

.option:has(input:checked) {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(255, 159, 67, 0.1));
    border-color: var(--accent-pink);
}

.option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin-right: var(--space-md);
    border: 2px solid var(--border-strong);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s var(--ease-bounce);
    background: var(--bg-card);
}

.option input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
    border-color: var(--accent-pink);
}

.option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.option:has(input:checked) .option-title {
    color: var(--accent-pink);
    font-weight: 700;
}

.option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: var(--space-2xl);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
    color: white;
    padding: var(--space-md) var(--space-xl);
    border-radius: 25px;
    font-weight: 700;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease-bounce);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* ===== MOBILE COPY BAR ===== */
.mobile-copy-bar {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
        padding-bottom: 90px;
    }

    header {
        margin-bottom: var(--space-lg);
        padding: var(--space-md) 0;
    }

    .logo-icon {
        font-size: 1.8rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    textarea {
        height: 150px;
        padding: var(--space-md);
        font-size: 16px;
        border-radius: 15px;
    }

    .options-section {
        padding: var(--space-md);
        border-radius: 20px;
    }

    .options-header {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: stretch;
    }

    .header-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .btn-small {
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

    .option {
        min-height: 56px;
    }

    .output-actions .btn-copy {
        display: none;
    }

    .mobile-copy-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 2px solid var(--border);
        padding: var(--space-sm) var(--space-md);
        align-items: center;
        justify-content: space-between;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(255, 107, 157, 0.1);
    }

    .mobile-copy-bar .char-info {
        font-size: 0.75rem;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-copy-bar .btn-copy-mobile {
        padding: var(--space-md) var(--space-xl);
        background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
        color: white;
        border: none;
        border-radius: 20px;
        font-size: 0.9rem;
        font-weight: 700;
        font-family: var(--font-main);
        min-height: 48px;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    }

    .mobile-copy-bar .btn-copy-mobile:disabled {
        opacity: 0.5;
    }

    .toast {
        bottom: 90px;
        left: var(--space-md);
        right: var(--space-md);
        transform: translateY(20px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

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

    .logo-icon {
        font-size: 1.5rem;
    }
}
