@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.css');

:root {
    --mint-act: #E6FAF5;
    --mint-point: #00D1A0;
    --bg-main: #FFFFFF;
    --bg-sub: #F9FAFB;
    --bg-card: #FFFFFF;
    --card-grey: #F2F4F6;
    --text-main: #1A1F27;
    --text-sub: #8B95A1;
    --border-main: #F2F4F6;
}

[data-theme="dark"] {
    --bg-main: #0F0F0F;
    --bg-sub: #1A1F27;
    --bg-card: #1A1F27;
    --card-grey: #2A2A2A;
    --text-main: #F9FAFB;
    --text-sub: #8B95A1;
    --border-main: #2A2A2A;
    --mint-act: #1A2724;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.05em;
}

body {
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background: var(--bg-main);
    color: var(--text-main);
}

/* Slim Header */
.top-nav {
    height: 60px;
    border-bottom: none;
    position: sticky;
    top: 0;
    background: var(--bg-main);
    z-index: 1000;
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--border-main);
}

.top-nav.header-hidden {
    transform: translateY(-100%);
}

.nav-wrapper {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pc-only {
    display: block;
}

.logo-area {
    font-weight: 900;
    font-size: 20px;
    color: var(--mint-point);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
    position: relative;
}

.search-container input {
    width: 100%;
    height: 42px;
    background: var(--bg-sub);
    border: none;
    border-radius: 10px;
    padding: 0 16px 0 40px; /* Adjusted for smaller icon */
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: 0.2s;
}

.search-container input:focus {
    background: var(--card-grey);
}

.search-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-action-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    width: 28px; /* Fixed width to prevent overlap */
    height: 28px;
}

.search-action-btn:hover {
    color: var(--text-main);
}

.mobile-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    z-index: 1001;
    display: none;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.mobile-search-overlay.active {
    display: flex;
}

.back-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
}

.search-container.mobile {
    flex: 1;
    margin: 0;
}

.search-container.mobile input {
    height: 40px;
    padding: 0 40px 0 12px;
}

.search-container i, .search-container svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub);
    opacity: 0.3;
    font-size: 13px;
    pointer-events: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-search-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 4px;
}

.login-btn {
    padding: 6px 14px;
    background: var(--bg-main);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    cursor: pointer;
    border: 1.5px solid var(--border-main);
}

/* User Profile Image */
.user-profile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--card-grey);
    display: none; /* Hidden by default, shown via JS */
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid var(--card-grey);
}

.user-profile i {
    font-size: 16px;
    color: var(--text-sub);
}

.portal-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    padding-top: 60px; 
    padding-bottom: 100px;
}



/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%; /* Use full width of parent */
}

.content-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 8px;
}

.tab-btn {
    font-size: 32px;
    font-weight: 900;
    font-family: "Pretendard Variable", sans-serif;
    color: #E5E8EB;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: 0.2s;
}

.tab-btn.active {
    color: var(--text-main);
}

.tab-btn:hover {
    color: var(--text-sub);
}

.section-container {
    position: relative;
    margin-top: -8px; /* 탭과의 거리 좁힘 */
}

.explore-banner-section {
    width: 100%;
    margin-bottom: 32px;
}

.explore-banner-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.explore-banner-scroll {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 0 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    overscroll-behavior-x: auto;
    scroll-snap-type: x proximity; /* Snapping for app-like feel */
}

.explore-banner-scroll::-webkit-scrollbar {
    display: none;
}

.explore-banner-item {
    flex: 0 0 auto;
    width: 550px; /* Reduced from 800px to a more moderate 'enlarged' size */
    aspect-ratio: 5 / 2;
    border-radius: 16px;
    overflow: hidden;
    background: var(--card-grey);
    cursor: pointer;
    scroll-snap-align: start;
}

.explore-banner-item picture,
.explore-banner-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Mobile Adjustments */
@media (max-width: 850px) {
    .explore-banner-item {
        width: 150px; /* Greatly reduced for a compact look */
        aspect-ratio: 1 / 1.414;
    }
}

/* Section Header */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-head .head-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-head .head-text h2 {
    font-size: 21px;
    font-weight: 900;
    color: var(--text-main);
}

.more-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-sub);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.more-link:hover {
    color: var(--mint-point);
}

