/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDelay {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDelay2 {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-fade-in-delay {
    animation: fadeInDelay 1s ease-out 0.3s both;
}

.animate-fade-in-delay-2 {
    animation: fadeInDelay2 1s ease-out 0.6s both;
}

/* Hero Background */
.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(165, 0, 52, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 0, 44, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

/* Policy Cards Hover Effect */
.policy-card {
    transition: all 0.3s ease;
}

.policy-card:hover {
    transform: translateY(-10px);
}

/* Swiper Customization */
.swiper-button-next,
.swiper-button-prev {
    color: #A50034 !important;
    background: white !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    margin-top: -25px !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: #A50034 !important;
    color: white !important;
    transform: scale(1.1) !important;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 18px !important;
    font-weight: bold !important;
}

.swiper-button-disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

.events-swiper {
    padding: 0 60px !important;
}

.events-swiper .swiper-slide {
    height: auto !important;
}

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Smooth Scrolling */
html {
    scroll-behavior: auto;
}

/* Fix section spacing issues */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
    overflow-x: hidden;
}

html {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

section {
    margin: 0 !important;
    padding: 0;
    display: block;
}

section.py-24 {
    padding-top: 6rem !important;
    padding-bottom: 6rem !important;
    margin: 0 !important;
}

/* Default hero section for all pages */
.hero-section {
    height: 60vh;
    min-height: 60vh;
    max-height: 60vh;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Main page hero section - full height */
#home.hero-section {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #64748b;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Image Gallery Hover Effect */
.aspect-square:hover {
    cursor: pointer;
}

/* Form Focus States */
input:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(165, 0, 52, 0.1);
}

/* Button Hover Effects */
button {
    transition: all 0.3s ease;
}

/* Navigation Link Hover Effect */
nav a {
    position: relative;
    transition: color 0.3s ease;
}

nav a:hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #dc2626;
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #dc2626;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

/* Loading Animation for Images */
.bg-gray-200 {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Testimonial Cards */
.testimonials-swiper .swiper-slide {
    height: auto;
}

/* Stats Animation Ready */
.counter[data-animated] {
    color: #dc2626;
}

/* Enhanced Mobile Styles */
@media (max-width: 640px) {
    /* Hero Section - Default for all pages */
    .hero-section {
        height: 60vh;
        min-height: 60vh;
    }
    
    /* Hero Section - Main page only */
    #home.hero-section {
        height: 100vh !important;
        min-height: 600px !important;
    }
    
    .hero-section h1 {
        font-size: clamp(2rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-section p {
        font-size: clamp(1rem, 4vw, 1.2rem) !important;
        margin-bottom: 1.5rem !important;
        padding: 0 1rem !important;
    }
    
    /* Policy Cards */
    .policy-card {
        margin-bottom: 1rem;
        padding: 1rem !important;
    }
    
    /* Navigation */
    nav h1 {
        font-size: 1.125rem !important;
    }
    
    nav h1 span {
        font-size: 0.875rem !important;
    }
    
    /* Swiper Events */
    .events-swiper {
        padding: 0 !important;
    }
    
    /* Stats Section */
    .counter {
        font-size: clamp(2.5rem, 12vw, 4rem) !important;
    }
    
    /* FAQ Questions */
    .faq-question h4 {
        line-height: 1.4 !important;
        word-wrap: break-word !important;
    }
    
    /* Form Elements */
    input, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Section Spacing */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

/* Tablet Styles */
@media (min-width: 641px) and (max-width: 1024px) {
    .hero-section h1 {
        font-size: clamp(3rem, 6vw, 4rem) !important;
    }
    
    .hero-section p {
        font-size: clamp(1.125rem, 3vw, 1.5rem) !important;
    }
    
    .events-swiper {
        padding: 0 30px !important;
    }
}

/* Ultra-wide screen styles */
@media (min-width: 1920px) {
    /* Main page hero on ultra-wide */
    #home.hero-section {
        height: 90vh !important;
    }
    
    /* Menu pages stay 60vh on ultra-wide */
    .hero-section {
        height: 60vh;
    }
    
    .max-w-7xl {
        max-width: 1400px !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch device improvements */
@media (pointer: coarse) {
    button, a {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    .faq-question {
        padding: 1rem !important;
    }
}

/* Intersection Observer Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Conservative Party Theme - No Rounded Corners */
.policy-card,
.swiper-slide > div,
article,
button,
input,
textarea,
.bg-white,
.aspect-square {
    border-radius: 0 !important;
}

/* Override Tailwind rounded classes */
.rounded,
.rounded-lg,
.rounded-xl,
.rounded-full {
    border-radius: 0 !important;
}

/* Red Theme Overrides */
.text-blue-600 { color: #A50034 !important; }
.text-blue-500 { color: #C7003F !important; }
.bg-blue-600 { background-color: #A50034 !important; }
.bg-blue-700 { background-color: #8B002C !important; }
.bg-blue-100 { background-color: #FCE7ED !important; }
.border-blue-500 { border-color: #C7003F !important; }
.ring-blue-500 { --tw-ring-color: #C7003F !important; }

/* Clean Navigation Styles */
.text-red-600 { color: #A50034 !important; }
.text-red-700 { color: #8B002C !important; }
.bg-red-600 { background-color: #A50034 !important; }
.bg-red-700 { background-color: #8B002C !important; }
.hover\:text-red-600:hover { color: #A50034 !important; }
.hover\:bg-red-700:hover { background-color: #8B002C !important; }

/* Dropdown Shadow Enhancement */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Floating Navigation Backdrop */
.bg-white\/90 {
    background-color: rgba(255, 255, 255, 0.9) !important;
}

.backdrop-blur-sm {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* 자료실 스타일 */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.resource-category {
    background: white;
    padding: 25px;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e5e5;
}

.resource-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.resource-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #A50034, #c41e3a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.resource-icon i {
    font-size: 24px;
    color: white;
}

.resource-category h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.resource-category p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 0;
    border-left: 4px solid #A50034;
    transition: background-color 0.3s ease;
}

.resource-item:hover {
    background-color: #e9ecef;
    cursor: pointer;
}

.resource-title {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
    flex: 1;
}

.resource-date {
    color: #666;
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: 15px;
}

.search-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.search-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.search-section p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-input-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #ddd;
    border-radius: 0;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #A50034;
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #A50034;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background: #8b0029;
}

.search-filters {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 0;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #A50034;
}

.notice-box {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 0;
    border-left: 5px solid #A50034;
    max-width: 800px;
    margin: 0 auto;
}

.notice-box h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.notice-box ul {
    list-style: none;
    padding: 0;
}

.notice-box li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
    color: #555;
    line-height: 1.6;
}

.notice-box li:before {
    content: "•";
    color: #A50034;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 자료실 모바일 반응형 */
@media (max-width: 768px) {
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .search-filters {
        flex-direction: column;
        align-items: center;
    }

    .filter-select {
        width: 100%;
        max-width: 250px;
    }

    .notice-box {
        padding: 20px;
    }
} 

/* 히어로 섹션 반응형 배경 위치 */
.hero-bg-responsive {
    background-position: center center; /* 데스크톱 기본값 */
}

/* 모바일 및 태블릿에서 배경 이미지를 왼쪽으로 */
@media (max-width: 768px) {
    .hero-bg-responsive {
        background-position: left center; /* 모바일에서 왼쪽 정렬 */
    }
}

/* 더 작은 모바일 화면에서는 더 왼쪽으로 */
@media (max-width: 480px) {
    .hero-bg-responsive {
        background-position: 20% center; /* 작은 모바일에서 약간 오른쪽으로 조정 */
    }
}

/* 한국어 단어별 줄바꿈 */
html, body {
    word-break: keep-all;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, p, span, div, li, td, th {
    word-break: keep-all;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 모든 페이지 Hero 배경 이미지 WebP 지원 */
/* night-pic 이미지 (about 폴더) */
.hero-bg-night {
    background: url('images/night-pic.jpg') center/cover no-repeat;
}
.webp .hero-bg-night {
    background: url('images/night-pic.webp') center/cover no-repeat;
}

/* surrouding-pic 이미지 (news 폴더, resources.html) */
.hero-bg-surrounding {
    background: url('images/surrouding-pic.jpg') center/cover no-repeat;
}
.webp .hero-bg-surrounding {
    background: url('images/surrouding-pic.webp') center/cover no-repeat;
}

/* flag-pic 이미지 (members 폴더) */
.hero-bg-flag {
    background: url('images/flag-pic.jpg') center/cover no-repeat;
}
.webp .hero-bg-flag {
    background: url('images/flag-pic.webp') center/cover no-repeat;
}

/* flag2-pic 이미지 (support, privacy, terms, disclosure) */
.hero-bg-flag2 {
    background: url('images/flag2-pic.jpg') center/cover no-repeat;
}
.webp .hero-bg-flag2 {
    background: url('images/flag2-pic.webp') center/cover no-repeat;
}

/* hero-image 이미지 (resources/policy.html) */
.hero-bg-hero {
    background: url('images/hero-image.jpg') center/cover no-repeat;
}
.webp .hero-bg-hero {
    background: url('images/hero-image.webp') center/cover no-repeat;
}

/* 하위 폴더용 상대 경로 */
/* night-pic 이미지 (about 폴더) */
.hero-bg-night-sub {
    background: url('../images/night-pic.jpg') center/cover no-repeat;
}
.webp .hero-bg-night-sub {
    background: url('../images/night-pic.webp') center/cover no-repeat;
}

/* surrouding-pic 이미지 (news 폴더) */
.hero-bg-surrounding-sub {
    background: url('../images/surrouding-pic.jpg') center/cover no-repeat;
}
.webp .hero-bg-surrounding-sub {
    background: url('../images/surrouding-pic.webp') center/cover no-repeat;
}

/* flag-pic 이미지 (members 폴더) */
.hero-bg-flag-sub {
    background: url('../images/flag-pic.jpg') center/cover no-repeat;
}
.webp .hero-bg-flag-sub {
    background: url('../images/flag-pic.webp') center/cover no-repeat;
}

/* flag2-pic 이미지 (resources 폴더) */
.hero-bg-flag2-sub {
    background: url('../images/flag2-pic.jpg') center/cover no-repeat;
}
.webp .hero-bg-flag2-sub {
    background: url('../images/flag2-pic.webp') center/cover no-repeat;
}

/* hero-image 이미지 (resources/policy.html) */
.hero-bg-hero-sub {
    background: url('../images/hero-image.jpg') center/cover no-repeat;
}
.webp .hero-bg-hero-sub {
    background: url('../images/hero-image.webp') center/cover no-repeat;
} 