
/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  width: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: linear-gradient(135deg, #0F0F23 0%, #1a1a3a 100%);
  color: white;
  min-height: 100vh;
}

/* CSS custom properties for color fallbacks */
:root {
    --tenna-cream: #FFFBEB;
    --tenna-gold: #FACA6B;
    --tenna-teal: #FACA6B;
    --tenna-night: #0A1931;
    --tenna-purple: #A78BFA;
}

/* Ensure Tailwind colors are properly applied */
.text-tenna-cream { color: #FFFBEB !important; }
.bg-tenna-cream { background-color: #FFFBEB !important; }
.border-tenna-cream { border-color: #FFFBEB !important; }

.text-tenna-gold { color: #FACA6B !important; }
.bg-tenna-gold { background-color: #FACA6B !important; }
.border-tenna-gold { border-color: #FACA6B !important; }

.text-tenna-teal { color: #FACA6B !important; }
.bg-tenna-teal { background-color: #FACA6B !important; }
.border-tenna-teal { border-color: #FACA6B !important; }

.text-tenna-night { color: #0A1931 !important; }
.bg-tenna-night { background-color: #0A1931 !important; }
.border-tenna-night { border-color: #0A1931 !important; }

.text-tenna-purple { color: #A78BFA !important; }
.bg-tenna-purple { background-color: #A78BFA !important; }
.border-tenna-purple { border-color: #A78BFA !important; }

/* Gradient color utilities */
.from-tenna-gold { --tw-gradient-from: #FACA6B !important; }
.to-tenna-gold { --tw-gradient-to: #FACA6B !important; }
.from-tenna-teal { --tw-gradient-from: #FACA6B !important; }
.to-tenna-teal { --tw-gradient-to: #FACA6B !important; }
.from-tenna-purple { --tw-gradient-from: #A78BFA !important; }
.to-tenna-purple { --tw-gradient-to: #A78BFA !important; }
.from-tenna-night { --tw-gradient-from: #0A1931 !important; }
.to-tenna-night { --tw-gradient-to: #0A1931 !important; }
.from-tenna-cream { --tw-gradient-from: #FFFBEB !important; }
.to-tenna-cream { --tw-gradient-to: #FFFBEB !important; }

/* Layout utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.text-center {
  text-align: center;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

/* Spacing */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-8 { margin-left: 2rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }

/* Typography */
.text-4xl { font-size: 2.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-xl { font-size: 1.25rem; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Colors */
.text-white { color: white; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-600 { color: #4b5563; }
.text-tenna-purple { color: #8B5FBF; }
.text-tenna-gold { color: #FACA6B; }
.text-tenna-teal { color: #40E0D0; }
.text-yellow-200 { color: #fef08a; }
.text-green-300 { color: #86efac; }
.text-blue-500 { color: #3b82f6; }

.bg-tenna-night { background-color: #0F0F23; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-gray-600 { background-color: #4b5563; }

/* Backgrounds */
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-tenna-purple { --tw-gradient-from: #8B5FBF; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(139, 95, 191, 0)); }
.to-tenna-gold { --tw-gradient-to: #FACA6B; }
.from-purple-500 { --tw-gradient-from: #8b5cf6; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(139, 92, 246, 0)); }
.to-pink-500 { --tw-gradient-to: #ec4899; }

/* Borders */
.border { border-width: 1px; }
.border-white { border-color: white; }
.border-tenna-purple { border-color: #8B5FBF; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-xl { border-radius: 0.75rem; }

/* Layout */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.h-6 { height: 1.5rem; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }

/* Effects */
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Transitions */
.transition-all { transition: all 0.15s ease-in-out; }
.duration-300 { transition-duration: 300ms; }
.duration-1000 { transition-duration: 1000ms; }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }

/* Hover effects */
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Chat specific styles */
.chat-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 95, 191, 0.5) transparent;
}

.chat-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.chat-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.chat-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(139, 95, 191, 0.5);
  border-radius: 3px;
}

/* Animations */
@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: none; animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .md\:hidden { display: none; }
  .sm\:w-8 { width: 2rem; }
  .sm\:h-8 { height: 2rem; }
  .sm\:text-xs { font-size: 0.75rem; }
  .sm\:text-sm { font-size: 0.875rem; }
  .sm\:max-w-sm { max-width: 24rem; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
}

/* Custom button styles */
button {
  cursor: pointer;
  border: none;
  outline: none;
}

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Flex utilities */
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-60 { opacity: 0.6; }

/* Z-index */
.z-50 { z-index: 50; }

/* Top/Left/Right/Bottom */
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* Special gradients and effects */
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.border-white\/30 { border-color: rgba(255, 255, 255, 0.3); }
.bg-gray-800\/40 { background-color: rgba(31, 41, 55, 0.4); }
.bg-gray-600\/50 { background-color: rgba(75, 85, 99, 0.5); }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Min height */
.min-h-screen { min-height: 100vh; }

/* Animated starry background */
@keyframes move-twink-back {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -10000px 5000px;
    }
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #0A1931 url(https://www.transparenttextures.com/patterns/stardust.png) repeat top center;
    z-index: 0;
    /* Adjusted z-index */
}

.twinkling {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: transparent url(https://www.transparenttextures.com/patterns/twinkling.png) repeat top center;
    z-index: 1;
    /* Adjusted z-index */
    animation: move-twink-back 200s linear infinite;
}

/* Scroll-triggered animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Image fallback styles */
img {
    max-width: 100%;
    height: auto;
}

img[src=""],
img:not([src]) {
    display: none;
}

/* Prevent overflow for all content */
.image-fallback {
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure rounded containers don't overflow */
.rounded-full,
.rounded-2xl,
.rounded-3xl {
    overflow: hidden;
}

/* Responsive text sizing */
@media (max-width: 640px) {
    .image-fallback {
        padding: 1rem !important;
        font-size: 0.875rem;
    }
    
    .image-fallback .text-3xl {
        font-size: 2rem !important;
    }
    
    .image-fallback .text-sm {
        font-size: 0.75rem !important;
    }
}

/* Floating Tenna Animation */
.floating-animation {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(1deg);
    }

    50% {
        transform: translateY(0px) rotate(-1deg);
    }

    75% {
        transform: translateY(-5px) rotate(0.5deg);
    }
}

/* Scroll-responsive classes */
.scroll-wave {
    animation: wave 2s ease-in-out infinite;
}

.scroll-bounce {
    animation: bounce-gentle 1.5s ease-in-out infinite;
}

.scroll-glow {
    filter: drop-shadow(0 0 20px rgba(250, 202, 107, 0.8)) drop-shadow(0 0 40px rgba(167, 139, 250, 0.4));
}

@keyframes wave {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }

    50% {
        transform: translateY(-15px) rotate(5deg) scale(1.05);
    }
}

@keyframes bounce-gentle {

    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.1);
    }
}

/* Enhanced scroll animations */
.scroll-entrance {
    animation: scrollEntrance 1s ease-out;
}

.speech-bubble {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

@keyframes scrollEntrance {
    0% {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Countdown Animations */
.countdown-item {
    position: relative;
    overflow: hidden;
}

.countdown-item::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FACA6B, #A78BFA, #FACA6B);
    border-radius: 1rem;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.countdown-item:hover::before {
    opacity: 0.3;
}

.countdown-number {
    background: linear-gradient(45deg, #FACA6B, #A78BFA);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.countdown-item:hover .countdown-number {
    animation-duration: 0.5s;
}

.progress-bar {
    position: relative;
    background: linear-gradient(90deg, #FACA6B 0%, #A78BFA 100%);
    background-size: 200% 100%;
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 0 10px rgba(250, 202, 107, 0.5);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
    }
}

.floating-particle {
    animation: floatParticle 4s ease-in-out infinite;
}

@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-10px) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-15px) scale(0.9);
        opacity: 1;
    }
    75% {
        transform: translateY(-5px) scale(1.05);
        opacity: 0.7;
    }
}

/* Custom Scrollbar for Chat Window */
.chat-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(250, 202, 107, 0.6) rgba(255, 255, 255, 0.1);
}

.chat-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.chat-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.chat-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, rgba(250, 202, 107, 0.8), rgba(167, 139, 250, 0.6));
    border-radius: 10px;
    border: 1px solid rgba(250, 202, 107, 0.3);
    box-shadow: 0 0 10px rgba(250, 202, 107, 0.4);
}

.chat-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, rgba(250, 202, 107, 1), rgba(167, 139, 250, 0.8));
    box-shadow: 0 0 15px rgba(250, 202, 107, 0.6);
}

.chat-scrollbar::-webkit-scrollbar-thumb:active {
    background: linear-gradient(45deg, rgba(250, 202, 107, 1), rgba(167, 139, 250, 1));
    box-shadow: 0 0 20px rgba(250, 202, 107, 0.8);
}

/* Add subtle glow animation to scrollbar */
@keyframes scrollbar-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(250, 202, 107, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(250, 202, 107, 0.6);
    }
}

.chat-scrollbar::-webkit-scrollbar-thumb {
    animation: scrollbar-glow 3s ease-in-out infinite;
}

/* Remove underlines from all links */
a {
    text-decoration: none !important;
}

a:hover, a:focus, a:active, a:visited {
    text-decoration: none !important;
}

/* Fireworks Animation Styles */
.firework {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}

.firework-particles {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
}

.firework-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

@keyframes firework-launch {
    0% {
        transform: translateY(100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 0.8;
    }
}

@keyframes firework-explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes firework-particle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}



@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* LPC link specific styles - 더 구체적이고 강력한 스타일 */
a#lpc-link,
a#lpc-link:link,
a#lpc-link:visited,
a#lpc-link:active {
    text-decoration: none !important;
    color: #FACA6B !important;
    transition: color 0.3s ease !important;
    border: none !important;
    outline: none !important;
    border-bottom: none !important;
}

a#lpc-link:hover,
a#lpc-link:focus,
a#lpc-link.lpc-hover-active {
    color: #A78BFA !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

/* 추가 보완 CSS */
.lpc-hover-active {
    color: #A78BFA !important;
}

/* Responsive positioning */
@media (max-width: 768px) {
    #floating-tenna img {
        width: 14.4rem !important;
        height: 14.4rem !important;
    }

    #tenna-speech {
        font-size: 0.75rem;
        padding: 0.5rem;
        top: -3rem;
        right: 0;
        left: auto;
        transform: translateX(0);
        max-width: calc(100vw - 2rem);
        word-wrap: break-word;
        white-space: normal;
    }

    .chat-scrollbar::-webkit-scrollbar {
        width: 6px;
    }
}

@media (max-width: 480px) {
    #floating-tenna img {
        width: 10.8rem !important;
        height: 10.8rem !important;
    }

    #tenna-speech {
        font-size: 0.7rem;
        padding: 0.4rem;
        top: -2.5rem;
        right: 0;
        left: auto;
        max-width: calc(100vw - 1.5rem);
    }

    .chat-scrollbar::-webkit-scrollbar {
        width: 4px;
    }
}
