/* ===== 기본 스타일 ===== */
:root {
    --primary-green: #4CAF50;
    --dark-green: #388E3C;
    --light-green: #81C784;
    --text-dark: #212121;
    --text-light: #757575;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

/* ===== 애니메이션 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

/* ===== 바이오헬스 배경 ===== */
.biohealth-bg {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(76, 175, 80, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(33, 150, 243, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(156, 39, 176, 0.2) 0%, transparent 50%);
    background-size: cover;
}

.biohealth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 255, 255, 0.05) 35px, rgba(255, 255, 255, 0.05) 70px);
}

/* ===== 네비게이션 ===== */
nav {
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 네비게이션 메뉴 visible 처리 */
@media (min-width: 768px) {
    #desktop-menu {
        display: flex !important;
    }
    .md\:flex {
        display: flex !important;
    }
    .md\:hidden {
        display: none !important;
    }
}

/* ===== 협력기관 마퀴 ===== */
.marquee-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
}

.marquee-content {
    display: flex;
    animation: marquee 30s linear infinite;
    width: fit-content;
    gap: 60px;
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

.partner-logo {
    height: 80px;
    width: auto;
    opacity: 0.8;
    transition: all 0.3s;
    filter: grayscale(20%);
}

.partner-logo:hover {
    opacity: 1;
    transform: scale(1.05);
    filter: grayscale(0%);
}

/* ===== 모달 스타일 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-header {
    background: var(--primary-green);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.close-modal:hover {
    opacity: 0.8;
}

/* ===== 섹션 카드 ===== */
.section-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* ===== 갤러리 그리드 ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 1;
    background: #f5f5f5;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ===== 리소스 카드 ===== */
.resource-card {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.resource-card .icon {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.resource-card .download-btn {
    background: var(--primary-green);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    margin-top: 1rem;
}

.resource-card .download-btn:hover {
    background: var(--dark-green);
    transform: scale(1.05);
}

/* ===== 프로젝트 카드 ===== */
.project-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.project-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.2);
}

.project-card .team-name {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.project-card .project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.project-card .view-btn {
    background: var(--primary-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.project-card .view-btn:hover {
    background: var(--dark-green);
    transform: scale(1.05);
}

/* ===== 공지사항 리스트 ===== */
.notice-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 1.5rem 0;
    cursor: pointer;
    transition: background 0.3s;
}

.notice-item:hover {
    background: #f5f5f5;
    padding-left: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-right: 1rem;
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.notice-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 모바일 메뉴 토글 버튼 */
#mobile-menu-toggle {
    display: block;
}

@media (min-width: 768px) {
    #mobile-menu-toggle {
        display: none !important;
    }
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 767px) {
    #desktop-menu {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .marquee-content {
        animation-duration: 20s;
    }

    .partner-logo {
        height: 60px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* ===== 유틸리티 클래스 ===== */
.hidden {
    display: none !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transition-all {
    transition: all 0.3s ease;
}

/* ===== 로딩 스피너 ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 스무스 스크롤 ===== */
html {
    scroll-behavior: smooth;
}

/* ===== 섹션 패딩 ===== */
section {
    scroll-margin-top: 80px;
}