/* Custom Styles for BCK BBP Landing Page */

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

/* Language Switcher Styles */
.language-switcher {
    display: flex;
    align-items: center;
}

.lang-btn {
    color: #6B7280;
    background: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.lang-btn:hover {
    color: #3B82F6;
}

.lang-btn.active {
    color: #3B82F6;
    background: #DBEAFE;
    font-weight: 600;
}

/* Fade-in 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);
    }
}

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

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

.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.fade-in-up-delay {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out 0.2s, transform 0.8s ease-out 0.2s;
}

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

/* Navigation Styles */
#navbar {
    backdrop-filter: blur(10px);
}

#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3B82F6;
    transition: width 0.3s ease;
}

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

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

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

/* Schedule Items */
.schedule-item {
    transition: all 0.3s ease;
}

.schedule-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 6px -1px rgba(139, 127, 168, 0.1);
}

/* Target Cards */
.target-card {
    transition: all 0.3s ease;
}

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

/* CTA Button Effects */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:active {
    transform: scale(0.95);
}

/* Modal Animations */
#application-modal {
    transition: opacity 0.3s ease;
}

#application-modal.show {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

#application-modal .bg-white {
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Form Input Focus */
input:focus,
textarea:focus,
select:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(139, 127, 168, 0.1);
}

/* Success Message Animation */
#success-message {
    animation: slideInRight 0.5s ease;
}

#success-message.show {
    display: flex !important;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse Animation for Important Elements */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 127, 168, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(139, 127, 168, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 127, 168, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, #3B82F6 0%, #1E3A8A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

::-webkit-scrollbar-thumb {
    background: #3B82F6;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1E3A8A;
}

/* Mobile Menu Transition */
#mobile-menu {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.show {
    max-height: 500px;
    opacity: 1;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design Adjustments */
@media (max-width: 768px) {
    .schedule-item {
        padding: 1rem !important;
    }
    
    .schedule-item .md\:w-32 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .schedule-item .md\:flex-row {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    nav,
    footer,
    .cta-button,
    #application-modal {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* Accessibility Improvements */
*:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 4px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bg-bck-blue {
        background-color: #1E3A8A;
    }
    
    .text-bck-blue {
        color: #1E3A8A;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

/* Hover Effects for Touch Devices */
@media (hover: none) {
    .feature-card:hover,
    .schedule-item:hover,
    .target-card:hover {
        transform: none;
    }
}

/* Grid Gap Utilities */
.gap-custom {
    gap: 2rem;
}

/* Custom Shadow */
.shadow-custom {
    box-shadow: 0 10px 40px rgba(139, 127, 168, 0.15);
}

/* Backdrop Blur for Modal */
#application-modal {
    backdrop-filter: blur(5px);
}

/* Transition for All Interactive Elements */
a,
button,
input,
textarea,
select {
    transition: all 0.3s ease;
}

/* Hero Section Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Sticky Elements */
.sticky-top {
    position: sticky;
    top: 80px;
    z-index: 10;
}

/* Card Shine Effect */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.5s;
}

.card-shine:hover::before {
    left: 100%;
}

/* Text Selection */
::selection {
    background-color: #DBEAFE;
    color: white;
}

::-moz-selection {
    background-color: #DBEAFE;
    color: white;
}

/* Tooltip Styles */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 8px 12px;
    background: #333;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.875em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #3B82F6, transparent);
    margin: 2rem 0;
}

/* Image Hover Effects */
img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

img:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #E8E4F3;
    color: #1E3A8A;
    border-left: 4px solid #3B82F6;
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: #3B82F6;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Utility Classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.box-shadow-lg {
    box-shadow: 0 20px 50px rgba(139, 127, 168, 0.2);
}

.overflow-hidden {
    overflow: hidden;
}

.pointer-events-none {
    pointer-events: none;
}

/* Z-index Management */
.z-modal {
    z-index: 1000;
}

.z-dropdown {
    z-index: 900;
}

.z-sticky {
    z-index: 800;
}

/* Flex Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Grid Auto Fit */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Aspect Ratio */
.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Border Gradient */
.border-gradient {
    border: 2px solid transparent;
    background-image: linear-gradient(white, white),
                      linear-gradient(135deg, #3B82F6, #1E3A8A);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Neumorphism Effect */
.neumorphic {
    background: #f5f5f5;
    box-shadow: 8px 8px 16px #d1d1d1, -8px -8px 16px #ffffff;
}

/* Clip Path Decorations */
.clip-diagonal {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

/* Floating Animation */
@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Focus Visible for Better Accessibility */
.focus-visible:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 4px;
}

/* Print-specific styles */
@page {
    margin: 2cm;
}

@media print {
    body {
        font-size: 12pt;
    }
    
    h1 {
        font-size: 24pt;
    }
    
    h2 {
        font-size: 20pt;
    }
    
    h3 {
        font-size: 16pt;
    }
}

/* ================================
   Text wrapping fix (KO/JA) - REVISED
   ================================ */

/* 1) 기본: 과한 전역 span 적용을 줄이고, 문장 컨테이너 중심으로 처리 */
body { 
  overflow-wrap: break-word; 
}

/* 문장/타이포 컨테이너들 */
p, li, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  white-space: normal;
}

/* 2) 한국어: 단어 내부 쪼개짐 방지 */
html[lang="ko"] p,
html[lang="ko"] li,
html[lang="ko"] h1,
html[lang="ko"] h2,
html[lang="ko"] h3,
html[lang="ko"] h4,
html[lang="ko"] h5,
html[lang="ko"] h6 {
  word-break: keep-all;
  line-break: auto;
}

/* 3) 일본어: anywhere 금지(비자연스러운 体|系 같은 쪼개짐 유발) */
html[lang="ja"] p,
html[lang="ja"] li,
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] h4,
html[lang="ja"] h5,
html[lang="ja"] h6 {
  word-break: normal;        /* 기본 일본어 규칙 */
  line-break: strict;        /* 금칙/구두점 처리 개선 */
  overflow-wrap: break-word; /* 긴 영문/숫자 토큰만 필요 시 꺾기 */
}

/* 3-1) 지원 브라우저에서 “구(phrase) 단위” 줄바꿈을 더 자연스럽게 */
@supports (word-break: auto-phrase) {
  html[lang="ja"] p,
  html[lang="ja"] li,
  html[lang="ja"] h1,
  html[lang="ja"] h2,
  html[lang="ja"] h3,
  html[lang="ja"] h4,
  html[lang="ja"] h5,
  html[lang="ja"] h6 {
    word-break: auto-phrase;
  }
}

/* 4) URL/영문 긴 토큰(링크/버튼 텍스트 등)만 예외적으로 anywhere 허용 */
a, button {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 5) 보기 좋은 줄바꿈(지원 브라우저에서만 동작) */
.text-pretty { text-wrap: pretty; }
.text-balance { text-wrap: balance; }