/* ============================================
   KOODI - HTML COURSE PATH STYLES
   wayforhtml-new.css - BIG Koodi App Style
   ============================================ */

/* ==================== FLYING SQUARES ==================== */
.flying-squares {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.flying-square {
    position: absolute;
    border-radius: 10px;
    opacity: 0;
    animation: floatUp linear infinite;
}

/* Брендові кольори: pink #FF4E99, orange #FF9F00, lime #C6DF2B, blue #009DFF */
.flying-square:nth-child(1) { width: 50px; height: 50px; background: #FF4E99; left: 5%; animation-duration: 22s; animation-delay: 0s; }
.flying-square:nth-child(2) { width: 35px; height: 35px; background: #FF9F00; left: 12%; animation-duration: 18s; animation-delay: -4s; }
.flying-square:nth-child(3) { width: 70px; height: 70px; background: #C6DF2B; left: 22%; animation-duration: 28s; animation-delay: -8s; }
.flying-square:nth-child(4) { width: 25px; height: 25px; background: #009DFF; left: 32%; animation-duration: 20s; animation-delay: -2s; }
.flying-square:nth-child(5) { width: 45px; height: 45px; background: #FF4E99; left: 42%; animation-duration: 25s; animation-delay: -6s; }
.flying-square:nth-child(6) { width: 60px; height: 60px; background: #FF9F00; left: 52%; animation-duration: 23s; animation-delay: -10s; }
.flying-square:nth-child(7) { width: 30px; height: 30px; background: #C6DF2B; left: 62%; animation-duration: 19s; animation-delay: -3s; }
.flying-square:nth-child(8) { width: 55px; height: 55px; background: #009DFF; left: 72%; animation-duration: 26s; animation-delay: -7s; }
.flying-square:nth-child(9) { width: 40px; height: 40px; background: #FF4E99; left: 82%; animation-duration: 21s; animation-delay: -12s; }
.flying-square:nth-child(10) { width: 65px; height: 65px; background: #FF9F00; left: 90%; animation-duration: 24s; animation-delay: -5s; }
.flying-square:nth-child(11) { width: 20px; height: 20px; background: #C6DF2B; left: 8%; animation-duration: 17s; animation-delay: -9s; }
.flying-square:nth-child(12) { width: 75px; height: 75px; background: #009DFF; left: 48%; animation-duration: 30s; animation-delay: -15s; }

@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    5% { opacity: 0.12; }
    95% { opacity: 0.12; }
    100% { transform: translateY(-150px) rotate(360deg); opacity: 0; }
}

/* ==================== CSS VARIABLES ==================== */
:root {
    --html-primary: #E34F26;
    --html-secondary: #F06529;
    --html-dark: #2D2D2D;
    --html-blue: #1572B6;
    --html-purple: #9b59b6;
    --html-green: #27ae60;
    --html-teal: #17a2b8;

    --completed: #C6DF2B;
    --completed-dark: #a8c41f;
    --current: #E34F26;
    --locked: #d1d5db;
    --locked-dark: #9ca3af;

    --text-dark: #1a1a2e;
    --text-muted: #6b7280;
    --text-light: #ffffff;

    --bg-page: #faf9f7;
    --bg-card: #ffffff;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 50px rgba(0, 0, 0, 0.18);

    --radius-sm: 16px;
    --radius-md: 20px;
    --radius-lg: 24px;
    --radius-xl: 30px;

    --transition: 0.3s ease;
    --line-completed: #C6DF2B;
    --line-locked: #d1d5db;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    min-height: 100vh;
    background: var(--bg-page);
}

/* ==================== HERO SECTION ==================== */
.main-hero {
    text-align: center;
    padding: 40px 20px 30px;
    position: relative;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 25px;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--html-primary);
}

.html-logo-hero {
    margin-bottom: 25px;
}

.html-logo-hero img {
    width: 160px;
    height: 160px;
    filter: drop-shadow(0 8px 35px rgba(227, 79, 38, 0.45));
}

.main-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 18px;
}

.main-hero p {
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1.6;
}

/* ==================== PATH SECTION ==================== */
.lesson-path-section-html {
    padding: 30px 0 100px;
}

.path-container-html {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ==================== CHAPTER BLOCK ==================== */
.chapter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    margin: 50px 0 45px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.chapter--1 {
    background: var(--html-primary);
}

.chapter--2 {
    background: var(--html-blue);
}

.chapter--3 {
    background: var(--html-purple);
}

.chapter--4 {
    background: var(--html-teal);
}

.chapter--5 {
    background: var(--html-green);
}

.chapter--6 {
    background: #6366f1;
}

.chapter--7 {
    background: #ec4899;
}

.chapter--bonus {
    background: linear-gradient(135deg, #FFD700, #E34F26);
}

.chapter__left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.chapter__icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.chapter--bonus .chapter__icon {
    background: rgba(0, 0, 0, 0.1);
}

.chapter__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chapter__label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.chapter--bonus .chapter__label {
    color: rgba(0, 0, 0, 0.5);
}

.chapter__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-light);
}

.chapter--bonus .chapter__title {
    color: var(--text-dark);
}

.chapter__count {
    background: rgba(255, 255, 255, 0.25);
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-light);
}

.chapter--bonus .chapter__count {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
    font-size: 1.3rem;
}

/* ==================== LESSONS CONTAINER ==================== */
.lessons {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
}

/* ==================== CONNECTION LINES (SVG) ==================== */
.path-lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.path-line {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.path-line.locked {
    stroke: var(--locked);
}

.path-line.completed {
    stroke: var(--completed);
}

.path-line.current {
    stroke: url(#currentGradient);
}

/* ==================== LESSON NODE ==================== */
.lesson-node-html {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    margin-bottom: 55px;
    transition: transform var(--transition);
}

.lesson-node-html:last-child {
    margin-bottom: 30px;
}

/* Zigzag positioning */
.lesson--left {
    align-self: flex-start;
    margin-left: 0;
}

.lesson--center {
    align-self: center;
}

.lesson--right {
    align-self: flex-end;
    margin-right: 0;
}

.lesson-node-html:hover {
    transform: scale(1.12);
}

.locked-html {
    cursor: default;
}

.locked-html:hover {
    transform: scale(1.05);
}

/* ==================== LESSON SQUARE ==================== */
.lesson__square {
    width: 110px;
    height: 110px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

/* States */
.completed-html .lesson__square {
    background: var(--completed);
}

.current-html .lesson__square {
    background: var(--current);
    animation: pulse 2s infinite;
}

.locked-html .lesson__square {
    background: var(--locked);
}

.bonus-html .lesson__square {
    background: linear-gradient(135deg, #FFD700, #E34F26);
}

.bonus-html.locked-html .lesson__square {
    background: linear-gradient(135deg, #ccc, #aaa);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(227, 79, 38, 0.45);
    }
    50% {
        box-shadow: 0 8px 50px rgba(227, 79, 38, 0.75);
    }
}

/* ==================== CHECKMARK BADGE ==================== */
.lesson__check {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition);
    border: 3px solid var(--completed);
}

.completed-html .lesson__check {
    opacity: 1;
    transform: scale(1);
}

.lesson__check i {
    color: var(--completed-dark);
    font-size: 1.1rem;
    font-weight: bold;
}

/* ==================== LESSON ICON ==================== */
.lesson__icon {
    font-size: 3rem !important;
    color: var(--text-light);
    transition: color var(--transition);
}

.completed-html .lesson__icon {
    color: var(--text-dark);
}

.locked-html .lesson__icon {
    color: var(--locked-dark);
}

/* ==================== LESSON TITLE ==================== */
.lesson__title {
    margin-top: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    max-width: 130px;
    line-height: 1.4;
}

.locked-html .lesson__title {
    color: var(--locked-dark);
}

/* ==================== LESSON CARD - COMPACT TOOLTIP ==================== */
.lesson-card-html {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px 24px;
    width: 260px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e5e5;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    text-align: center;
}

/* Розширена зона наведення */
.lesson-card-html::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -20px;
    right: -20px;
    height: 50px;
}

/* Arrow down */
.lesson-card-html::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--bg-card);
}

.lesson-card-html.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Left lessons - card more to the right */
.lesson--left .lesson-card-html {
    left: 50%;
    transform: translateX(-30%) translateY(10px);
}

.lesson--left .lesson-card-html.show {
    transform: translateX(-30%) translateY(0);
}

.lesson--left .lesson-card-html::after {
    left: 30%;
}

/* Right lessons - card more to the left */
.lesson--right .lesson-card-html {
    left: 50%;
    transform: translateX(-70%) translateY(10px);
}

.lesson--right .lesson-card-html.show {
    transform: translateX(-70%) translateY(0);
}

.lesson--right .lesson-card-html::after {
    left: 70%;
}

/* Card content styles */
.lesson-card-html .card-icon {
    font-size: 2rem;
    color: var(--html-primary);
    margin-bottom: 8px;
    display: block;
}

.lesson-card-html h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.lesson-card-html .card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Compact button */
.lesson-card-html .go-to-lesson-btn {
    background: var(--html-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    font-family: 'Rubik', sans-serif;
}

.lesson-card-html .go-to-lesson-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(227, 79, 38, 0.4);
}

.lesson-card-html .go-to-lesson-btn.locked {
    background: var(--locked);
    color: var(--locked-dark);
    cursor: not-allowed;
}

.lesson-card-html .go-to-lesson-btn.locked:hover {
    transform: none;
    box-shadow: none;
}

.lesson-card-html .go-to-lesson-btn.completed {
    background: var(--completed);
    color: var(--text-dark);
}

.lesson-card-html .go-to-lesson-btn.login-accent {
    background: #C6DF2B;
    color: #1a1a2e;
    cursor: pointer;
    font-weight: 700;
}

.lesson-card-html .go-to-lesson-btn.login-accent:hover {
    transform: scale(1.05);
    background: #d4eb3a;
    box-shadow: 0 4px 15px rgba(198, 223, 43, 0.5);
}

/* Card buttons container */
.lesson-card-html .card-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lesson-card-html .card-buttons .go-to-lesson-btn {
    width: 100%;
    font-size: 0.85rem;
    padding: 12px 16px;
}

.lesson-card-html .go-to-lesson-btn.complete-btn {
    background: var(--completed);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.lesson-card-html .go-to-lesson-btn.complete-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.lesson-card-html .go-to-lesson-btn.complete-btn:active {
    transform: scale(0.98);
}

/* ==================== TROPHY ==================== */
.trophy {
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
}

.trophy__icon {
    width: 100px;
    height: 100px;
    background: var(--accent);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto;
}

.trophy__text {
    margin-top: 25px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

/* ==================== USER GREETING ==================== */
.user-greeting {
    margin-top: 15px;
    padding: 30px 40px;
    background: rgba(227, 79, 38, 0.15);
    border-radius: 16px;
    border: 1px solid rgba(227, 79, 38, 0.3);
    animation: fadeIn 0.5s ease;
    max-width: 900px;
    width: calc(100% - 40px);
    margin-left: auto;
    margin-right: auto;
}

.user-greeting p {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 600;
}

.user-greeting strong {
    font-weight: 700;
    color: var(--text-dark);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .lesson-card-html {
        width: 200px;
        padding: 14px 16px;
    }
}

@media (max-width: 650px) {
    .main-hero {
        padding: 25px 15px 20px;
    }

    .html-logo-hero img {
        width: 90px;
        height: 90px;
    }

    .main-hero h1 {
        font-size: 2.2rem;
    }

    .main-hero p {
        font-size: 1rem;
    }

    .path-container-html {
        padding: 0 15px;
    }

    .chapter {
        padding: 18px 20px;
        margin: 35px 0 30px;
    }

    .chapter__icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .chapter__title {
        font-size: 1.15rem;
    }

    .chapter__count {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

    .lesson__square {
        width: 90px;
        height: 90px;
        border-radius: var(--radius-md);
    }

    .lesson__icon {
        font-size: 2.4rem !important;
    }

    .lesson__title {
        font-size: 0.9rem;
        max-width: 110px;
    }

    .lesson-node-html {
        margin-bottom: 45px;
    }

    /* Mobile - card stays above lesson */
    .lesson-card-html,
    .lesson--left .lesson-card-html,
    .lesson--right .lesson-card-html,
    .lesson--center .lesson-card-html {
        width: 180px;
        padding: 12px 14px;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }

    .lesson-card-html.show {
        transform: translateX(-50%) translateY(0);
    }

    .lesson--left .lesson-card-html,
    .lesson--right .lesson-card-html {
        transform: translateX(-50%) translateY(10px);
    }

    .lesson--left .lesson-card-html.show,
    .lesson--right .lesson-card-html.show {
        transform: translateX(-50%) translateY(0);
    }

    .lesson--left .lesson-card-html::after,
    .lesson--right .lesson-card-html::after {
        left: 50%;
    }

    .lesson-card-html h3 {
        font-size: 0.9rem;
    }

    .lesson-card-html .card-subtitle {
        font-size: 0.75rem;
        margin-bottom: 10px;
    }

    .lesson-card-html .go-to-lesson-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .trophy__icon {
        width: 110px;
        height: 110px;
        font-size: 3rem;
    }

    .trophy__text {
        font-size: 1.1rem;
    }

    .path-line {
        stroke-width: 6;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
