/* ========================================
   공통 레이아웃 스타일
   - 왼쪽 메뉴와 상단 메뉴 모두에서 사용되는 공통 스타일
   ======================================== */

/* CSS 변수 (기본값) - PHP에서 동적으로 오버라이드 가능 */
:root {
    /* 레이아웃 크기 */
    --sidebar-width: 320px;
    --submenu-width: 320px;
    --header-height: 80px;
    --menubar-height: 60px;
    --logo-max-width: 277px;

    /* 색상 */
    --primary-color: #4c7ceb;
    --accent-color: #ff8561;
    --dark-bg: #131416;
    --submenu-bg: #333333;
    --footer-bg: #131416;
    --topnav-bg: #ffffff;
    --menubar-bg: #1154ed;
    --light-gray: #f6f7f8;

    /* 트랜지션 */
    --transition-speed: 0.3s;
}

/* ========================================
   기본 초기화
======================================== */
html {
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;        /* IE, Edge */
}

html::-webkit-scrollbar {
    display: none;                   /* Chrome, Safari, Opera */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    overflow-x: hidden;
    background: #fff;
}

/* ========================================
   공통 메인 콘텐츠 영역
======================================== */
.main-content {
    min-height: 100vh;
    transition: margin-left var(--transition-speed) ease;
}

/* ========================================
   공통 메인 슬라이드
======================================== */
.main-slider {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.main-slider .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* carousel 컨트롤: Bootstrap 기본(top:0;bottom:0;flex center) 유지, 위치만 조정 */
#mainCarousel.carousel .carousel-control-prev,
#mainCarousel.carousel .carousel-control-next {
    width: 80px;
    opacity: 1;
    z-index: 10;
}

#mainCarousel.carousel .carousel-control-prev {
    left: 30px;
}

#mainCarousel.carousel .carousel-control-next {
    right: 30px;
}

#mainCarousel.carousel .carousel-control-prev-icon,
#mainCarousel.carousel .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.3);
    width: 45px;
    height: 45px;
    border-radius: 5px;
    transition: background-color var(--transition-speed) ease;
    background-size: 50% 50%;
}

#mainCarousel.carousel .carousel-control-prev:hover .carousel-control-prev-icon,
#mainCarousel.carousel .carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
}

.main-slider .carousel-caption {
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    max-width: 800px;
}

.main-slider .carousel-caption h3 {
    font-size: 24px;
    font-weight: 400;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.main-slider .carousel-caption p {
    font-size: 36px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    letter-spacing: -1px;
}

/* ========================================
   공통 우측 패널
======================================== */
.right-panel {
    background: #f5f5f5;
    padding: 30px;
}

/* 문화 프로그램 상단 버튼 */
.top-logo-btn .btn {
    background: var(--menubar-bg);
    color: white;
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-logo-btn .btn i {
    font-size: 18px;
}

/* 아이콘 메뉴 그리드 */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

.icon-item {
    background: #ffffff;
    border: 1px solid #d0e4f7;
    border-radius: 8px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-decoration: none;
    color: #333;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.icon-item:hover {
    background: #bdd3ff;
    border-color: #bdd3ff;
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.icon-item i {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.icon-item span {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--menubar-bg);
    line-height: 1.5;
    margin-top: 15px;
}

.icon-item img {
    width: 40px;
    height: 40px;
}

/* 박스 섹션 */
.info-boxes-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.info-box {
    border-radius: 0;
    padding: 10px 20px 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.info-box.orange {
    background-image: url('../img/main/sugang-icon.png');
    background-color: linear-gradient(135deg, #ff8561 0%, #ff6b6b 100%);
    color: white;
}

.info-box.blue {
    background-image: url('../img/main/dangi-icon.png');
    background-color: linear-gradient(135deg, #7ea8ff 0%, #6b8fe6 100%);
    color: white;
}

.info-box h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.info-box p {
    font-size: 14px;
    margin: 0 0 60px 0;
    line-height: 1.7;
    text-align: center;
    position: relative;
    z-index: 1;
}

@media (min-width: 992px) {
    .info-box.orange p,
    .info-box.blue p {
        text-align: left;
    }
}

.info-box .btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: white;
    border: none;
    border-radius: 0;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-speed);
    position: relative;
    z-index: 1;
}

.info-box.orange .btn {
    color: #ff6b6b;
}

.info-box.orange .btn:hover {
    background: #e65522;
    color: white;
}

.info-box.blue .btn {
    color: #6b8fe6;
}

.info-box.blue .btn:hover {
    background: var(--menubar-bg);
    color: white;
}

.info-box .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 우측 패널 하단 안내 */
.right-panel-notice {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-top: 10px;
    padding: 5px;
}

/* ========================================
   공지사항 & 강좌안내 섹션
======================================== */
.notice-course-section {
    padding: 60px 0;
    background: #ffffff;
}

.section-wrapper {
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* 공지사항 (왼쪽) */
.notice-section {
    background: #ffffff;
}

.notice-section .section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
    text-align: left;
}

.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 992px) {
    .notice-list {
        padding: 0 20px 20px;
        border: 1px solid #eaeaea;
    }
}

.notice-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    border-bottom: none;
    transition: background var(--transition-speed);
}

.notice-item:hover {
    background: #f8f9fa;
}

.notice-date {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    min-width: 90px;
}

.notice-title {
    flex: 1;
    font-size: 16px;
    color: #333;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-title:hover {
    color: inherit;
    text-decoration: none;
}

.notice-item i {
    color: #eaeaea;
    font-size: 18px;
}

/* 강좌안내 (오른쪽) */
.course-section {
    border-radius: 0;
}

.course-section .section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
    text-align: left;
}

.course-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #bdd3ff;
    padding: 15px;
}

