/**
 * AI Travel Planner Pro - 스타일
 */

:root {
    --atp-primary: #667eea;
    --atp-primary-dark: #5a6fd6;
    --atp-secondary: #764ba2;
    --atp-accent: #f093fb;
    --atp-success: #4caf50;
    --atp-warning: #ff9800;
    --atp-danger: #f44336;
    --atp-text: #2c3e50;
    --atp-text-light: #7f8c8d;
    --atp-bg: #f8f9fa;
    --atp-white: #ffffff;
    --atp-border: #e0e0e0;
    --atp-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --atp-radius: 12px;
    --atp-radius-sm: 8px;
}

.atp-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Pretendard', 'Noto Sans KR', -apple-system, sans-serif;
    color: var(--atp-text);
    line-height: 1.6;
}

.atp-container * { box-sizing: border-box; }

/* 헤더 */
.atp-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--atp-primary) 0%, var(--atp-secondary) 100%);
    border-radius: var(--atp-radius);
    color: var(--atp-white);
}

.atp-title { margin: 0 0 10px; font-size: 28px; font-weight: 700; }
.atp-subtitle { margin: 0 0 20px; font-size: 16px; opacity: 0.9; }

.atp-badge {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.atp-badge span {
    background: rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
}

/* 폼 */
.atp-form {
    background: var(--atp-white);
    padding: 30px;
    border-radius: var(--atp-radius);
    box-shadow: var(--atp-shadow);
}

.atp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.atp-form-group { display: flex; flex-direction: column; }

.atp-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.atp-form-group select,
.atp-form-group input {
    padding: 12px 16px;
    border: 2px solid var(--atp-border);
    border-radius: var(--atp-radius-sm);
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--atp-white);
}

.atp-form-group select:focus,
.atp-form-group input:focus {
    outline: none;
    border-color: var(--atp-primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.2);
}

/* 날짜 선택 커스텀 */
.atp-form-group input[type="text"]:read-only {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* 가격 미리보기 */
.atp-price-preview {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: var(--atp-radius-sm);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #a5d6a7;
}

.atp-price-header {
    background: var(--atp-success);
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.atp-price-content { padding: 15px 20px; }

.atp-price-loading {
    text-align: center;
    padding: 15px;
    color: var(--atp-text-light);
}

.atp-mini-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--atp-primary);
    border-radius: 50%;
    animation: atp-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.atp-price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #c8e6c9;
}

.atp-price-row:last-of-type { border-bottom: none; }

.atp-price-row.atp-price-total {
    font-weight: 700;
    font-size: 18px;
    color: var(--atp-success);
    border-top: 2px solid #a5d6a7;
    margin-top: 10px;
    padding-top: 15px;
}

.atp-price-note {
    font-size: 12px;
    color: var(--atp-text-light);
    margin: 10px 0 0;
    text-align: right;
}

.atp-price-error {
    color: var(--atp-warning);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 제출 버튼 */
.atp-submit-btn {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--atp-primary), var(--atp-secondary));
    color: white;
    border: none;
    border-radius: var(--atp-radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.atp-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

.atp-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.atp-btn-text { font-size: 18px; }
.atp-btn-subtext { font-size: 12px; opacity: 0.85; font-weight: 400; }

/* 로딩 */
.atp-loading {
    text-align: center;
    padding: 60px 20px;
    background: var(--atp-white);
    border-radius: var(--atp-radius);
    box-shadow: var(--atp-shadow);
    margin-top: 20px;
}

.atp-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--atp-border);
    border-top-color: var(--atp-primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: atp-spin 1s linear infinite;
}

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

