:root {
    --primary: oklch(0.7 0.2 140); /* Fresh Green */
    --primary-dark: oklch(0.6 0.2 140);
    --secondary: oklch(0.75 0.15 45); /* Warm Orange */
    --accent: oklch(0.6 0.15 250); /* Soft Blue */
    --bg: oklch(0.98 0.01 100);
    --text: oklch(0.2 0.02 100);
    --card-bg: rgba(255, 255, 255, 0.7);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --radius: 20px;
}

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

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.background-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3排%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
}

.brand-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.lang-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.nav-links a {
    text-decoration: none;
    color: oklch(0.5 0.02 100);
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-dark);
}

/* App & Content Layout */
#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.content-page {
    background: white;
    padding: 40px !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 40px !important;
}

.policy-content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--primary-dark);
    font-size: 1.4rem;
}

.policy-content p {
    margin-bottom: 15px;
    color: oklch(0.3 0.02 100);
}

.policy-content ul, .policy-content ol {
    margin-left: 20px;
    margin-bottom: 20px;
    color: oklch(0.3 0.02 100);
}

.policy-content li {
    margin-bottom: 8px;
}

.policy-content a {
    color: var(--primary);
}

header {
    text-align: center;
    margin-bottom: 60px;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: oklch(0.5 0.02 100);
    font-size: 1.2rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}

.subtitle {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

#selected-cuisine-display {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Steps Handling */
.step {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.step.active {
    display: block;
}

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

/* Cuisine Selector */
.cuisine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.cuisine-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.cuisine-card:hover {
    transform: translateY(-10px);
    background: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.cuisine-card .emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.cuisine-card .label {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Ingredient Input */
.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 50px;
    box-shadow: var(--shadow);
}

#ingredient-input {
    flex: 1;
    border: none;
    padding: 15px 25px;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

#add-ingredient-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

#add-ingredient-btn:hover {
    background: var(--primary-dark);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    min-height: 50px;
    justify-content: center;
}

.tag {
    background: oklch(0.9 0.05 140);
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: scaleIn 0.3s ease;
    border: 1px solid transparent;
}

.tag.default-tag {
    background: white;
    border: 1px dashed var(--primary);
    color: var(--primary-dark);
}

.tag.default-tag small {
    opacity: 0.6;
    font-size: 0.7rem;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.tag .remove {
    cursor: pointer;
    font-size: 1.2rem;
    color: oklch(0.4 0.1 20);
}

/* Buttons */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
}

.primary-btn, .secondary-btn {
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.primary-btn {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px oklch(0.7 0.2 140 / 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px oklch(0.7 0.2 140 / 0.4);
}

.secondary-btn {
    background: oklch(0.9 0.01 100);
    color: var(--text);
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.recipe-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
}

.recipe-img {
    width: 100%;
    height: 180px;
    background: oklch(0.9 0.02 100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.recipe-info {
    padding: 20px;
}

.recipe-info h3 {
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.recipe-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: oklch(0.5 0.02 100);
}

.match-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--secondary);
    color: white;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 10px;
}

/* Modal */
#recipe-modal {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    max-width: 600px;
    width: 90%;
    margin: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

#recipe-modal::backdrop {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    padding: 40px;
    background: white;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

/* Ad Containers */
.ad-container {
    width: 100%;
    margin: 20px 0;
    min-height: 90px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.top-ad {
    margin-top: -30px;
    margin-bottom: 40px;
}

.bottom-ad {
    margin-top: 40px;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--primary);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Footer */
footer {
    margin-top: 80px;
    padding: 40px 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.footer-content p {
    color: oklch(0.5 0.02 100);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    text-decoration: none;
    font-size: 0.85rem;
    color: oklch(0.4 0.02 100);
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 600px) {
    header h1 { font-size: 2.2rem; }
    .top-nav { padding: 15px 20px; }
    .content-page { padding: 20px !important; }
    .cuisine-grid { grid-template-columns: 1fr 1fr; }
    .primary-btn, .secondary-btn { width: 100%; }
    .action-bar { flex-direction: column; }
    .ad-container { min-height: 50px; }
    .footer-links { flex-direction: column; gap: 10px; }
}