.course-item {
    background: #ffffff;
    padding: 0;
    border-radius: 0;
    display: grid;
    grid-template-columns: 180px 1fr 80px;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    transition: all var(--transition-speed);
    margin-bottom: 10px;
}

.course-item:hover {
    background: #f8f9fa;
}

.course-icon {
    background: #eaf1ff;
    color: #333;
    padding: 35px 20px;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-icon span {
    color: var(--menubar-bg);
    font-size: 20px;
    font-weight: 500;
}

.course-info {
    padding: 0 30px;
    font-size: 16px;
    color: #333;
}

.course-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.course-link i {
    color: var(--menubar-bg);
    font-size: 40px;
    transition: transform var(--transition-speed);
}

.course-link:hover i {
    transform: scale(1.1);
}

/* ========================================
   갤러리 섹션
======================================== */
.gallery-section {
    padding: 60px 0;
    background: #ffffff;
    width: 100%;
}

.gallery-container {
    width: 100%;
    padding: 0 20px;
}

.gallery-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 0;
    color: #333;
    text-align: left;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

.gallery-item {
    overflow: hidden;
    border-radius: 0;
    transition: transform var(--transition-speed);
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* ========================================
   섹션 타이틀
======================================== */
.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

/* 더보기 버튼 스타일 */
.btn-outline-primary {
    border-color: #eaeaea !important;
    color: #918d8d !important;
    border-radius: 0 !important;
}

.btn-outline-primary:hover {
    background-color: #918d8d !important;
    border-color: #918d8d !important;
    color: white !important;
}

/* ========================================
   공통 푸터 스타일
======================================== */
.site-footer {
    background: var(--footer-bg);
    color: rgba(255,255,255,0.7);
    padding: 40px 0;
}

.site-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.site-footer a:hover {
    color: #fff;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    margin: 0 10px;
}

.layout-sidebar .footer-contact {
    font-size: 13px;
    line-height: 1.8;
}

.layout-sidebar .footer-copyright {
    margin-top: 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* ========================================
   공통 반응형 - 섹션
======================================== */
@media (max-width: 992px) {
    .section-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .course-section {
        padding: 30px 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .notice-course-section {
        padding: 40px 0;
    }

    .section-wrapper {
        padding: 0 15px;
    }

    .notice-section .section-title,
    .course-section .section-title {
        font-size: 20px;
    }

    .notice-list {
        padding: 0;
        border: none;
    }

    .notice-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px 0;
    }

    .notice-date {
        min-width: auto;
        font-size: 12px;
    }

    .notice-title {
        font-size: 14px;
        white-space: normal;
    }

    .notice-item i {
        display: none;
    }

    .course-section {
        padding: 0;
    }

    .course-list {
        padding: 15px;
        background: #bdd3ff;
    }

    .course-item {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 0;
        background: #ffffff;
        margin-bottom: 10px;
    }

    .course-item:last-child {
        margin-bottom: 0;
    }

    .course-icon {
        width: 100%;
        padding: 20px;
        background: #eaf1ff;
    }

    .course-icon span {
        font-size: 18px;
        color: var(--menubar-bg);
    }

    .course-info {
        padding: 20px 15px;
        font-size: 14px;
        background: #ffffff;
    }

    .course-link {
        padding: 15px;
        background: #ffffff;
    }

    .course-link i {
        font-size: 35px;
    }

    .gallery-section {
        padding: 40px 0;
    }

    .gallery-title {
        font-size: 24px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item img {
        height: 120px;
    }

    .info-boxes-wrapper {
        grid-template-columns: 1fr;
    }

    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ========================================
   공통 유틸리티 클래스
======================================== */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.text-accent-custom {
    color: var(--accent-color) !important;
}

.bg-accent-custom {
    background-color: var(--accent-color) !important;
}
