:root {
    --primary: #0f172a;
    --accent: #38bdf8;
    --bg: #f8fafc;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius: 24px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Blobs for Atmosphere */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #bae6fd;
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #e0f2fe;
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 40px) scale(1.1); }
}

.app-container {
    width: 90%;
    max-width: 600px;
    padding: 40px 0;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.accent {
    color: var(--accent);
    background: linear-gradient(to right, #0ea5e9, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 8px;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

input[type="text"] {
    flex: 1;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.primary-btn {
    padding: 0 24px;
    border-radius: 16px;
    border: none;
    background-color: #e2e8f0; /* 배경보다 살짝 진한 색 */
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background-color: #cbd5e1;
    transform: translateY(-2px);
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -12px;
    margin-bottom: 16px;
    padding-left: 4px;
}

.stack-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 45px;
}

.chip {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: chipIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chipIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.remove-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.remove-btn:hover {
    color: #ef4444;
}

.action-section {
    text-align: center;
    margin: 32px 0;
}

.analyze-btn {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.3);
    transition: all 0.3s ease;
}

.analyze-btn:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(14, 165, 233, 0.4);
}

.analyze-btn.disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.hidden {
    display: none !important;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.caution { background: #fef3c7; color: #92400e; }
.badge.good { background: #dcfce7; color: #166534; }
.badge.excellent { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.badge.warning { background: #fee2e2; color: #991b1b; }

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    gap: 20px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(56, 189, 248, 0.1);
    border-left: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.interaction-item {
    padding: 24px 0;
    border-bottom: 1px solid #e2e8f0;
}

.interaction-item:last-child {
    border-bottom: none;
}

.interaction-title {
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* 양 끝 정렬 */
    gap: 10px;
    font-size: 1.05rem;
}

.title-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #cbd5e1;
    transition: all 0.3s ease;
    padding: 4px;
}

.like-btn.active {
    color: #f43f5e;
}

.like-btn:hover {
    transform: scale(1.2);
}

.verified-badge {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 800;
}

.interaction-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Tabs */
.tab-menu {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-btn:hover:not(.active) {
    background: rgba(15, 23, 42, 0.05);
}

/* Timing Guide */
.timing-result-container {
    margin-top: 24px;
}

.timing-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.5s ease-out;
}

.timing-badge-row {
    display: flex;
    gap: 8px;
}

.time-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
}

.time-badge.morning { background: #fff7ed; color: #9a3412; }
.time-badge.night { background: #f5f3ff; color: #5b21b6; }
.time-badge.empty { background: #f0fdf4; color: #166534; }
.time-badge.after-meal { background: #ecfeff; color: #155e75; }

.timing-info h3 {
    margin-bottom: 16px;
    font-size: 1.4rem;
    font-weight: 700;
}

.timing-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 16px;
}

.timing-section.avoid {
    background: #fff1f2;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.timing-section.avoid .section-title {
    color: #e11d48;
}

.section-content {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.timing-warning {
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Coupang Button - Glassmorphism Style */
.coupang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 26, 46, 0.2);
    color: #e51a2e; /* Coupang Red */
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.coupang-btn:hover {
    background: rgba(229, 26, 46, 0.08);
    border-color: rgba(229, 26, 46, 0.4);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 25px rgba(229, 26, 46, 0.15);
    color: #d11628;
}

.coupang-btn::before {
    content: '🛒';
    font-size: 1.1rem;
}

.coupang-btn:active {
    transform: translateY(-1px);
}
