/* Basic Reset & Font */
body, h1, h2, h3, p, ul, li {
    margin: 0;
    padding: 0;
    list-style: none;
}

body {
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f0f0f0; /* A neutral background color */
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
}

#wrap {
    width: 100%;
    min-width: 320px; /* 모바일 최소 너비 */
}

/* Header */
#header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    position: relative; /* For search area positioning */
}

.header-container {
    width: 100%;
    max-width: 1920px; /* 헤더도 메인과 동일하게 확장 */
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .header-container {
        height: 60px;
        padding: 0 10px;
    }
}

.logo a {
    display: flex;
    align-items: center;
}

.logo-image {
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    object-fit: contain;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.logo-flag {
    font-size: 20px;
    margin-left: 8px;
}

/* GNB */
.gnb {
    flex: 1;
    display: flex;
    justify-content: center;
}

.gnb ul {
    display: flex;
    justify-content: space-evenly;
    width: 100%;
    max-width: 900px;
    gap: 20px;
}

.gnb ul li {
    position: relative;
}

.gnb ul li > a {
    display: block;
    padding: 20px 15px;
    font-weight: bold;
    font-size: 18px;
    white-space: nowrap;
}

/* GNB 반응형 - 태블릿 */
@media (min-width: 1025px) and (max-width: 1400px) {
    .gnb ul {
        max-width: 700px;
        gap: 15px;
    }

    .gnb ul li > a {
        padding: 20px 10px;
        font-size: 16px;
    }
}

/* GNB 반응형 - 작은 데스크탑 */
@media (min-width: 1401px) and (max-width: 1600px) {
    .gnb ul {
        max-width: 800px;
        gap: 20px;
    }

    .gnb ul li > a {
        padding: 20px 12px;
        font-size: 17px;
    }
}

/* GNB 반응형 - 큰 데스크탑 */
@media (min-width: 1601px) {
    .gnb ul {
        max-width: 1000px;
        gap: 30px;
    }

    .gnb ul li > a {
        padding: 20px 20px;
        font-size: 18px;
    }
}

/* GNB Dropdown */
.gnb .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffe63f;
    border: 1px solid #ddd;
    padding: 10px;
    width: 220px;
    text-align: left;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gnb li:hover > .dropdown {
    display: block;
}

.gnb .dropdown li {
    margin-bottom: 5px;
    padding: 3px 10px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.gnb .dropdown li:hover {
    background-color: rgba(255,255,255,0.3);
}

.gnb .dropdown a {
    font-size: 14px;
    font-weight: normal;
    display: block;
    padding: 5px 0;
    color: #333;
}

/* Rainbow Text Animation */
@keyframes rainbow-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.rainbow-text {
    background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow-flow 3s linear infinite;
}

/* Header Utils */
.header-utils {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-utils .divider {
    color: #ccc;
}

.header-utils .search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

/* Search Area */
.search-area {
    display: none; /* Hidden by default */
    position: absolute;
    top: 80px; /* Below header */
    left: 0;
    right: 0;
    background-color: #fff;
    border-top: 1px solid #ddd;
    padding: 20px;
    z-index: 20;
}

.search-area.active {
    display: block;
}

/* Main Layout */
#main {
    width: 100%;
    max-width: 1920px; /* 메인 콘텐츠를 더 넓게 사용 */
    margin: 20px auto;
    padding: 0 10px; /* 양쪽 패딩 줄여서 공간 확보 */
    display: flex;
    gap: 15px; /* 갭을 줄여서 더 넓은 메인 영역 확보 */
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    #main {
        flex-direction: column;
        padding: 0 10px;
        margin: 10px auto;
    }
}

/* --- Left Vertical Banners (PC Only) --- */
.left-vertical-banners {
    width: 120px;
    flex-shrink: 0;
    background-color: transparent;
    display: none; /* 기본은 숨김 - 배너가 있을 때만 표시 */
    flex-direction: column;
    gap: 0; /* 배너 간 공백 제거 */
}

.left-vertical-banners img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.3s ease;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.left-vertical-banners img:hover {
    transform: scale(1.05);
}

/* 모바일에서는 왼쪽 배너 숨기기 */
@media (max-width: 1024px) {
    .left-vertical-banners {
        display: none !important;
        width: 0 !important;
        overflow: hidden !important;
    }
}

/* --- Sidebar --- */
.sidebar {
    width: 380px;
    flex-shrink: 0;
    background-color: transparent;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 100%;
        order: 2;
    }
}

/* --- Right Sidebar (유튜브) --- */
.right-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: transparent;
}

@media (max-width: 1024px) {
    .right-sidebar {
        display: none;
    }
}

