@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    --accent-color: #FF758C;
    --accent-hover: #FF7EB3;
    --bg-dark: #121212;
    --text-white: #FFFFFF;
    --border-dark: rgba(255, 255, 255, 0.1);
    --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Pretendard', sans-serif; }
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}
body { background-color: var(--bg-dark); color: var(--text-white); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; font-family: inherit; }

/* 1. Dark Top Header */
.top-header {
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(15px);
    height: 70px; display: flex; justify-content: center;
    border-bottom: 1px solid var(--border-dark);
}
.header-inner { width: 100%; max-width: var(--max-width); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.logo-text {
    background: linear-gradient(to right, #FF758C, #FF7EB3);
    -webkit-background-clip: text; color: transparent;
    font-weight: 900; font-size: 1.8rem; letter-spacing: -1px;
}
.header-actions { display: flex; align-items: center; gap: 20px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box input {
    background-color: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-dark);
    border-radius: 20px; padding: 10px 40px 10px 20px; color: #fff; width: 220px; font-size: 0.9rem; outline: none; transition: 0.3s;
}
.search-box input:focus { border-color: var(--accent-color); background-color: rgba(255, 255, 255, 0.1); }
.search-box input::placeholder { color: #666; }
.search-box svg { position: absolute; right: 12px; color: #888; width: 18px; }
.icon-btn { color: #aaa; display: flex; align-items: center; justify-content: center; transition: color 0.3s; }
.icon-btn:hover { color: #fff; }
.login-btn {
    background: linear-gradient(135deg, #FF758C, #FF7EB3);
    color: #fff; font-weight: 700; font-size: 0.95rem; padding: 10px 24px; border-radius: 24px; margin-left: 8px;
    box-shadow: 0 4px 15px rgba(255, 117, 140, 0.3); transition: transform 0.2s, box-shadow 0.2s;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 117, 140, 0.5); }

/* 2. Dark Sub Header */
.sub-header {
    background-color: var(--bg-dark); border-bottom: 1px solid var(--border-dark); height: 60px; display: flex; justify-content: center;
}
.sub-inner { width: 100%; max-width: var(--max-width); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.menu-left .hamburger-btn { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; color: #fff; }
.menu-right { display: flex; align-items: center; gap: 24px; font-size: 0.95rem; font-weight: 500; color: #bbb; }
.menu-right a:hover { color: #fff; }
.divider { color: #444; }
.partner-menu { position: relative; display: flex; align-items: center; }
.tooltip {
    position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
    background: rgba(40, 40, 40, 0.9); backdrop-filter: blur(10px); border: 1px solid var(--border-dark);
    color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; white-space: nowrap; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.tooltip::before { content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 10px; height: 10px; background-color: rgba(40, 40, 40, 0.9); border-left: 1px solid var(--border-dark); border-top: 1px solid var(--border-dark); }
.tooltip .highlight { color: var(--accent-color); font-weight: 800; }
.close-tooltip { color: #888; font-size: 0.8rem; }
.close-tooltip:hover { color: #fff; }

/* 3. Main Carousel Section */
.carousel-section { width: 100%; max-width: var(--max-width); margin: 50px auto; padding: 0 20px; }
.slider-container { overflow: hidden; border-radius: 20px; }
.slider-track { display: flex; gap: 24px; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }

/* Cinematic Glassmorphism Cards */
.slider-card {
    flex: 0 0 calc(33.333% - 16px); height: 380px; border-radius: 20px; position: relative; overflow: hidden; padding: 35px;
    display: flex; flex-direction: column; justify-content: space-between;
    background: rgba(25, 25, 25, 0.6); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1);
}

.card-blue { background: linear-gradient(135deg, rgba(30,30,40,0.8), rgba(15,15,20,0.9)); }
.card-green { background: linear-gradient(135deg, rgba(30,40,30,0.8), rgba(15,20,15,0.9)); }
.card-yellow { background: linear-gradient(135deg, rgba(40,35,20,0.8), rgba(20,15,10,0.9)); }

.card-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; }
.badge {
    align-self: flex-start; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: 30px; margin-bottom: 16px; backdrop-filter: blur(5px);
}
.card-title { color: #fff; font-size: 1.5rem; font-weight: 800; line-height: 1.4; letter-spacing: -0.5px; margin-top: 0; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.card-tutor { color: var(--accent-color); font-size: 0.95rem; font-weight: 700; margin-top: auto; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }

.card-image {
    position: absolute; bottom: 0; right: 0; width: 80%; height: 100%;
    background-size: cover; background-position: center right; background-repeat: no-repeat; z-index: 1; opacity: 0.7; 
    /* 이미지와 배경이 자연스럽게 섞이도록 선형 그라데이션 마스크 적용 */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 50%);
    mask-image: linear-gradient(to right, transparent 0%, black 50%);
}
.bg-card-1 { background-image: url("images/카드로/1.jpg"); }
.bg-card-2 { background-image: url("images/카드로/2.jpg"); }
.bg-card-3 { background-image: url("images/카드로/3.png"); }
.bg-card-4 { background-image: url("images/카드로/4.jpg"); }
.bg-card-5 { background-image: url("images/카드로/5.jpg"); }
.bg-card-6 { background-image: url("images/카드로/6.png"); }
.bg-card-7 { background-image: url("images/카드로/7.gif"); }
.bg-card-8 { background-image: url("images/카드로/6d5f1912-a8dd-4a16-900b-3b9da29007e6.jpg"); }
.bg-card-9 { background-image: url("images/카드로/Gemini_Generated_Image_onj44ionj44ionj4 (1).jpg"); }

/* Slider Controls */
.slider-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.progress-bar { flex-grow: 1; height: 4px; background-color: rgba(255,255,255,0.1); margin-right: 30px; border-radius: 2px; position: relative; overflow: hidden; }
.progress-fill { position: absolute; top: 0; left: 0; height: 100%; width: 33.333%; background: linear-gradient(to right, #FF758C, #FF7EB3); transition: left 0.4s cubic-bezier(0.25, 1, 0.5, 1); box-shadow: 0 0 10px rgba(255,117,140,0.5); }
.nav-buttons { display: flex; gap: 12px; }
.nav-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; color: #fff; transition: 0.3s; backdrop-filter: blur(5px); }
.nav-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); transform: scale(1.05); }
.nav-btn svg { width: 20px; height: 20px; }

/* 6. Best Class Section */
.best-class-section { width: 100%; max-width: 1200px; margin: 40px auto 80px; padding: 0 20px; }
.best-class-wrapper { background: transparent; padding: 20px 0; }
.best-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.best-title { font-size: 1.5rem; font-weight: 800; color: #fff; margin: 0; letter-spacing: -0.5px; }
.view-all { font-size: 0.9rem; color: #aaa; text-decoration: none; display: flex; align-items: center; gap: 5px; font-weight: 600; }

.best-filters { display: flex; gap: 10px; margin-bottom: 30px; }
.filter-btn { padding: 6px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.2); background: transparent; color: #aaa; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: 0.3s; }
.filter-btn.active { background: #fff; color: #121212; border-color: #fff; }

.best-cards { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; scroll-snap-type: x mandatory; }
.best-cards::-webkit-scrollbar { display: none; }
.b-card { flex: 0 0 calc(20% - 16px); min-width: 220px; display: flex; flex-direction: column; cursor: pointer; scroll-snap-align: start; }
.b-img-box { position: relative; width: 100%; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; margin-bottom: 15px; background-size: cover; background-position: center; border: 1px solid rgba(255,255,255,0.05); }
.b-rank { position: absolute; top: 0; left: 0; background: #FF1744; color: #fff; font-size: 0.85rem; font-weight: 700; padding: 6px 12px; border-bottom-right-radius: 8px; z-index: 2; }
.b-badge { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; z-index: 2; border: 1px solid rgba(255,255,255,0.1); }

.b-info { display: flex; flex-direction: column; }
.b-info h4 { font-size: 1rem; font-weight: 700; color: #fff; margin: 0 0 8px 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-tutor { font-size: 0.85rem; color: #888; margin: 0 0 12px 0; }
.b-price { display: flex; flex-direction: column; gap: 2px; }
.b-original { font-size: 0.85rem; color: #666; text-decoration: line-through; }
.b-discount-row { display: flex; align-items: baseline; gap: 8px; }
.b-percent { color: #FF758C; font-weight: 800; font-size: 1.2rem; }
.b-final { color: #fff; font-weight: 800; font-size: 1.2rem; }
.b-final span { font-size: 0.85rem; font-weight: 500; margin-left: 2px; color: #aaa; }

@media (max-width: 1024px) { 
    .slider-card { flex: 0 0 calc(50% - 12px); } 
    .b-card { flex: 0 0 calc(33.33% - 14px); }
}
@media (max-width: 768px) {
    .slider-card { flex: 0 0 100%; }
    .header-actions { display: none; }
    .menu-right { display: none; }
    .b-card { flex: 0 0 calc(60% - 10px); }
    .best-class-wrapper { padding: 20px; }
}

/* Simple Image Popup */
.simple-popup-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999;
    display: none;
    opacity: 0; /* for animation */
}

.simple-popup-box {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 300px;
    max-width: 90%;
    background: transparent;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    text-align: left;
    transform: scale(0.9) translateY(20px); /* for animation */
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: none;
    pointer-events: auto;
}

.simple-popup-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 20px;
}

.simple-popup-content {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 40px 20px 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.simple-popup-text {
    color: #fff; font-size: 1.5rem; font-weight: 800;
    margin: 0; letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.simple-popup-cta {
    background: #fff;
    color: #111;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}
.simple-popup-cta:hover { transform: scale(1.05); background: #eee; }

.simple-popup-close {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(0,0,0,0.5); border: none;
    width: 36px; height: 36px; border-radius: 50%;
    color: #fff; font-size: 1.2rem;
    cursor: pointer; transition: 0.3s;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(4px);
}
.simple-popup-close:hover { background: rgba(0,0,0,0.8); transform: rotate(90deg); }
