/* LUNA - Custom Styles */

/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* Root Variables */
:root {
    --luna-indigo: #2D3E50;
    --luna-purple: #5B4B8A;
    --luna-blue: #4A90E2;
    --luna-light: #E8EAF6;
    --luna-moonlight: #F5F7FA;
}

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

body {
    font-family: 'Inter', 'Noto Sans KR', 'Noto Sans JP', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(75, 144, 226, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(75, 144, 226, 0.6);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

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

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

/* Character Animation Styles */
.character-face {
    transition: all 0.3s ease;
}

.character-face[data-emotion="apology"] #mouth {
    d: path("M 30 60 Q 50 55 70 60");
}

.character-face[data-emotion="apology"] #sweatDrop {
    display: block;
    animation: fade-in 0.5s ease;
}

.character-face[data-emotion="confusion"] #leftEye,
.character-face[data-emotion="confusion"] #rightEye {
    animation: blink 2s infinite;
}

.character-face[data-emotion="confusion"] #mouth {
    d: path("M 35 60 L 40 65 L 45 60 L 50 65 L 55 60 L 60 65 L 65 60");
}

.character-face[data-emotion="empathy"] #mouth {
    d: path("M 30 65 Q 50 70 70 65");
}

.character-face[data-emotion="empathy"] #leftBrow {
    d: path("M 28 38 Q 35 35 42 38");
}

.character-face[data-emotion="empathy"] #rightBrow {
    d: path("M 58 38 Q 65 35 72 38");
}

.character-face[data-emotion="neutral"] #mouth {
    d: path("M 30 60 L 70 60");
}

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

/* Button Styles */
button {
    cursor: pointer;
    user-select: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Input Focus Styles */
input:focus,
textarea:focus {
    outline: none;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--luna-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--luna-purple);
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    p {
        font-size: 1rem !important;
    }
}

/* Mobile Touch Optimization */
@media (max-width: 768px) {
    button,
    a {
        min-height: 48px;
        min-width: 48px;
    }
    
    input,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* Loading Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Prose Styles for AI Responses */
.prose {
    line-height: 1.75;
}

.prose p {
    margin-bottom: 1rem;
}

.prose strong {
    font-weight: 600;
    color: var(--luna-indigo);
}

.prose em {
    font-style: italic;
    color: var(--luna-purple);
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--luna-indigo), var(--luna-purple), var(--luna-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Mood Button Selected State */
.mood-btn.selected {
    border-color: var(--luna-purple);
    background-color: rgba(91, 75, 138, 0.1);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid var(--luna-blue);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Animation delays for staggered effects */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

/* Character expression transitions */
.character-transition {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--luna-blue);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}
