/* Global Reset & Fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Pretendard:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #03dac6;
    --bg-color: #050505;
    --card-bg: #121212;
    --text-main: #e0e0e0;
    --text-muted: #757575;
    --border-color: #333;
    --danger: #cf6679;
    --success: #03dac6;
    --morning-color: #FFD54F;
    --workout-color: #FF7043;
    --night-color: #9575CD;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    letter-spacing: -0.02em;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Core Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: inline-block;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.3;
    color: #fff;
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Navigation Menu */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
}

.nav-brand {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.nav-items {
    display: flex;
    gap: 15px;
}

.nav-item {
    background: transparent;
    border: none;
    color: #aeaeae;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Pretendard', sans-serif;
    font-weight: 600;
    transition: 0.2s;
    padding: 5px 8px;
    border-radius: 6px;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Badge Container Override */

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #bbb;
    font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="time"],
select {
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.3s;
    box-sizing: border-box;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    background: #222;
}

/* Segmented Control (Talk Test) */
.segmented-control {
    display: flex;
    gap: 10px;
    background: #1a1a1a;
    padding: 5px;
    border-radius: 10px;
    border: 1px solid #333;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 0;
    transition: 0.3s;
    color: #666;
}

.segmented-control label:hover {
    background: #252525;
}

.segmented-control input:checked+label {
    background: #333;
    color: var(--primary-color);
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.segmented-control .desc {
    display: block;
    font-size: 0.85em;
    /* Increased from 0.7em */
    margin-top: 4px;
    opacity: 0.9;
    /* Increased visibility */
}

/* File Input Wrapper */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.hidden-file-input {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.custom-file-label {
    display: inline-block;
    padding: 10px 20px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ddd;
    cursor: pointer;
    transition: 0.3s;
}

.custom-file-label:hover {
    background: #333;
    border-color: var(--primary-color);
}

/* Badges Container - New */
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.badge-certified {
    font-size: 0.75rem;
    background: rgba(3, 218, 198, 0.15);
    /* Primary color low opacity */
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(3, 218, 198, 0.3);
}

.badge-overseas {
    font-size: 0.75rem;
    background: rgba(149, 117, 205, 0.15);
    /* Purple low opacity */
    color: var(--night-color);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(149, 117, 205, 0.3);
}

.timing-badge {
    font-size: 0.75rem;
    color: #aaa;
    background: #222;
    padding: 2px 8px;
    border-radius: 10px;
    align-self: flex-start;
    display: inline-block;
}


/* Tag Input */
.tag-input-container {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    box-sizing: border-box;
}

.tag-input-container input {
    border: none;
    background: transparent;
    padding: 5px;
    width: auto;
    flex: 1;
    min-width: 100px;
    outline: none;
    color: #fff;
}

.tag {
    background: #333;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Toggle */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    transition: 0.3s;
    box-sizing: border-box;
}

.toggle-wrapper.active {
    border-color: var(--danger);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    border-radius: 34px;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--danger);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 1000;
    animation: fadeInDown 0.5s;
}

/* Time Sections */
.time-section {
    margin-bottom: 30px;
    border-left: 2px solid #333;
    padding-left: 20px;
}

.time-section-header {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    background: #222;
    color: #fff;
    font-family: 'JetBrains Mono';
}

.time-section.morning {
    border-color: var(--morning-color);
}

.time-section.morning .time-section-header {
    color: var(--morning-color);
    background: rgba(255, 213, 79, 0.1);
}

.time-section.workout {
    border-color: var(--workout-color);
}

.time-section.workout .time-section-header {
    color: var(--workout-color);
    background: rgba(255, 112, 67, 0.1);
}

.time-section.night {
    border-color: var(--night-color);
}

.time-section.night .time-section-header {
    color: var(--night-color);
    background: rgba(149, 117, 205, 0.1);
}

.schedule-item {
    background: #111;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* Score Card */
.score-card-box {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
    box-sizing: border-box;
}

.score-change-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.score-old {
    font-size: 1.2rem;
    color: #666;
    text-decoration: line-through;
}

.score-new {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.score-diff {
    background: var(--success);
    color: #000;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Buttons */
.cta-button {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: #000;
    border: 1px solid transparent;
    /* Match secondary border width */
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'JetBrains Mono';
    margin-top: 0;
    /* Removing extra margin for alignment */
    box-sizing: border-box;
}

.secondary-button {
    width: 100%;
    padding: 16px;
    /* Match CTA */
    background: transparent;
    color: #b0b0b0;
    /* Slightly brighter */
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 1rem;
    /* Match CTA */
    font-weight: 600;
    cursor: pointer;
    font-family: 'JetBrains Mono';
    box-sizing: border-box;
    transition: 0.2s;
}

.secondary-button:hover {
    border-color: #666;
    color: #fff;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-box {
    background: #111;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #222;
    box-sizing: border-box;
}

.stat-val {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    margin: 5px 0;
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
}

/* Graph */
.graph-card {
    background: #161616;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-sizing: border-box;
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.bar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 80px;
    font-size: 0.75rem;
    color: #888;
    text-align: right;
}

.bar-wrapper {
    flex: 1;
    background: #222;
    height: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.bar {
    height: 100%;
    text-align: right;
    padding-right: 5px;
    font-size: 0.7rem;
    color: #fff;
    line-height: 16px;
    font-weight: bold;
    transition: width 1s ease-out;
    width: 0;
}

.red-bar {
    background: var(--danger);
}

.blue-bar {
    background: var(--success);
}

/* Modal */
.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #222;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #444;
    color: #ddd;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
}

.modal-btn {
    background: var(--primary-color);
    color: #000;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box;
}


/* Landing Page Styles V3 (Fixed & Polished) */
.landing-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 30px;
    background: radial-gradient(circle at 50% 30%, #1a1a1a 0%, #050505 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    box-sizing: border-box;
    text-align: center;
}

/* Effects */
.landing-container::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgb3BhY2l0eT0iMC4wNSI+PHBhdGggZD0iTTAgMGg0MHY0MEgwVjB6IiBmaWxsPSIjZmZmIi8+PC9zdmc+');
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

.hero-logo {
    font-size: 1.4rem;
    color: var(--primary-color);
    letter-spacing: 3px;
    margin-bottom: 40px;
    font-weight: 800;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 10px rgba(3, 218, 198, 0.4);
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 20px;
    color: #fff;
    letter-spacing: -0.02em;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.hero-title span {
    background: linear-gradient(90deg, #03dac6, #00bfa5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: block;
    font-size: 3.5rem;
    margin-top: 5px;
    text-shadow: 0 0 30px rgba(3, 218, 198, 0.2);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 30px;
    max-width: 450px;
    line-height: 1.6;
    font-weight: 400;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.6s forwards;
    z-index: 1;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 320px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.9s forwards;
}

/* Explicit Button Styles to Override Generic CTA */
button.google-btn {
    background: #ffffff !important;
    color: #1f1f1f !important;
    font-weight: 700;
    height: 56px;
    border-radius: 12px !important;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

button.google-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
}

button.guest-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ccc !important;
    height: 50px;
    border-radius: 12px !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: 0.3s;
    cursor: pointer;
}

button.guest-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: #fff !important;
    color: #fff !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 380px) {
    .hero-title {
        font-size: 2.4rem;
    }

    .hero-title span {
        font-size: 2.8rem;
    }
}

/* V52: Educational Expandable Box (Thin Layer) */
.edu-box {
    margin-top: 40px;
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Thin outline */
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    backdrop-filter: blur(5px);
    z-index: 20;
    /* Ensure on top */
    cursor: default;
    /* Box itself not clickable, header is */
    box-sizing: border-box;
}

/* Collapsed State */
.edu-box.collapsed {
    max-height: 50px;
    /* Only Header Visible */
    background: rgba(255, 255, 255, 0.01);
}

/* Expanded State */
.edu-box:not(.collapsed) {
    max-height: 600px;
    /* Reveal Content */
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(3, 218, 198, 0.3);
}

.edu-header {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #aaa;
    /* Dimmed Text */
    font-weight: 300;
}

.edu-header:hover {
    color: #eee;
    background: rgba(255, 255, 255, 0.02);
}

.edu-arrow {
    font-size: 0.7rem;
    color: #666;
    transition: transform 0.3s;
}

.edu-box:not(.collapsed) .edu-arrow {
    transform: rotate(180deg);
    color: #03dac6;
}

.edu-content-inner {
    padding: 0 25px 25px 25px;
    opacity: 1;
    transition: opacity 0.4s ease 0.1s;
}

.edu-box.collapsed .edu-content-inner {
    opacity: 0;
    pointer-events: none;
}

/* V52: Refined Footer (Smaller, Blurry, Dim) */
.landing-footer {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    /* Smaller */
    color: rgba(255, 255, 255, 0.3);
    /* Transparent/Dim */
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through if overlapping */
}

.landing-footer * {
    pointer-events: auto;
    /* Re-enable clicks for links */
}

.footer-info {
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.2);
}

.footer-credit {
    font-weight: 300;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 2px;
}

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

.footer-links span {
    cursor: pointer;
    transition: color 0.2s;
    color: rgba(255, 255, 255, 0.4);
}

.footer-links span:hover {
    color: #888;
    text-decoration: underline;
}

.divider {
    color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}