.atp-loading-main { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.atp-loading-sub { font-size: 14px; color: var(--atp-text-light); margin: 0; animation: atp-pulse 1.5s ease-in-out infinite; }

@keyframes atp-pulse { 0%,100% { opacity:0.5; } 50% { opacity:1; } }

/* 결과 */
.atp-result { margin-top: 30px; }

.atp-result-header {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    border-radius: var(--atp-radius) var(--atp-radius) 0 0;
    color: white;
}

.atp-result-header h3 { margin: 0 0 8px; font-size: 22px; }
.atp-result-header p { margin: 0; opacity: 0.9; font-size: 14px; }

/* 요금 요약 카드 */
.atp-fare-summary {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    padding: 20px;
    border-left: 4px solid var(--atp-warning);
}

.atp-fare-summary h4 {
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.atp-fare-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.atp-fare-item {
    background: white;
    padding: 12px;
    border-radius: var(--atp-radius-sm);
}

.atp-fare-item-label { font-size: 12px; color: var(--atp-text-light); }
.atp-fare-item-value { font-size: 18px; font-weight: 700; color: var(--atp-primary); }

.atp-fare-total {
    grid-column: 1 / -1;
    text-align: center;
    padding: 15px;
    background: var(--atp-warning);
    color: white;
    border-radius: var(--atp-radius-sm);
    font-size: 20px;
    font-weight: 700;
}

/* 일정 카드 */
.atp-itinerary {
    background: var(--atp-white);
    padding: 25px;
    border-radius: 0 0 var(--atp-radius) var(--atp-radius);
    box-shadow: var(--atp-shadow);
}

.atp-day-card {
    background: var(--atp-bg);
    border-radius: var(--atp-radius-sm);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--atp-border);
}

.atp-day-header {
    background: linear-gradient(135deg, var(--atp-primary), var(--atp-secondary));
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.atp-day-number {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 14px;
}

.atp-day-title { font-size: 16px; font-weight: 600; }

.atp-day-schedule { list-style: none; padding: 20px; margin: 0; }

.atp-day-schedule li {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--atp-border);
}

.atp-day-schedule li:last-child { border-bottom: none; }

.atp-time {
    background: var(--atp-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.atp-activity { flex: 1; font-size: 15px; }

.atp-tip {
    width: 100%;
    margin-left: 72px;
    font-size: 13px;
    color: var(--atp-primary);
    background: rgba(102,126,234,0.1);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 5px;
}

.atp-day-highlight {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--atp-border);
}

.atp-highlight-icon { font-size: 20px; }
.atp-highlight-text { font-size: 14px; color: #e65100; font-weight: 500; }

/* CTA 섹션 */
.atp-cta-section {
    background: linear-gradient(135deg, #f5f7fa, #e8ecf1);
    padding: 30px;
    border-radius: var(--atp-radius);
    margin-top: 25px;
    text-align: center;
}

.atp-cta-question {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.atp-cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.atp-cta-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: var(--atp-radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
}

.atp-cta-email {
    background: white;
    color: var(--atp-text);
    border: 2px solid var(--atp-border);
}

.atp-cta-email:hover { border-color: var(--atp-primary); color: var(--atp-primary); }

.atp-cta-booking {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.atp-cta-booking:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238,90,36,0.4);
}

.atp-cta-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ffd700;
    color: #333;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
    animation: atp-bounce 2s infinite;
}

@keyframes atp-bounce { 0%,100% { transform:scale(1); } 50% { transform:scale(1.1); } }

/* 이메일 폼 */
.atp-email-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--atp-border);
}

.atp-email-input-group {
    display: flex;
    gap: 10px;
    max-width: 450px;
    margin: 15px auto;
}

.atp-email-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--atp-border);
    border-radius: var(--atp-radius-sm);
}

.atp-email-submit {
    background: var(--atp-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--atp-radius-sm);
    font-weight: 600;
    cursor: pointer;
}

.atp-email-submit:hover { background: var(--atp-primary-dark); }
.atp-email-privacy { font-size: 12px; color: var(--atp-text-light); }

.atp-email-success {
    background: #e8f5e9;
    color: var(--atp-success);
    padding: 15px;
    border-radius: var(--atp-radius-sm);
    font-weight: 600;
}

/* 추가 링크 */
.atp-extra-links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--atp-border);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.atp-extra-links a {
    color: var(--atp-primary);
    text-decoration: none;
    font-size: 14px;
}

.atp-extra-links a:hover { text-decoration: underline; }

/* 리셋 버튼 */
.atp-reset-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 25px auto 0;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid var(--atp-border);
    border-radius: var(--atp-radius-sm);
    color: var(--atp-text-light);
    cursor: pointer;
}

.atp-reset-btn:hover { border-color: var(--atp-primary); color: var(--atp-primary); }

/* 에러 */
.atp-error {
    text-align: center;
    padding: 40px 20px;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: var(--atp-radius);
    margin-top: 20px;
}

.atp-error p { margin: 0 0 10px; color: var(--atp-danger); }
.atp-error-detail { font-size: 13px; color: var(--atp-text-light); }

.atp-retry-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--atp-danger);
    color: white;
    border: none;
    border-radius: var(--atp-radius-sm);
    cursor: pointer;
}

/* 반응형 */
@media (max-width: 768px) {
    .atp-form-grid { grid-template-columns: 1fr; }
    .atp-title { font-size: 22px; }
    .atp-cta-buttons { flex-direction: column; }
    .atp-cta-btn { width: 100%; justify-content: center; }
    .atp-email-input-group { flex-direction: column; }
    .atp-fare-detail { grid-template-columns: 1fr; }
    .atp-day-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .atp-tip { margin-left: 0; }
    .atp-extra-links { flex-direction: column; text-align: center; }
}

/* jQuery UI Datepicker 커스텀 */
.ui-datepicker {
    font-family: inherit;
    border-radius: var(--atp-radius-sm);
    box-shadow: var(--atp-shadow);
}

.ui-datepicker-header {
    background: var(--atp-primary);
    color: white;
    border: none;
    border-radius: var(--atp-radius-sm) var(--atp-radius-sm) 0 0;
}

.ui-datepicker td a {
    text-align: center;
    padding: 8px;
}

.ui-datepicker td a:hover {
    background: var(--atp-primary);
    color: white;
    border-radius: 4px;
}

.ui-state-active {
    background: var(--atp-primary) !important;
    color: white !important;
}