/* Video Scroll */
.lesson-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.lesson-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 20px;
    scrollbar-width: none;
    mask-image: none;
    -webkit-mask-image: none;
    scroll-behavior: smooth;
    overscroll-behavior-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; 
}

.scroll-btn {
    position: absolute;
    width: 36px;
    height: 36px;
    background: #fff; /* Solid white as requested */
    border: 1px solid var(--card-grey);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    color: var(--text-main);
}

.scroll-btn.prev {
    left: -18px;
}

.scroll-btn.next {
    right: -18px;
}

@media (max-width: 850px) {
    .scroll-btn {
        display: none !important; /* Remove buttons on mobile as requested */
    }
}

.lesson-scroll::-webkit-scrollbar {
    display: none;
}

.lesson-item {
    cursor: pointer;
    min-width: 260px;
    max-width: 260px;
    flex-shrink: 0;
    transition: opacity 0.2s;
    scroll-snap-align: start;
}

.lesson-item:hover {
    opacity: 0.8; /* Replaced translateY animation */
}

.thumb-box {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--card-grey);
    border-radius: 10px; /* Smaller radius, higher density */
    overflow: hidden;
    margin-bottom: 12px;
}

.thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 6px;
}

.lesson-info .title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.lesson-info .title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.edit-title-btn {
    background: none;
    border: none;
    color: #BDC5CD;
    cursor: pointer;
    font-size: 13px;
    padding: 2px;
    transition: 0.2s;
    opacity: 0;
}

.lesson-item:hover .edit-title-btn {
    opacity: 1;
}

.edit-title-btn:hover {
    color: var(--text-main);
}

.lesson-info .meta {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 600;
}

/* Tag Cloud */
.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-pill {
    font-size: 14px;
    background: var(--card-grey);
    padding: 8px 18px;
    border-radius: 20px;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.tag-pill:hover {
    background: var(--mint-act);
    color: var(--mint-point);
}

/* Welcome Section */
.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px; /* Reduced from 40px */
    margin-top: 10px;
}

.greeting-title {
    font-size: 26px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.greeting-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-sub);
}

.mini-stats-group {
    display: flex;
    gap: 8px;
}

.mini-stat-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    padding: 10px 16px;
    border-radius: 8px; /* Reduced from 12px */
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.mini-stat-badge .value,
.mini-stat-badge .unit {
    color: var(--mint-point);
    font-weight: 700;
}

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.mobile-only { display: none !important; }

@media (max-width: 850px) {
    .mobile-only { display: block !important; }
    .dashboard-tabs.mobile-only { display: flex !important; } /* Fix: Force flex display */
}

.dash-slider-outer {
    width: 100%;
    overflow: hidden;
}

.dashboard-tabs {
    display: flex;
    position: relative;
    background: var(--bg-sub);
    border-radius: 12px;
    margin-bottom: 32px;
    padding: 4px;
    width: 100%;
}

.dash-tab {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 800;
    color: #8B95A1;
    cursor: pointer;
    position: relative; /* Added: Essential for z-index to work */
    z-index: 2;
    transition: color 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.dash-tab.active {
    color: var(--text-main);
}

.dash-tab-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: var(--bg-card);
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Use transform for movement */
    z-index: 1;
    pointer-events: none;
}

@media (max-width: 850px) {
    body {
        overflow-y: auto !important;
        position: relative;
    }
    .portal-container {
        padding-top: 70px;
        padding-bottom: 120px;
    }
    .dashboard-grid {
        flex-direction: row !important;
        gap: 0 !important;
        width: 200% !important;
    }
    .dashboard-item {
        width: 50% !important;
        flex: 0 0 50% !important; /* Force equal width and prevent flex growth/shrink */
        padding: 0 !important; /* Remove all padding */
    }
    .main-content {
        overflow-x: visible !important; /* Allow scroll buttons to be visible outside content area */
    }
    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }
    .mini-stats-group {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .mini-stat-badge {
        flex-shrink: 0;
    }
    .dashboard-card {
        padding: 20px;
    }
    .lesson-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .continue-btn {
        width: 100%;
    }
}


.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 16px;
    padding: 24px;
}

