:root {
    --primary: #5D4FEA;
    --secondary: #FF7E67;
    --success: #2EC4B6;
    --info: #6BD5E1;
    --warning: #FFD166;
    --danger: #EF476F;
    --light: #F8F9FA;
    --dark: #343A40;
    --accent1: #9B5DE5;
    --accent2: #F15BB5;
    --accent3: #00BBF9;
    --accent4: #00F5D4;
    --gradient1: linear-gradient(135deg, var(--accent1), var(--accent3));
    --gradient2: linear-gradient(135deg, var(--accent2), var(--accent4));
    --gradient3: linear-gradient(135deg, var(--primary), var(--info));
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--dark);
    background-color: #f9f9f9;
}

/* Header & Navigation */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--dark) !important;
    position: relative;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary);
    transition: all 0.3s ease;
}

.nav-link:hover::after {
    width: 80%;
    left: 10%;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin-top: 0;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    border-radius: 0.3rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--light);
    color: var(--primary);
    transform: translateX(5px);
}

/* Buttons */
.btn {
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: darken(var(--primary), 10%);
    border-color: darken(var(--primary), 10%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(93, 79, 234, 0.3);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-title {
    color: var(--primary);
    font-weight: 600;
}

/* Hero Section */
.hero-section {
    background: var(--gradient1);
    padding: 5rem 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: url('/crafts/images/pattern.svg');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* Features */
.feature-box {
    padding: 2rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

/* Timeline for History */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--primary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -13px;
    background-color: white;
    border: 4px solid var(--primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-left {
    left: 0;
}

.timeline-right {
    left: 50%;
}

.timeline-left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--light);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--light);
}

.timeline-right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--light);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--light) transparent transparent;
}

