/* main.css */

/* ── 배경 애니메이션 ── */
.bg-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(to bottom, #ffffff, #b6b5fc);
    z-index: -1;
}
.bg-box div {
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: transparent;
    border: 6px solid rgba(88, 133, 255, 0.8);
}
.bg-box div:nth-child(1)  { top:5%;  left:2%;  width:50px; height:50px; animation: bgFloat 10s linear infinite; }
.bg-box div:nth-child(2)  { top:70%; left:50%; width:70px; height:70px; animation: bgFloat 7s linear infinite; }
.bg-box div:nth-child(3)  { top:17%; left:15%; width:40px; height:40px; animation: bgFloat 9s linear infinite; }
.bg-box div:nth-child(4)  { top:20%; left:60%; width:55px; height:55px; animation: bgFloat 11s linear infinite; }
.bg-box div:nth-child(5)  { top:45%; left:3%;  width:65px; height:65px; animation: bgFloat 6s linear infinite; }
.bg-box div:nth-child(6)  { top:80%; left:70%; width:45px; height:45px; animation: bgFloat 12s linear infinite; }
.bg-box div:nth-child(7)  { top:60%; left:85%; width:75px; height:75px; animation: bgFloat 15s linear infinite; }
.bg-box div:nth-child(8)  { top:32%; left:35%; width:50px; height:50px; animation: bgFloat 16s linear infinite; }
.bg-box div:nth-child(9)  { top:85%; left:8%;  width:60px; height:60px; animation: bgFloat 9s linear infinite; }
.bg-box div:nth-child(10) { top:5%;  left:90%; width:35px; height:35px; animation: bgFloat 5s linear infinite; }
.bg-box div:nth-child(11) { top:40%; left:22%; width:55px; height:55px; animation: bgFloat 13s linear infinite; }
.bg-box div:nth-child(12) { top:15%; left:75%; width:45px; height:45px; animation: bgFloat 8s linear infinite; }
.bg-box div:nth-child(13) { top:55%; left:40%; width:70px; height:70px; animation: bgFloat 14s linear infinite; }
.bg-box div:nth-child(14) { top:90%; left:55%; width:40px; height:40px; animation: bgFloat 7s linear infinite; }
.bg-box div:nth-child(15) { top:10%; left:45%; width:50px; height:50px; animation: bgFloat 11s linear infinite; }
.bg-box div:nth-child(16) { top:75%; left:18%; width:65px; height:65px; animation: bgFloat 10s linear infinite; }
.bg-box div:nth-child(17) { top:50%; left:65%; width:35px; height:35px; animation: bgFloat 8s linear infinite; }
.bg-box div:nth-child(18) { top:30%; left:92%; width:55px; height:55px; animation: bgFloat 12s linear infinite; }
.bg-box div:nth-child(19) { top:65%; left:30%; width:45px; height:45px; animation: bgFloat 9s linear infinite; }
.bg-box div:nth-child(20) { top:8%;  left:55%; width:60px; height:60px; animation: bgFloat 6s linear infinite; }

@keyframes bgFloat {
    0%   { transform: scale(0) translateY(-90px) rotate(360deg); opacity:1; }
    100% { transform: scale(1.3) translateY(-90px) rotate(-180deg); border-radius:50%; opacity:0; }
}

.main-wrap {
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
    padding: 100px 0px 25px;  
}