.dashboard-item {
    background: transparent;
    border: none;
    padding: 0;
}

.dashboard-item.current-lesson {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-item.calendar {
    flex: 1;
}

.card-head h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
}

/* Current Lesson Card */
.lesson-content-main {
    display: flex;
    gap: 32px;
    align-items: stretch;
    width: 100%;
}

.lesson-thumb-wrap {
    width: 500px;
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    background: #eee;
    flex-shrink: 0;
    border: 1px solid #E5E8EB;
}

.lesson-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lesson-info-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
}

.lesson-info-main h4 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

@media (max-width: 850px) {
    .lesson-content-main {
        flex-direction: column;
        gap: 16px;
    }
    .lesson-thumb-wrap {
        width: 100%;
    }
    .lesson-info-main h4 {
        font-size: 20px;
    }
    .lesson-info-main .continue-btn {
        display: none; /* Hide on mobile dashboard */
    }
}

/* Legacy support */
.lesson-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-placeholder {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lesson-placeholder i {
    font-size: 40px;
    color: var(--mint-point);
}

.lesson-placeholder h4 {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
}

.lesson-placeholder p {
    font-size: 13px;
    color: var(--text-sub);
}

.continue-btn {
    padding: 12px 24px;
    background: var(--mint-point);
    color: #fff;
    border: none;
    border-radius: 8px; /* Reduced from 12px */
    font-weight: 700;
    cursor: pointer;
}

/* Calendar Card */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    font-size: 11px;
    color: #BDC5CD;
    font-weight: 700;
    text-align: center;
    padding-bottom: 8px;
}

.cal-date {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #4E5968;
    border-radius: 4px;
}

.cal-date.muted {
    color: #E5E8EB;
}

.cal-date.active {
    background: var(--mint-point);
    color: #fff;
}

.cal-date.today {
    color: var(--mint-point);
    font-weight: 800;
    text-decoration: underline;
}

.dot.active {
    background: var(--mint-point);
}



.progress-bar-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: var(--mint-point);
    border-radius: 0 2px 2px 0;
}

.mini-word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.mini-word-card {
    background: #fff;
    border: 1.5px solid var(--card-grey);
    padding: 16px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-word-card .word {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.mini-word-card .mean {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
}

/* Bottom Tab Bar (Mobile) */
.bottom-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #fff;
    border-top: 1px solid var(--card-grey);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-sub);
    transition: 0.2s;
}

.tab-item i {
    font-size: 20px;
}

.tab-item span {
    font-size: 10px;
    font-weight: 800;
}

.tab-item.active {
    color: var(--mint-point);
}

/* Mobile */
@media (max-width: 850px) {
    .portal-container { padding: 10px 20px 80px 20px; } /* 상단 패딩 축소 */
    .nav-wrapper { padding: 0 20px; }
    .top-nav { height: 56px; }
    .pc-only { display: none; }
    .mobile-search-btn { display: flex; }
    .bottom-tab-bar { display: flex; }
    .lesson-item { min-width: 200px; max-width: 200px; }
    .section-head .head-text h2 { font-size: 18px; }
    .lesson-scroll { mask-image: none; }
    .stat-grid { grid-template-columns: 1fr; gap: 12px; }
}/* Footer */
.footer {
    padding: 60px 20px 140px;
    background: #fcfcfc;
    border-top: 1px solid #F2F4F6;
    text-align: center;
}

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

.footer-links a {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.footer-copyright {
    color: #BDC5CD;
    font-size: 12px;
}

/* Quick Links Section */
.quick-links-section {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 30px;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
}

.quick-link-item .icon-box {
    width: 60px;
    height: 60px;
    background: #fff;
    border: 1px solid #E5E8EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quick-link-item .icon-box i {
    font-size: 24px;
    color: var(--text-main);
}

.quick-link-item span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.quick-link-item:hover .icon-box {
    background: #fdfdfd;
}

@media (max-width: 850px) {
    .quick-links-section {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 15px;
        padding: 10px 0;
        scrollbar-width: none;
    }
    .quick-links-section::-webkit-scrollbar { display: none; }
    
    .quick-link-item {
        min-width: 70px;
        flex: none;
    }
    .quick-link-item .icon-box {
        width: 52px;
        height: 52px;
    }
}