.timeline-right::after {
    left: -12px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: white;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Organization Chart */
.org-chart {
    text-align: center;
}

.org-chart ul {
    padding: 0;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    list-style: none;
}

.org-chart li {
    position: relative;
    padding: 1rem 0;
}

.org-chart .level-1 > li {
    width: 100%;
}

.org-chart .level-2 {
    margin-top: 20px;
}

.org-chart .level-2 > li {
    width: calc(100% / 3);
}

.org-chart .level-3 {
    margin-top: 20px;
}

.org-chart .level-3 > li {
    width: calc(100% / 5);
}

.org-box {
    display: inline-block;
    padding: 1rem;
    min-width: 150px;
    border-radius: 10px;
    background: var(--gradient2);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Korea Map */
.korea-map {
    position: relative;
    width: 100%;
    height: 600px;
    background: url('/crafts/images/korea-map.svg') no-repeat center;
    background-size: contain;
}

.region-point {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.region-point:hover {
    transform: scale(1.2);
    background-color: var(--secondary);
}

.region-name {
    position: absolute;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Region Tabs */
.region-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.region-tab {
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 50px;
    background-color: var(--light);
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.region-tab:hover, .region-tab.active {
    background-color: var(--primary);
    color: white;
}

/* Form Styling */
.form-control {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(93, 79, 234, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Login & Registration */
.auth-card {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.auth-tab.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease;
}

.slide-in-up {
    animation: slideInUp 0.5s ease;
}

/* Responsive */
@media (max-width: 991.98px) {
    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item::before {
        left: 60px;
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--light) transparent transparent;
    }
    
    .timeline-left::after, .timeline-right::after {
        left: 18px;
    }
    
    .timeline-right {
        left: 0;
    }
}

@media (max-width: 767.98px) {
    .org-chart ul {
        flex-direction: column;
    }
    
    .org-chart .level-2 > li, .org-chart .level-3 > li {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .region-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .region-tab {
        flex: 0 0 auto;
    }
}

/* 게시판 스타일 */
.board-container {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.board-header {
    position: relative;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.board-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.board-description {
    color: #6c757d;
    font-size: 1.1rem;
}

.board-search {
    margin-bottom: 1.5rem;
}

.board-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.board-table th {
    background-color: rgba(93, 79, 234, 0.1);
    color: #333;
    font-weight: 600;
    padding: 1rem;
    text-align: center;
}

.board-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.board-table tr:hover {
    background-color: rgba(93, 79, 234, 0.05);
}

.board-table .notice-row {
    background-color: rgba(255, 107, 107, 0.05);
}

.board-table .notice-badge {
    display: inline-block;
    background-color: var(--danger);
    color: white;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
}

.board-pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.board-pagination .page-link {
    color: var(--primary);
}

/* 게시글 상세 페이지 스타일 */
.post-container {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.post-header {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.post-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.post-meta {
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

.post-content {
    padding: 1.5rem 0;
    min-height: 200px;
    line-height: 1.8;
}

.post-attachments {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
}

.post-attachments-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-attachment-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.post-attachment-icon {
    margin-right: 0.5rem;
    color: var(--primary);
}

.post-image-preview {
    margin: 1rem 0;
    text-align: center;
}

.post-image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 게시글 작성 폼 스타일 */
.post-form-container {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.post-form-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.form-label {
    font-weight: 600;
    color: #495057;
}

.ck-editor__editable {
    min-height: 300px;
}

.image-preview-container {
    margin-top: 1rem;
}

.image-preview {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-right: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 카드 스타일 */
.feature-box {
    padding: 2rem;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
    background-color: rgba(93, 79, 234, 0.1);
    border-radius: 50%;
    transition: transform 0.3s;
}

.feature-box:hover .feature-icon {
    transform: scale(1.1);
}

/* 푸터 스타일 */
footer {
    background-color: #343a40;
    color: #f8f9fa;
    padding: 3rem 0;
}

.footer-logo img {
    height: 40px;
    margin-bottom: 1rem;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #f8f9fa;
}

.footer-social a {
    color: #adb5bd;
    font-size: 1.5rem;
    margin-right: 1rem;
    transition: color 0.3s;
}

.footer-social a:hover {
    color: #f8f9fa;
}

/* 반응형 스타일 */
@media (max-width: 992px) {
    .navbar-nav .dropdown:hover .dropdown-menu {
        display: none;
    }
    
    .navbar-nav .dropdown.show .dropdown-menu {
        display: block;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .board-table .mobile-hide {
        display: none;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
}

/* 공지사항 및 전시회 관련 스타일 */
.card-post {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 2rem;
}

.card-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.card-post .card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-post .card-body {
    padding: 1.5rem;
}

.card-post .card-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-post .card-text {
    color: #6c757d;
    margin-bottom: 1rem;
}

.card-post .card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
}

.card-post .post-meta {
    display: flex;
    justify-content: space-between;
    color: #6c757d;
    font-size: 0.9rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.post-featured {
    grid-column: span 2;
}

.post-featured .card-img-top {
    height: 300px;
}

@media (max-width: 992px) {
    .post-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .post-featured {
        grid-column: span 1;
    }
    
    .post-featured .card-img-top {
        height: 200px;
    }
}

/* PHP 5.2 및 MySQL 5.1 환경 호환성을 위한 드롭다운 메뉴 스타일 */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        padding: 0.7rem 1rem;
        white-space: normal;
    }
    .dropdown-menu {
        border: none;
        background-color: #fff;
        padding-left: 1.5rem;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        margin-top: 0.2rem;
        border-radius: 0.5rem;
    }
    .dropdown-menu .dropdown-item {
        padding: 0.9rem 1rem;
        border-bottom: 1px solid #f0f0f0;
        font-size: 1.08em;
    }
    .dropdown-menu .dropdown-item:last-child {
        border-bottom: none;
    }
    .dropdown-menu.show {
        display: block !important;
        animation: fadeIn 0.2s;
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* Dropdown menu fixes for all environments */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* Force display in case Bootstrap CSS is not fully loaded */
.show {
    display: block !important;
}

.navbar-nav .dropdown-menu {
    position: absolute;
}

/* CSS fixes for dropdown menu and responsive layout issues */
/* Ensuring the dropdown menus work properly on external access */

/* Force display menus under hover on desktop */
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        white-space: nowrap; /* Prevent menu text from wrapping */
        display: block;
        padding: 0.5rem 1rem;
    }
    
    .dropdown-menu {
        display: none; /* Hide by default */
        margin-top: 0;
        border: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        border-radius: 0.5rem;
        padding: 0.5rem;
        position: absolute;
    }
    
    .dropdown:hover .dropdown-menu,
    .dropdown-menu.show {
        display: block !important; /* Force display on hover or when show class is applied */
    }
}

/* Mobile fixes */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        padding: 0.7rem 1rem;
        white-space: normal; /* Allow text to wrap on mobile */
    }
    
    .dropdown-menu {
        border: none;
        background-color: #f8f9fa;
        padding-left: 2rem;
        position: static; /* Keep dropdown in flow on mobile */
        display: none; /* Hide by default */
    }
    
    .dropdown-menu.show {
        display: block !important; /* Force display when show class is applied */
    }
}

/* Fix for carousel/slider in all environments */
.carousel {
    display: block !important;
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-item {
    position: relative;
    display: none;
    float: left;
    width: 100%;
    margin-right: -100%;
    backface-visibility: hidden;
    transition: transform 0.6s ease-in-out;
}

.carousel-item.active {
    display: block;
}

/* Ensure all Bootstrap components display properly */
.show {
    display: block !important;
}

.collapse.show {
    display: block !important;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Navbar text should be single line on desktop */
@media (min-width: 992px) {
    .navbar-nav .nav-item {
        margin-right: 2em;
    }

    .navbar-nav .nav-link {
        font-size: 1.2em !important;
        font-weight: 500 !important;
        display: block;
        padding: 0.5rem 1rem;
        text-wrap: nowrap;
    }
}

/* Header Login & Register Dropdown */
.navbar .auth-dropdown {
    position: relative;
}

.navbar .login-register-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 30px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.navbar .login-register-btn i {
    font-size: 1.2rem;
}

.navbar .login-register-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.6);
    color: white;
}

.navbar .login-register-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(118, 75, 162, 0.5);
}

/* 호버 시 드롭다운 표시 */
.navbar .auth-dropdown:hover .auth-dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.navbar .auth-dropdown-menu {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 8px;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
}

.navbar .auth-dropdown-menu .dropdown-item {
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #333;
}

.navbar .auth-dropdown-menu .dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

.navbar .auth-dropdown-menu .dropdown-item i {
    width: 20px;
    text-align: center;
}

.navbar .auth-dropdown-menu .dropdown-divider {
    margin: 8px 0;
    opacity: 0.1;
} 