/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 해찬 브랜드 컬러 */
    --primary-gold: #D4A574;
    --primary-gold-dark: #B8935F;
    --primary-gold-light: #E5C89D;
    --secondary-navy: #1E3A5F;
    --secondary-navy-dark: #152A45;
    --accent-yellow: #F4C430;
    --accent-orange: #E8934E;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* 해찬 로고 스타일 */
.haechan-logo {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.haechan-sun {
    position: relative;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #F4C430 0%, #E8934E 50%, #D4A574 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(244, 196, 48, 0.4);
}

.haechan-sun::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.haechan-rays {
    position: absolute;
    width: 100%;
    height: 100%;
}

.ray {
    position: absolute;
    width: 3px;
    height: 15px;
    background: linear-gradient(to top, transparent, #F4C430);
    top: -10px;
    left: 50%;
    transform-origin: center 35px;
}

/* 큰 로고용 ray 스타일 */
.haechan-logo .ray {
    transform-origin: center calc(50% + 90px);
}

.ray:nth-child(1) { transform: translateX(-50%) rotate(0deg); }
.ray:nth-child(2) { transform: translateX(-50%) rotate(30deg); }
.ray:nth-child(3) { transform: translateX(-50%) rotate(60deg); }
.ray:nth-child(4) { transform: translateX(-50%) rotate(90deg); }
.ray:nth-child(5) { transform: translateX(-50%) rotate(120deg); }
.ray:nth-child(6) { transform: translateX(-50%) rotate(150deg); }
.ray:nth-child(7) { transform: translateX(-50%) rotate(180deg); }
.ray:nth-child(8) { transform: translateX(-50%) rotate(210deg); }
.ray:nth-child(9) { transform: translateX(-50%) rotate(240deg); }
.ray:nth-child(10) { transform: translateX(-50%) rotate(270deg); }
.ray:nth-child(11) { transform: translateX(-50%) rotate(300deg); }
.ray:nth-child(12) { transform: translateX(-50%) rotate(330deg); }

.logo-icon {
    font-size: 24px;
    color: white;
    z-index: 1;
}

/* 황금빛 그라데이션 배경 */
.gold-gradient {
    background: linear-gradient(135deg, #F4C430 0%, #E8934E 50%, #D4A574 100%);
}

.gold-gradient-light {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFE8C5 50%, #FFD9A0 100%);
}

.navy-gradient {
    background: linear-gradient(135deg, #1E3A5F 0%, #152A45 100%);
}

/* 애니메이션 효과 */
@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* 헤더 스크롤 효과 */
#header.scrolled {
    padding: 0.75rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 네비게이션 링크 */
.nav-link {
    position: relative;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: linear-gradient(90deg, #D4A574 0%, #E8934E 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 모바일 메뉴 애니메이션 */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.mobile-menu.active {
    max-height: 500px;
}

/* 서비스 카드 호버 효과 */
.service-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-8px);
}

/* 스크롤 애니메이션 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll to Top 버튼 */
#scroll-top {
    transition: all 0.3s ease;
}

#scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
}

/* 폼 입력 필드 포커스 효과 */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
    border-color: #D4A574;
}

/* 반응형 그리드 조정 */
@media (max-width: 768px) {
    .grid {
        gap: 1rem;
    }
}

/* 로딩 애니메이션 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #1d4ed8;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* 성공/에러 메시지 스타일 */
.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #10b981;
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #ef4444;
}

/* 카드 그림자 효과 */
.card-shadow {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 버튼 호버 효과 */
button,
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

button::before,
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

button:hover::before,
.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 텍스트 그라데이션 */
.text-gradient {
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 커스텀 체크박스 */
input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    accent-color: #D4A574;
}

input[type="checkbox"]:checked {
    background-color: #D4A574;
    border-color: #D4A574;
}

/* 프린트 스타일 */
@media print {
    header,
    footer,
    #scroll-top,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* 접근성 개선 */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #D4A574;
    outline-offset: 2px;
}

/* 다크모드 대비 (선택사항) */
@media (prefers-color-scheme: dark) {
    /* 다크모드 스타일은 필요시 추가 */
}

/* 애니메이션 성능 최적화 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 커스텀 스크롤바 (웹킷 브라우저) */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #D4A574 0%, #E8934E 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #B8935F 0%, #D4A574 100%);
}

/* 이미지 로딩 효과 */
img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* 툴팁 스타일 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background-color: #1f2937;
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 0.5rem;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 배지 스타일 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-green {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-red {
    background-color: #fee2e2;
    color: #991b1b;
}

/* 알림 배너 */
.notification-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    color: white;
    padding: 0.75rem;
    text-align: center;
    z-index: 60;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.notification-banner.show {
    transform: translateY(0);
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 추가 반응형 스타일 */
@media (max-width: 640px) {
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* 페이지 전환 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    animation: fadeIn 0.5s ease-in;
}

/* 테이블 반응형 스타일 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    font-weight: 600;
    background-color: #f9fafb;
}

/* 카드 그리드 레이아웃 개선 */
.card-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* 플렉스박스 유틸리티 */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 비율 유지 컨테이너 */
.aspect-ratio-16-9 {
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
}

.aspect-ratio-16-9 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 네이버 지도 스타일 */
iframe[src*="map.naver.com"] {
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* CI 로고 스타일 */
img[alt*="행정사사무소 해찬"] {
    transition: all 0.3s ease;
}

.hero-logo {
    animation: fadeInScale 1s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 대표행정사 사진 스타일 */
img[alt*="대표행정사"] {
    transition: transform 0.3s ease;
}

img[alt*="대표행정사"]:hover {
    transform: scale(1.02);
}

/* 이미지 로딩 애니메이션 */
@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

img[alt*="대표행정사"] {
    animation: fadeInImage 0.8s ease-out;
}