/* ============================
   Seedance Studio - Design System
   ============================ */

/* CSS Variables */
[v-cloak] {
    display: none !important;
}

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #a855f7;
    --secondary-light: #c084fc;
    --accent: #06b6d4;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --dark-950: #020617;
    --dark-900: #0f172a;
    --dark-800: #1e293b;
    --dark-700: #334155;
    --dark-600: #475569;
    --dark-500: #64748b;

    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(148, 163, 184, 0.1);
    --glass-blur: 12px;
}

/* Custom Scrollbar for Dark Mode */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}

/* ============================
   Animations
   ============================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.15);
    }
}

@keyframes float {

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

    50% {
        transform: translateY(-6px);
    }
}

@keyframes typing-dot {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

    100% {
        background-position: 200% 0;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.45s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.25s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.3s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.3s ease-out forwards;
}

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

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Staggered animation delays for cards */
.stagger-1 {
    animation-delay: 0.05s;
}

.stagger-2 {
    animation-delay: 0.1s;
}

.stagger-3 {
    animation-delay: 0.15s;
}

.stagger-4 {
    animation-delay: 0.2s;
}

.stagger-5 {
    animation-delay: 0.25s;
}

/* ============================
   Toast Transitions
   ============================ */
.toast-enter-active,
.toast-leave-active {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-enter-from {
    opacity: 0;
    transform: translateX(40px) scale(0.9);
}

.toast-leave-to {
    opacity: 0;
    transform: translateX(40px) scale(0.9);
}

/* ============================
   Glass Effects
   ============================ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}

.glass-strong {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

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

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.15);
}

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

.typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: typing-dot 1.4s infinite ease-in-out;
}

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

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

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

/* ============================
   Gradient Text
   ============================ */
.gradient-text {
    background: linear-gradient(135deg, #818cf8, #a855f7, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-animated {
    background: linear-gradient(270deg, #818cf8, #a855f7, #06b6d4, #818cf8);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease-in-out infinite;
}

/* ============================
   Shimmer Loading Effect
   ============================ */
.shimmer {
    background: linear-gradient(90deg, transparent 25%, rgba(255, 255, 255, 0.05) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ============================
   Markdown Rendered Content
   ============================ */
.markdown-body {
    line-height: 1.7;
    color: #e2e8f0;
    word-break: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: #f1f5f9;
    font-weight: 700;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.markdown-body h1 {
    font-size: 1.4em;
}

.markdown-body h2 {
    font-size: 1.2em;
}

.markdown-body h3 {
    font-size: 1.05em;
}

.markdown-body p {
    margin-bottom: 0.6em;
}

.markdown-body strong {
    color: #fff;
    font-weight: 600;
}

.markdown-body em {
    color: #c4b5fd;
    font-style: italic;
}

.markdown-body code {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.markdown-body pre {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 0.8em 0;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.85em;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.5em;
    margin-bottom: 0.8em;
}

.markdown-body li {
    margin-bottom: 0.25em;
}

.markdown-body blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 14px;
    margin: 0.8em 0;
    color: #94a3b8;
    font-style: italic;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    margin: 1em 0;
}

/* ============================
   Drag & Drop Zone
   ============================ */
.drop-zone-active {
    border-color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.08) !important;
    box-shadow: inset 0 0 30px rgba(99, 102, 241, 0.05);
}

/* ============================
   Button Gradient
   ============================ */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gradient:hover {
    filter: brightness(1.15);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-gradient:active {
    transform: scale(0.97);
}

/* ============================
   Line Clamp Utilities
   ============================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================
   Badge Glow
   ============================ */
.badge-glow {
    position: relative;
}

.badge-glow::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(6px);
}

.badge-glow:hover::after {
    opacity: 0.5;
}

/* ============================
   Video Card Overlay
   ============================ */
.video-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
}

/* ============================
   Focus Styles
   ============================ */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ============================
   Selection color
   ============================ */
::selection {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* ============================
   Autofill Overrides for Dark Mode
   ============================ */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ============================
   Chat Message Text Overflow Fix
   ============================ */
#chat-messages {
    overflow-x: hidden;
}

#chat-messages .rounded-2xl {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

#chat-messages .rounded-2xl div {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Ensure the flex container for messages doesn't overflow */
#chat-messages>div {
    max-width: 100%;
    overflow: hidden;
}

/* Fix markdown content within chat not wrapping */
#chat-messages pre {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    max-width: 100%;
}