/* ========================================
   HACCP CARE 24 - 공통 CSS
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --dark: #0f172a;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--dark);
    line-height: 1.6;
}

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

/* ========================================
   헤더
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
}

.logo-text span {
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav > a, .nav-dropdown > a {
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
    padding: 0.5rem 0;
    position: relative;
    white-space: nowrap;
}

.nav > a:hover, .nav-dropdown:hover > a {
    color: var(--primary);
}

.nav > a.active {
    color: var(--primary);
}

.nav > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav > a:hover::after, .nav > a.active::after {
    width: 100%;
}

/* 드롭다운 메뉴 */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 0.75rem 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--dark);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

.header-cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.header-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(8,145,178,0.3);
}

.header-login {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark);
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
    margin-left: 10px;
}

.header-login:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
}

/* ========================================
   페이지 배너 (서브페이지용)
   ======================================== */
.page-banner {
    background: linear-gradient(135deg, var(--dark) 0%, #1e3a5f 100%);
    padding: 8rem 2rem 4rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-banner h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.page-banner p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
}

.breadcrumb {
    position: relative;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

.breadcrumb a:hover {
    opacity: 1;
}

/* ========================================
   섹션 공통
   ======================================== */
section {
    padding: 5rem 2rem;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ========================================
   버튼
   ======================================== */
.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(8,145,178,0.4);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-white {
    background: white;
    color: var(--dark);
}

.btn-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* ========================================
   카드
   ======================================== */
.card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 1px solid var(--light);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.card-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ========================================
   그리드
   ======================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }

/* ========================================
   폼
   ======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

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

/* ========================================
   푸터
   ======================================== */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 4rem 2rem 2rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand .logo-text {
    color: white;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-menu h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.footer-menu ul {
    list-style: none;
}

.footer-menu li {
    margin-bottom: 0.75rem;
}

.footer-menu a {
    color: rgba(255,255,255,0.7);
    transition: color 0.3s;
}

.footer-menu a:hover {
    color: var(--secondary);
}

.footer-bottom {
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.visitor-counter {
    display: flex;
    gap: 1.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.visitor-counter span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.8);
}

.visitor-counter strong {
    color: var(--secondary);
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
}

.footer-links a:hover {
    color: var(--secondary);
}

/* ========================================
   배경색
   ======================================== */
.bg-light { background: var(--light); }
.bg-white { background: white; }
.bg-dark { background: var(--dark); color: white; }
.bg-gradient { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }

/* ========================================
   유틸리티
   ======================================== */
.text-center { text-align: center; }
.text-white { color: white; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ========================================
   반응형
   ======================================== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav { display: none; }
    .header-cta { display: none; }
    .mobile-menu-btn { display: block; }
    
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    
    .page-banner { padding: 7rem 1.5rem 3rem; }
    .page-banner h1 { font-size: 1.8rem; }
    
    .section-header h2 { font-size: 1.6rem; }
    
    .footer-top { grid-template-columns: 1fr; }
    .footer-bottom { 
        flex-direction: column; 
        gap: 1rem; 
        text-align: center; 
    }
}

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

.animate {
    animation: fadeInUp 0.6s ease-out forwards;
}
