:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --background: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --smile-active: #F59E0B;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', sans-serif;
}

body {
    background-color: var(--background);
    background-image: radial-gradient(circle at top right, #E0E7FF, transparent),
                      radial-gradient(circle at bottom left, #D1FAE5, transparent);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    background: var(--surface);
    width: 100%;
    max-width: 480px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
}

header {
    background: linear-gradient(135deg, var(--primary), #818CF8);
    color: white;
    padding: 35px 30px;
    text-align: center;
}

.logo-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: #D1FAE5;
    animation: floating 3s ease-in-out infinite;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

header p {
    font-size: 0.95rem;
    color: #E0E7FF;
    line-height: 1.4;
    font-weight: 400;
}

main {
    padding: 30px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    resize: none;
    transition: all 0.3s ease;
    background: #F9FAFB;
    color: var(--text-main);
    font-family: 'Pretendard', sans-serif;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

textarea::placeholder {
    color: #9CA3AF;
}

.photo-upload {
    display: flex;
    align-items: center;
    gap: 15px;
}

.upload-btn {
    background: white;
    border: 2px dashed var(--border);
    color: var(--text-muted);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #F5F3FF;
}

.photo-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating-section {
    background: #F9FAFB;
    padding: 24px 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.rating-section label {
    margin-bottom: 4px;
}

.rating-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.smile-rating {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.smile-btn {
    background: white;
    border: 1px solid var(--border);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #D1D5DB;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.smile-btn:hover {
    transform: translateY(-3px);
    color: #9CA3AF;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.smile-btn.active {
    color: white;
    background: var(--smile-active);
    border-color: var(--smile-active);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.3);
}

.submit-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    margin-top: 10px;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

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

/* Overlay and Animations */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.animation-container {
    text-align: center;
    position: relative;
    max-width: 400px;
    width: 100%;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flying-plane {
    font-size: 5rem;
    color: var(--primary);
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.success-message {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: white;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.overlay.show .flying-plane {
    animation: flyPlane 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.overlay.show .success-message {
    /* Delay the success message until plane flies by */
    animation: fadeInMessage 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.2s;
}

.check-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #D1FAE5;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
    position: relative;
}

.check-icon-wrapper i {
    font-size: 3rem;
    color: var(--secondary);
    animation: scaleCheck 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.5s backwards;
}

.success-message h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--text-main);
    font-weight: 700;
}

.success-message p {
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.close-btn {
    background: #F3F4F6;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
    width: 100%;
}

.close-btn:hover {
    background: #E5E7EB;
    transform: translateY(-1px);
}

@keyframes flyPlane {
    0% {
        opacity: 0;
        transform: translate(-50%, 100%) scale(0.5) rotate(-20deg);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1) rotate(0deg);
    }
    40% {
        transform: translate(0, -30%) scale(1.1) rotate(15deg);
    }
    100% {
        opacity: 0;
        transform: translate(250%, -150%) scale(0.6) rotate(45deg);
    }
}

@keyframes floating {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes scaleCheck {
    from { transform: scale(0); }
    80% { transform: scale(1.2); }
    to { transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .app-container {
        border-radius: 0;
        min-height: 100vh;
        max-width: 100%;
    }
    body {
        padding: 0;
    }
    .success-message {
        box-shadow: none;
        padding: 20px;
    }
}
