* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    padding: 40px;
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 파도 애니메이션 제목 */
.title-container {
    text-align: center;
    margin-bottom: 40px;
    perspective: 1000px;
}

.wave-title {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: waveGradient 3s ease-in-out infinite;
    letter-spacing: 2px;
    display: inline-block;
}

.wave-title span {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

.wave-title span:nth-child(1) {
    animation-delay: 0s;
}

.wave-title span:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-title span:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-title span:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-title span:nth-child(5) {
    animation-delay: 0.4s;
}

.wave-title span:nth-child(6) {
    animation-delay: 0.5s;
}

.wave-title span:nth-child(7) {
    animation-delay: 0.6s;
}

.wave-title span:nth-child(8) {
    animation-delay: 0.7s;
}

.wave-title span:nth-child(9) {
    animation-delay: 0.8s;
}

@keyframes wave {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(5deg);
    }

    75% {
        transform: translateY(5px) rotate(-3deg);
    }
}

@keyframes waveGradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.subtitle {
    color: #666;
    font-size: 16px;
    margin-top: 10px;
    animation: fadeIn 1s ease-in 0.5s both;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

input,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

input:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    padding: 30px;
    display: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.result {
    display: none;
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.result h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 24px;
}

.result-content {
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 14px;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    .wave-title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 14px;
    }
}

/* 스크롤바 스타일 */
.result::-webkit-scrollbar {
    width: 8px;
}

.result::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.result::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.result::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* QR 코드 관련 스타일 추가 */
.qr-section {
    margin-top: 30px;
    border-top: 2px dashed #99aab5;
    padding-top: 20px;
    text-align: center;
}

.action-btn {
    padding: 12px 25px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-bottom: 20px;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.qr-code-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    max-width: 200px;
    /* QR 코드 크기 제한 */
    margin: 0 auto;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* 초기에는 숨김 */
    height: 0;
    overflow: hidden;
    padding: 0;
}

.qr-code-display.show {
    opacity: 1;
    transform: scale(1);
    height: auto;
    padding: 20px;
    margin-top: 20px;
}

.qr-code-display img {
    display: block;
    border-radius: 10px;
    /* QR 코드 이미지 자체의 둥글기 */
}

/* 여행 일정 테이블 스타일 */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.itinerary-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    overflow: hidden;
    min-width: 500px;
}

.itinerary-table thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: left;
}

.itinerary-table th,
.itinerary-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

/* 마법 같은 등장 애니메이션 */
.itinerary-table tbody tr {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.itinerary-table.reveal tbody tr {
    animation: slideUpFade 0.6s ease forwards;
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Row Animation (Max 7 days) */
.itinerary-table.reveal tr:nth-child(1) {
    animation-delay: 0.1s;
}

.itinerary-table.reveal tr:nth-child(2) {
    animation-delay: 0.3s;
}

.itinerary-table.reveal tr:nth-child(3) {
    animation-delay: 0.5s;
}

.itinerary-table.reveal tr:nth-child(4) {
    animation-delay: 0.7s;
}

.itinerary-table.reveal tr:nth-child(5) {
    animation-delay: 0.9s;
}

.itinerary-table.reveal tr:nth-child(6) {
    animation-delay: 1.1s;
}

.itinerary-table.reveal tr:nth-child(7) {
    animation-delay: 1.3s;
}

.activity {
    display: block;
    color: #333;
    position: relative;
    padding-left: 5px;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.itinerary-table.reveal .activity {
    animation: glowBorder 1.5s ease;
}

@keyframes glowBorder {
    0% {
        border-left-color: #667eea;
    }

    100% {
        border-left-color: transparent;
    }
}

/* 예상 비용 요약 스타일 */
.cost-summary {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.cost-item {
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #f0f0f0;
}

.cost-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
    font-weight: 600;
}

.cost-value {
    font-size: 1.1rem;
    color: #764ba2;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.highlight-total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4) !important;
}

@media (max-width: 600px) {
    .cost-summary {
        flex-direction: column;
        gap: 10px;
    }

    .cost-item {
        padding: 10px;
    }
}