/* 메인 */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    margin-bottom: 30px;
}
.hero-logo-row {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 5px;
}
.hero-logo2-img {
    height: 60px;
    width: auto;
    margin-bottom: 10px;
    margin-top: 10px;
}
.hero-shield {
    width: 56px; height: 56px;
    background: linear-gradient(135deg,var(--accent),#c62828);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; box-shadow: 0 4px 12px rgba(229,57,53,.3);
}
.hero-shield span {
    color: #fff; font-size: .72rem; font-weight: 900; letter-spacing: .5px;
}
.hero-logo-text { display: flex; flex-direction: column; gap: 2px; }
.hero-logo-text small { font-size: .62rem; color: #888; letter-spacing: 1.5px; text-transform: uppercase; }
.hero-logo-text strong { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.hero-logo-text span   { font-size: .7rem;  color: #aaa; }

/* 모바일 바로가기 — PC에서 숨김 */
.hero-mobile-btns { display: none; }

.hero-headline {
    font-size: 2.4rem; font-weight: 800; line-height: 1;
    color: var(--text); margin-bottom: 10px;
}
.hero-sub  { font-size: 1.1rem; color: var(--primary); font-weight: 700; margin-bottom: 16px; }

/* ── 어워드 텍스트 / 로고 ── */
.hero-award {
    display: flex;
    align-items: center;
    gap: 14px; 
    margin-top: 15px;
    background: transparent !important; 
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
.award-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #999;
    letter-spacing: -0.5px;
}
.award-logo {
    height: 30px !important;
    width: auto !important;
    display: block;
}

/* ── 우측 슬라이드 영역 부모 ── */
.hero-right {
    position: relative; 
    padding-top: 24px;  
}

/* ── 슬라이더 본체 ── */
.slider-wrap {
    position: relative;
    background: #eef0ff;
    border-radius: 20px;
    overflow: hidden;
    max-width: 650px;
    min-height: 240px;
    box-shadow: var(--shadow);
    margin-left: auto;
}
.slide {
    display: none; /* 기본적으로 모든 이미지를 숨김 */
    width: 100%;
    height: 100%;
    animation: fadeEffect 0.5s; /* 부드러운 전환 효과 */
}
.slide.active {
    display: block; /* 현재 순서(active)인 이미지 딱 1장만 보여줌 */
}
.slide.slide-default.active {
    display: flex; 
}
@keyframes fadeEffect {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.slide img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    min-height: 240px; 
    display: block; 
}

.slide-default {
    display: flex; 
    align-items: center;
    padding: 40px 24px; 
}
.slide-default h3 { font-size: 1.2rem; font-weight: 700; color: #2d2d5e; margin-bottom: 10px; line-height: 1.4; }
.slide-default em { color: #7c3aed; font-style: normal; }
.slide-default p  { font-size: .85rem; color: #555; margin-bottom: 18px; }
.slide-link { font-size: .8rem; color: #7c3aed; font-weight: 600; text-decoration: none; }

/* ── 슬라이드 점 (밖으로 빠짐) ── */
.slider-dots {
    position: absolute; 
    top: 0px;      
    right: 0px;    
    z-index: 5;
    display: flex; 
    gap: 8px;      
}

.dot {
    width: 6px; 
    height: 6px; 
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15); 
    border: none; 
    cursor: pointer; 
    padding: 0;
    transition: background 0.3s, transform 0.2s;
}
.dot.active { 
    background: rgb(145, 145, 145); 
    transform: scale(1.2); 
}

/* 3월28일 FX관련 작업 - 삭제 */

/* ── 강의실 그리드 (숨쉬는 효과) ── */
.rooms-section {
    border: 2px solid #85d8ff;
    border-radius: 20px;
    padding: 6px;
    /* 초기 그림자 설정 */
    box-shadow: 0 0 15px rgba(133, 216, 255, 0.2);
    
    /* 애니메이션 적용: 3초 동안 부드럽게 반복 */
    animation: border-glow 10s ease-in-out infinite;
}

@keyframes border-glow {
    0%, 100% {
        border-color: #85d8ff;
        box-shadow: 0 0 10px rgba(133, 216, 255, 0.2),
                    0 0 20px rgba(86, 229, 248, 0.1);
    }
    50% {
        /* 가장 밝아지는 시점 */
        border-color: #ffffff; 
        box-shadow: 0 0 25px rgba(133, 216, 255, 0.6),
                    0 0 50px rgba(86, 229, 248, 0.3);
    }
}

/* 3월28일 FX관련 작업 - 삭제 */

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}
.room-card {
    position: relative;
    border-radius: 16px;
    min-height: 200px;
    display: block; /* 절대 배치를 위해 기존 flex 해제 */
    cursor: pointer;
    overflow: hidden;
    transition: transform .5s ease-in-out, opacity .3s ease-in-out, top .5s ease-in-out, left .5s ease-in-out;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);

}
.room-card::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(136, 136, 136, 0.322);
    opacity: 0; transition: opacity .2s;
    z-index: 1;
}
.room-card:hover { transform: translateY(-8px); box-shadow: 0px 12px 24px rgba(255, 42, 42, 0.15); }
.room-card:hover::after { opacity: 1; }
.room-card.card-animate {
    position: fixed !important;
    z-index: 9999;
    transform: scale(1.5);
    opacity: 0;
}
/* LIVE 뱃지 */
.badge-live {
    position: absolute; 
    top: 10px; 
    left: 14px;  
    background: #ff1744; color: #fff;
    font-size: .65rem; font-weight: 500; padding: 4px 10px; border-radius: 6px;
    animation: live-blink 1.4s ease-in-out infinite;
    z-index: 3;
}
@keyframes live-blink { 0%,100%{opacity:1} 50%{opacity:.6} }

/* 강의명 */
.room-lecture {
    position: absolute;
    top: 40px;
    left: 16px;
    right: 16px;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    z-index: 2;
    word-break: keep-all;
    line-height: 1.3;
}

/* 아이콘 */
.room-icon {
    position:absolute;
    bottom:4px;
    left:12px;
}

.room-icon img {
    width:100px;
    height:100px;
    object-fit:contain;
}

/* O강의실 라벨 */
.room-label {
    position: absolute;
    bottom: 14px;
    right: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    z-index: 2;
}

/* ══════════════════════════════════════
   반응형  (참고: aiclass.m-teacher 스타일)
   ══════════════════════════════════════ */

/* ── 500~1500px 여백 (≤520px과 동일) ── */
@media(max-width:1500px) and (min-width:521px){
    .main-wrap {
        padding: 80px 16px 5px;
    }
}

@media(max-width:1100px) {
    .rooms-grid { grid-template-columns:repeat(4,1fr); }
}

/* ── 태블릿 ── */
@media(max-width:860px) {
    .hero-section  { grid-template-columns:1fr; gap:24px; }
    .rooms-grid    { grid-template-columns:repeat(3,1fr); gap:10px; }
    .hero-headline { font-size:1.5rem; }
}

/* ── 모바일 공통 ── */
@media(max-width:600px) {
    .hero-award { flex-wrap:wrap; gap:8px; }

    /* 슬라이더 — 카드 스타일로 컴팩트하게 */
    .hero-right   { padding-top:12px; }
    .slider-wrap  { min-height:140px; border-radius:16px; }
    .slide img    { min-height:140px; }
    .slider-dots  { top:-4px; gap:6px; }
    .dot          { width:8px; height:8px; }  /* 터치 영역 개선 */
}

/* ── 모바일 (≤520px) — 핵심 리팩토링 ── */
@media(max-width:520px)
 {

    /* 전체 래퍼 — 헤더-본문 여백 + 좌우 여백 */
    .main-wrap {
        padding: 80px 16px 5px;
    }

    /* 히어로 — 로고/텍스트/어워드 숨김, 버튼만 표시 */
    .hero-section  { gap:1px; margin-bottom:20px; }
    .hero-left     { order: -1; display: block; }
    .hero-right    { order: 1; }
    .hero-logo-row,
    .hero-logo2-img,
    .hero-headline,
    .hero-sub,
    .hero-award { display: none !important; }

    /* 모바일 바로가기 버튼 */
    .hero-mobile-btns {
        display: flex !important;
        gap: 10px;
    }
    .hero-mobile-btns a {
        padding: 7px 18px;
        border-radius: 10px;
        border: none;
        background: #eef0ff;
        color: var(--primary);
        font-size: .85rem;
        font-weight: 600;
        text-decoration: none;
        transition: all .2s;
    }
    .hero-mobile-btns a:hover {
        background: #dde1ff;
    }

    /* ── 강의실 그리드 — 레퍼런스 스타일 ── */
    .rooms-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;                /* 카드 간 여유 간격 */
    }

    /* 카드 기본 */
    .room-card {
        min-height: 155px;
        border-radius: 20px;      /* 부드러운 큰 라운드 */
        border: none;              /* 테두리 제거 → 깔끔 */
    }

    /* 강의명 — 좌상단 */
    .room-lecture {
        font-size: .82rem;
        font-weight: 700;
        top: 16px;
        left: 16px;
        right: 16px;
        line-height: 1.35;
    }

    /* LIVE 뱃지 위치 미세 조정 */
    .badge-live {
        top: 16px;
        left: auto;
        right: 14px;              /* 우상단으로 이동 */
        font-size: 0.6rem;
        padding: 3px 8px;
        border-radius: 8px;
    }
    /* LIVE가 있으면 강의명에 오른쪽 여유 확보 */
    .room-card .badge-live ~ .room-lecture {
        right: 60px;
    }

    /* 아이콘 — 우하단 (레퍼런스 스타일) */
    .room-icon {
        left: auto;
        right: 10px;
        bottom: 8px;
    }
    .room-icon img {
        width: 64px;
        height: 64px;
    }

    /* 강의실 번호 라벨 — 좌하단 */
    .room-label {
        right: auto;
        left: 16px;
        bottom: 14px;
        font-size: .92rem;
        font-weight: 700;
        opacity: .85;
    }
}

/* ── 초소형 기기 (≤360px) ── */
@media(max-width:360px) {
    .rooms-grid    { grid-template-columns:1fr; }
    .room-card     { min-height:130px; }
    .room-icon img { width:72px; height:72px; }
}

/* ── 4K (1921px 이상) ── */
@media(min-width:1921px){
    .main-wrap { max-width: 1850px; }  /* 1500px → 원하는 값 */
    .room-card { min-height: 250px; }
    .room-lecture {
        top: 40px;
        font-size: 1.2rem;
        font-weight: 600;
        line-height: 1.3;
    }
    .badge-live {
        top: 10px;
        left: 14px;
        font-size: .9rem;
        font-weight: 500;
        padding: 4px 10px;
        border-radius: 6px;
    }
    
    .hero-logo2-img { height: 70px; }
    .hero-headline { font-size: 3rem; }
    .award-text { font-size: 1.6rem; }
    .slider-wrap { max-width: 700px; }
}