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

:root {
    --pink-primary: #FF69B4;
    --green-accent: #00FF7F;
    --card-bg: #FFF5F8;
    --text-dark: #333;
    --text-medium: #444;
    --pink-light: #FFB6C1;
    --green-light: #98FB98;
    --sparkle-gold: #FFE780;
    --sparkle-yellow: #FFC107;
    --sweet-badge: #8BC34A;
    --sassy-badge: #FF9800;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--pink-primary);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    position: relative;
    padding: 1rem;
    background: linear-gradient(180deg, var(--pink-primary) 0%, #FF85C1 50%, #FFB6C1 100%);
}

/* Sparkles */
.sparkles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.sparkle {
    position: absolute;
    bottom: -50px;
    animation: floatUp linear infinite;
    color: var(--sparkle-gold);
    text-shadow: 0 0 10px var(--sparkle-yellow);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: var(--opacity, 0.5);
    }
    90% {
        opacity: var(--opacity, 0.5);
    }
    100% {
        transform: translateY(-100vh) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* Burst effect */
.burst-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
}

.burst-sparkle {
    position: absolute;
    font-size: 1.5rem;
    animation: burstOut 0.8s ease-out forwards;
    transform-origin: center;
}

@keyframes burstOut {
    0% {
        transform: rotate(var(--angle)) translateY(0) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: rotate(var(--angle)) translateY(150px) scale(1);
        opacity: 0;
    }
}

/* Main content */
.main-content {
    max-width: 550px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding-bottom: 100px;
}

/* Header */
.header {
    text-align: center;
    padding: 1.5rem 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.title {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    text-shadow: 
        0 0 20px rgba(0, 255, 127, 0.6),
        0 0 40px rgba(0, 255, 127, 0.4),
        2px 2px 0 var(--green-accent);
    animation: titleBounce 2s ease-in-out infinite;
    letter-spacing: -0.5px;
}

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

.favorites-toggle {
    background: white;
    border: 3px solid var(--green-accent);
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.favorites-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 255, 127, 0.3);
}

.fav-count {
    background: var(--pink-primary);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Input card */
.input-card {
    background: rgba(255, 245, 248, 0.95);
    border-radius: 25px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 1.25rem;
}

.mood-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 3px solid var(--pink-light);
    border-radius: 50px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.05rem;
    background: white;
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
}

.mood-input:focus {
    border-color: var(--green-accent);
    box-shadow: 0 0 0 4px rgba(0, 255, 127, 0.3);
}

.mood-input::placeholder {
    color: #B8A0B0;
}

.emoji-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.mood-emoji-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--pink-light);
    background: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mood-emoji-btn:hover {
    transform: scale(1.15);
    border-color: var(--green-accent);
    box-shadow: 0 4px 15px rgba(0, 255, 127, 0.3);
}

.mood-emoji-btn.selected {
    border-color: var(--green-accent);
    background: rgba(0, 255, 127, 0.15);
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(0, 255, 127, 0.2);
}

.sparkle-divider {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 1rem;
    opacity: 0.7;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Tone toggle */
.tone-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.tone-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    color: white;
    opacity: 0.6;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tone-label.active {
    opacity: 1;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

.tone-toggle {
    width: 56px;
    height: 28px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--green-light), var(--green-accent));
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.tone-toggle.spicy {
    background: linear-gradient(135deg, #FFB347, var(--sassy-badge));
}

.toggle-knob {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tone-toggle.spicy .toggle-knob {
    left: 30px;
}

/* Generate button */
.generate-btn {
    display: block;
    width: 100%;
    padding: 1.15rem 2rem;
    background: linear-gradient(135deg, var(--green-accent) 0%, #50FF9F 100%);
    border: none;
    border-radius: 50px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(0, 255, 127, 0.4);
    position: relative;
    overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 8px 35px rgba(0, 255, 127, 0.5);
}

.generate-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.generate-btn.loading {
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--green-light) 100%);
}

.loading-text {
    display: inline-flex;
    align-items: center;
}

.loading-dots {
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Compliments container */
.compliments-container {
    margin-top: 1.5rem;
}

.compliments-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Compliment card */
.compliment-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.25rem 1.25rem 1rem;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInSlideUp 0.5s ease-out backwards;
}

@keyframes fadeInSlideUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.tone-badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.tone-sweet {
    background: linear-gradient(135deg, #C8E6C9, #A5D6A7);
    color: #2E7D32;
}

.tone-sassy {
    background: linear-gradient(135deg, #FFE0B2, #FFCC80);
    color: #E65100;
}

.compliment-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-medium);
    padding-right: 2rem;
}

.favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: grayscale(0.5);
    opacity: 0.7;
}

.favorite-btn:hover {
    transform: scale(1.2);
    filter: grayscale(0);
    opacity: 1;
}

.favorite-btn.is-favorite {
    filter: grayscale(0);
    opacity: 1;
    animation: heartBeat 0.5s ease-out;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
}

/* Action buttons */
.compliment-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.more-btn, .clear-btn {
    flex: 1;
    padding: 0.9rem 1rem;
    border-radius: 50px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.more-btn {
    background: linear-gradient(135deg, var(--green-light) 0%, var(--green-accent) 100%);
    border: none;
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(0, 255, 127, 0.3);
}

.more-btn:hover:not(:disabled) {
    transform: scale(1.03);
}

.more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.clear-btn {
    background: white;
    border: 3px solid var(--pink-light);
    color: var(--text-dark);
}

.clear-btn:hover {
    border-color: var(--pink-primary);
    background: var(--card-bg);
}

/* Favorites drawer */
.favorites-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}

.favorites-drawer {
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: white;
    padding: 1.25rem;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--pink-light);
}

.favorites-header h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    color: var(--text-dark);
}

.close-drawer-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-drawer-btn:hover {
    background: var(--pink-light);
}

.favorites-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.no-favorites {
    text-align: center;
    color: #B8A0B0;
    padding: 2rem 1rem;
    font-style: italic;
}

.favorite-item {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 15px;
    position: relative;
    padding-right: 2.5rem;
    padding-left: 2.5rem;
}

.fav-tone-badge {
    position: absolute;
    left: 0.75rem;
    top: 0.85rem;
    font-size: 1rem;
}

.remove-fav-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.remove-fav-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.75rem;
    text-align: center;
    background: linear-gradient(transparent, rgba(255, 105, 180, 0.95));
    z-index: 10;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.footer a:hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    color: white;
}

/* Responsive */
@media (max-width: 640px) {
    .app-container {
        padding: 0.75rem;
    }
    
    .main-content {
        width: 95%;
    }
    
    .title {
        font-size: 1.7rem;
    }
    
    .input-card {
        padding: 1.25rem;
        border-radius: 20px;
    }
    
    .mood-input {
        font-size: 0.95rem;
        padding: 0.85rem 1.1rem;
    }
    
    .mood-emoji-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .generate-btn {
        font-size: 1.05rem;
        padding: 1rem 1.5rem;
    }
    
    .tone-label {
        font-size: 0.8rem;
    }
    
    .compliment-card {
        border-radius: 16px;
        padding: 1rem;
    }
    
    .compliment-text {
        font-size: 0.95rem;
    }
    
    .more-btn, .clear-btn {
        font-size: 0.9rem;
        padding: 0.8rem 0.75rem;
    }
    
    .favorites-drawer {
        max-width: 100%;
    }
}