/* 유튜브 위 세로배너 */
.right-youtube-top-banners {
    width: 100%;
    margin: 0; /* 배너 간 공백 제거 */
}

.right-youtube-top-banners img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0; /* 배너 간 공백 제거 */
    padding: 0;
    object-fit: contain;
    border-radius: 0;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.right-youtube-top-banners img:hover {
    transform: scale(1.05);
}

.sidebar > div:not(.sidebar-banners) {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
}

/* Login Box */
.login-box {
    padding: 0;
}

.login-box .tabs {
    display: flex;
}

.login-box .tab {
    flex: 1;
    padding: 15px;
    border: none;
    background-color: #f7f7f7;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
}

.login-box .tab.active {
    background-color: #fff;
    border-bottom: none;
}

.login-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    padding: 12px;
    border: 1px solid #ccc;
}

.login-form .login-btn {
    padding: 15px;
    background-color: #3a8cff;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

/* Chat Box - 기본 레이아웃만 */
.chat-box {
    padding: 15px;
}

/* Sidebar Banners */
.sidebar-banners {
    border: none;
    background: none;
    width: 100%;
    overflow: hidden;
}
.sidebar-banners img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0; /* 배너 간 공백 제거 */
    padding: 0;
    object-fit: contain;
}

@media (max-width: 1024px) {
    .sidebar-banners {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 10px;
    }

    .sidebar-banners img {
        margin-bottom: 0;
    }
}

/* --- Main Content --- */
.container {
    flex: 1;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    box-sizing: border-box;
    min-width: 0;
}

@media (max-width: 1024px) {
    .container {
        width: 100%;
        order: 1;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
        border-left: none;
        border-right: none;
    }
}

/* Main Banner Section (고정 배너) */
.main-banner-section {
    margin-bottom: 10px;
    width: 100%;
    overflow: hidden;
}

.banner-wrapper {
    width: 100%;
    max-width: 100%;
}

/* 메인 상단 배너 - 2x2 그리드 레이아웃 */
.banners,
#main-slides {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}

/* 고정 배너 스타일 */
.fixed-banner {
    width: 100% !important;
    max-width: 100%;
    margin-bottom: 0;
    overflow: hidden;
}

.fixed-banner:last-child {
    margin-bottom: 0;
}

.fixed-banner a {
    display: block;
    width: 100%;
    height: 100%;
}

.fixed-banner img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    object-fit: cover !important;
    display: block;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.fixed-banner img:hover {
    transform: scale(1.02);
}

/* 배너 1개일 때 전체 너비 */
.banners .fixed-banner:only-child,
#main-slides .fixed-banner:only-child {
    grid-column: span 2;
}

/* 메인 배너 2개 이상일 때 그리드 */
.banners.two-banners,
#main-slides.two-banners {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}

.banners.two-banners .fixed-banner,
#main-slides.two-banners .fixed-banner {
    width: 100% !important;
}

.banners.two-banners .fixed-banner img,
#main-slides.two-banners .fixed-banner img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    object-fit: cover !important;
}

@media (max-width: 768px) {
    /* 메인 배너 그리드 유지 */
    .banners,
    #main-slides,
    .banners.two-banners,
    #main-slides.two-banners {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .fixed-banner img:hover {
        transform: none;
    }

    .fixed-banner img {
        border-radius: 4px;
    }
}

/* Latest Posts */
.latest-posts {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.post-column {
    flex: 1;
    border: 1px solid #ddd;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .latest-posts {
        flex-direction: column;
        gap: 15px;
    }

    .post-column {
        width: 100%;
    }
}

.promo-column {
    border: 2px solid #ffc107; /* Yellow border for promo */
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f9f9f9;
}

.post-header h3 {
    font-size: 16px;
}

.post-header .more-btn {
    font-size: 12px;
    color: #666;
}

.post-list {
    padding: 15px;
}

.post-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.post-list li:last-child {
    border-bottom: none;
}

.post-list li a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.post-list li .time {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

/* 게시판 하단 배너 (2개 가로 배치) */
.post-bottom-banners {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0; /* 배너 간 공백 제거 */
    margin: 0;
    width: 100%;
    overflow: hidden;
}

.post-bottom-banners a,
.post-bottom-banners > div {
    width: 100%;
    overflow: hidden;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.post-bottom-banners img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.3s ease;
    margin: 0;
    padding: 0;
}

.post-bottom-banners a:hover img {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .post-bottom-banners {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Central Banners (게시판 하단 배너) */
.central-banners,
#board-bottom-central-banners {
    display: flex;
    flex-direction: column;
    gap: 0; /* 배너 간 공백 제거 */
    margin: 0;
    width: 100%;
    max-width: 1100px;
    overflow: hidden;
}

.central-banners a,
#board-bottom-central-banners a {
    display: block;
    width: 100%;
    max-width: 1100px;
}

.central-banners img,
#board-bottom-central-banners img {
    width: 1100px !important;
    max-width: 100%;
    height: 120px !important;
    display: block;
    object-fit: cover;
    margin: 0;
    padding: 0;
}

/* 달력 위 배너 섹션 */
.calendar-banner-section {
    width: 100%;
    max-width: 1100px;
    overflow: hidden;
    margin: 0; /* 배너 간 공백 제거 */
}

#calendar-banner-container {
    width: 100%;
    max-width: 1100px;
}

#calendar-banner-container a,
#calendar-banner-container .calendar-banner {
    display: block;
    width: 100%;
    max-width: 1100px;
}

#calendar-banner-container img {
    width: 1100px !important;
    max-width: 100%;
    height: 120px !important;
    display: block;
    object-fit: cover;
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    .central-banners {
        gap: 0;
        margin: 0;
    }

    .calendar-banner-section {
        margin: 0;
    }
}

/* Server Calendar */
.server-calendar h2 {
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-left: 1px solid #ddd;
    border-top: 1px solid #ddd;
    width: 100%;
    overflow-x: auto;
}

.day-header {
    text-align: center;
    padding: 10px 5px;
    background-color: #f9f9f9;
    font-weight: bold;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.calendar-day {
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 80px;
        padding: 5px;
        font-size: 11px;
    }

    .day-header {
        padding: 8px 3px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 60px;
        padding: 3px;
        font-size: 10px;
    }

    .day-header {
        padding: 6px 2px;
        font-size: 11px;
    }
}

.calendar-day:hover {
    background-color: #f8f9fa;
    transform: scale(1.02);
}

.calendar-day.today {
    background: #ffffff;
    color: white;
    font-weight: bold;
}

.calendar-day.has-event {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e9 100%);
    border-color: #4CAF50;
}

.calendar-day.other-month {
    color: #ccc;
    background-color: #f9f9f9;
}

/* 이벤트 컨테이너 */
.event-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
}

/* 이벤트 스타일 */
.event {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.event:hover {
    transform: scale(1.1);
    z-index: 10;
    position: relative;
}

/* 색상 테마 */
.event-blue {
    background: #ffffff;
    color: white;
}

.event-red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.event-green {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
}

.event-purple {
    background: linear-gradient(135deg, #9775fa 0%, #845ef7 100%);
    color: white;
}

.event-orange {
    background: linear-gradient(135deg, #ff8a65 0%, #ff7043 100%);
    color: white;
}

.event-gold {
    background: linear-gradient(135deg, #ffd93d 0%, #ffb300 100%);
    color: #333;
}

.event-pink {
    background: linear-gradient(135deg, #f783ac 0%, #e91e63 100%);
    color: white;
}

.event-cyan {
    background: linear-gradient(135deg, #4dd0e1 0%, #00bcd4 100%);
    color: white;
}

/* 애니메이션 효과 */
.animate-pulse {
    animation: eventPulse 2s infinite;
}

.animate-glow {
    animation: eventGlow 3s ease-in-out infinite;
}

.animate-bounce {
    animation: eventBounce 1s ease-in-out infinite;
}

.animate-shake {
    animation: eventShake 2s ease-in-out infinite;
}

.animate-rotate {
    animation: eventRotate 4s linear infinite;
}

/* 키프레임 애니메이션 */
@keyframes eventPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes eventGlow {
    0%, 100% {
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

@keyframes eventBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

@keyframes eventShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes eventRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.day-number {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.server-block {
    display: block;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    text-align: center;
}

.server-block .server-name {
    font-weight: bold;
}

.server-block .server-desc {
    font-size: 11px;
    opacity: 0.9;
}

.server-block img.lazy-load {
    width: 100%;
    height: 50px; /* Placeholder height */
    object-fit: cover;
    margin-bottom: 5px;
}

/* Server Block Colors */
.server-block.color-1 { background-color: #e91e63; }
.server-block.color-2 { background-color: #9c27b0; }
.server-block.color-3 { background-color: #3f51b5; }
.server-block.color-4 { background-color: #009688; }

/* Wing Banners */
.wing-banner {
    position: absolute;
    top: 100px;
    width: 160px;
    z-index: 50;
}

.left-wing {
    left: calc(50% - 700px); /* 메인 콘텐츠 정렬 맞춤 */
}

.right-wing {
    right: calc(50% - 700px); /* 메인 콘텐츠 정렬 맞춤 */
}

.wing-banner-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Server Banner Styles */
.server-banner {
    width: 160px;
    height: auto;
    padding: 15px;
    border-radius: 8px;
    color: white;
    font-family: 'Malgun Gothic', sans-serif;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-bottom: 10px;
}

.server-banner:hover {
    transform: scale(1.05);
}

.red-banner {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border: 2px solid #fee2e2;
}

.blue-banner {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 2px solid #dbeafe;
}

.gold-banner {
    background: linear-gradient(135deg, #d97706, #92400e);
    border: 2px solid #fef3c7;
}

.server-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.server-subtitle {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    opacity: 0.9;
}

.server-desc {
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 10px;
    opacity: 0.8;
}

.server-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

/* Show wing banners only on very wide screens */
@media (min-width: 1560px) {
    .wing-banner {
        display: block;
    }
}

/* Hide wing banners on smaller screens */
@media (max-width: 1559px) {
    .wing-banner {
        display: none !important;
    }
}

/* Footer */
#footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 30px 0 20px 0;
    margin-top: 50px;
    border-top: 3px solid #666666;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-text {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    font-size: 14px;
}

.footer-links a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.footer-contact {
    font-size: 14px;
    opacity: 0.9;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* 모달 관련 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 이벤트 폼 스타일 */
.event-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #666666;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 이벤트 목록 스타일 */
.event-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.event-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid currentColor;
    position: relative;
}

.event-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.event-emoji {
    font-size: 20px;
}

.event-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.event-actions {
    display: flex;
    gap: 8px;
}

.btn-edit,
.btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-edit {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.btn-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.btn-delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.event-description {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.event-link {
    display: inline-block;
    margin-top: 8px;
    color: #666666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.event-link:hover {
    text-decoration: underline;
}

/* 버튼 스타일 */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #ffffff;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-saving {
    background: linear-gradient(135deg, #ffd93d 0%, #ffb300 100%) !important;
    color: #333 !important;
    pointer-events: none;
}

.btn-success-animation {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%) !important;
    color: white !important;
    transform: scale(1.05);
    animation: successPulse 0.6s ease;
}

.btn-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    color: white !important;
    animation: errorShake 0.5s ease;
}

/* 성공 토스트 메시지 */
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1001;
    font-weight: 500;
}

/* 애니메이션 키프레임 */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes successPulse {
    0%, 100% { transform: scale(1.05); }
    50% { transform: scale(1.1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 달력 날짜 호버 효과 개선 */
.calendar-day {
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.calendar-day.has-event:hover {
    background: rgba(102, 126, 234, 0.15);
}

/* 이벤트 호버 효과 */
.event {
    transition: all 0.2s ease;
    margin-bottom: 2px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event:hover {
    transform: scale(1.05);
    z-index: 10;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 날짜 액션 모달 스타일 */
.date-action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-large {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.existing-events-preview {
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.existing-events-preview h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.event-preview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-preview {
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid currentColor;
    position: relative;
}

.event-preview:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.event-preview .event-emoji {
    font-size: 18px;
}

.event-preview .event-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.edit-hint {
    font-size: 12px;
    opacity: 0.7;
    font-style: italic;
}

.event-preview:hover .edit-hint {
    opacity: 1;
    font-weight: 600;
}

/* 이벤트 추가 섹션 */
.add-event-section {
    margin-bottom: 20px;
}

.btn-add-event {
    width: 100%;
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%) !important;
    font-size: 16px;
    font-weight: 700;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.3);
}

.btn-add-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(81, 207, 102, 0.4);
}

.events-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.events-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
}

.events-divider span {
    background: white;
    padding: 0 20px;
    color: #666;
    font-weight: 600;
    font-size: 14px;
}

/* 기존 이벤트 목록 모달 개선 */
.event-list .event-item {
    transition: all 0.2s ease;
}

.event-list .event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 모달 반응형 디자인 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .date-action-buttons {
        flex-direction: column;
    }

    .btn-large {
        flex: none;
        width: 100%;
    }
}

/* 권한 시스템 스타일 */
.permission-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.admin-mode, .readonly-mode {
    padding: 15px;
    border-radius: 8px;
    border: 2px solid;
}

.admin-mode {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 100%);
    border-color: #4CAF50;
}

.admin-mode h4 {
    color: #2E7D32;
    margin: 0 0 10px 0;
}

.readonly-mode {
    background: linear-gradient(135deg, #fff3e0 0%, #fafafa 100%);
    border-color: #FF9800;
}

.readonly-mode h4 {
    color: #E65100;
    margin: 0 0 10px 0;
}

.permission-info ul {
    margin: 0;
    padding-left: 20px;
}

.permission-info li {
    margin-bottom: 5px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .permission-info {
        grid-template-columns: 1fr;
    }
}

/* 제목 스타일 - 반짝임 효과 (홍보게시판용) */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.3; }
}

.title-blink {
    animation: blink 1.5s infinite;
}
