/* VideoCnv Modern Theme - Custom Styles */
/* Based on new design mocks with dark theme */

/* ========================================
   CSS Custom Properties (Color Palette)
   ======================================== */
:root {
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --brand-50: #f0f9ff;
    --brand-100: #e0f2fe;
    --brand-300: #7dd3fc;
    --brand-400: #38bdf8;
    --brand-500: #0ea5e9;
    --brand-600: #0284c7;
    --brand-700: #0369a1;
    --brand-900: #0c4a6e;
    --accent-400: #a78bfa;
    --accent-500: #8b5cf6;
    --accent-600: #7c3aed;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --red-500: #ef4444;
}

/* ========================================
   Bootstrap Icons Sizing
   ======================================== */
.bi {
    vertical-align: -0.125em;
}

.bi-xs {
    font-size: 0.75rem;
}

.bi-sm {
    font-size: 0.875rem;
}

.bi-md {
    font-size: 1rem;
}

.bi-lg {
    font-size: 1.25rem;
}

.bi-xl {
    font-size: 1.5rem;
}

.bi-2xl {
    font-size: 1.75rem;
}

.bi-3xl {
    font-size: 2rem;
}

.bi-4xl {
    font-size: 2.5rem;
}

/* ========================================
   Base Styles
   ======================================== */
body {
    background-color: var(--slate-900) !important;
    color: #f8fafc !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

::selection {
    background-color: var(--brand-500);
    color: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--slate-900);
}

::-webkit-scrollbar-thumb {
    background: var(--slate-700);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-600);
}

/* ========================================
   Glassmorphism Utilities
   ======================================== */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-nav {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========================================
   Gradient Utilities
   ======================================== */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(to right, #38bdf8, #818cf8, #c084fc);
}

.bg-gradient-brand {
    background: linear-gradient(to right, var(--brand-600), var(--accent-600));
}

.bg-gradient-brand-hover:hover {
    background: linear-gradient(to right, var(--brand-500), var(--accent-500));
}

/* ========================================
   Animations
   ======================================== */
@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading-stripes {
    from {
        background-position: 1rem 0;
    }

    to {
        background-position: 0 0;
    }
}

@keyframes ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-stripes {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: loading-stripes 1s linear infinite;
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* ========================================
   Layout Components
   ======================================== */

/* Background decoration blobs */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(128px);
    opacity: 0.2;
    pointer-events: none;
}

.bg-blob-brand {
    background-color: var(--brand-500);
}

.bg-blob-accent {
    background-color: var(--accent-500);
}

/* Grid pattern overlay */
.bg-grid-pattern {
    background-image: linear-gradient(to right, #80808012 1px, transparent 1px),
        linear-gradient(to bottom, #80808012 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ========================================
   Navigation
   ======================================== */
.navbar-modern {
    position: fixed;
    width: 100%;
    z-index: 50;
    transition: all 0.3s ease;
}

.navbar-modern .nav-link {
    color: var(--slate-300);
    transition: color 0.2s ease;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.navbar-modern .nav-link:hover {
    color: white;
}

.navbar-modern .nav-link.active {
    color: white;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    background: linear-gradient(to bottom right, var(--brand-500), var(--accent-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.logo-icon:hover {
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.5);
}

/* ========================================
   Buttons
   ======================================== */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary-gradient {
    background: linear-gradient(to right, var(--brand-600), var(--accent-600));
    color: white;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.2);
}

.btn-primary-gradient:hover {
    background: linear-gradient(to right, var(--brand-500), var(--accent-500));
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.4);
    transform: translateY(-2px);
    color: white;
}

.btn-success-modern {
    background-color: var(--green-600);
    color: white;
}

.btn-success-modern:hover {
    background-color: var(--green-500);
    transform: translateY(-2px);
    color: white;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--slate-300);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ========================================
   Form Controls
   ======================================== */
.input-modern {
    background-color: var(--slate-800);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-modern::placeholder {
    color: var(--slate-500);
}

.input-modern:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.select-modern {
    background-color: var(--slate-900);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 0.75rem;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

.select-modern:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--slate-700);
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.toggle-switch.active {
    background-color: var(--brand-500);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* ========================================
   Cards
   ======================================== */
.card-modern {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.card-modern:hover {
    border-color: rgba(14, 165, 233, 0.3);
    background: var(--slate-800);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.card-modern:hover .card-icon {
    transform: scale(1.1);
}

/* ========================================
   Video Preview Card
   ======================================== */
.video-preview {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: black;
}

.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.video-preview:hover img {
    opacity: 1;
}

.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-play-button {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.video-preview:hover .video-play-button {
    transform: scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.25rem;
}

/* ========================================
   Progress Bar
   ======================================== */
.progress-modern {
    width: 100%;
    height: 10px;
    background-color: var(--slate-700);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-modern {
    height: 100%;
    background: linear-gradient(to right, var(--brand-500), var(--accent-500));
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* ========================================
   Tabs
   ======================================== */
.tabs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.25rem;
    background-color: var(--slate-900);
    border-radius: 0.75rem;
}

.tab-btn {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--slate-400);
    background: transparent;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(to right, var(--brand-600), var(--brand-500));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tab-btn.active-accent {
    background: linear-gradient(to right, var(--accent-600), var(--accent-500));
}

/* ========================================
   FAQ Accordion
   ======================================== */
.faq-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item[open] {
    background: var(--slate-800);
    border-color: rgba(14, 165, 233, 0.3);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: white;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item .faq-content {
    padding: 0 1.5rem 1.5rem;
    color: var(--slate-400);
    line-height: 1.6;
}

.faq-icon {
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-icon {
    transform: rotate(180deg);
}

/* ========================================
   Footer
   ======================================== */
.footer-modern {
    background-color: var(--slate-900);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4rem 0 2rem;
}

.footer-modern a {
    color: var(--slate-400);
    transition: color 0.2s ease;
    text-decoration: none;
}

.footer-modern a:hover {
    color: var(--brand-400);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-brand-400 {
    color: var(--brand-400);
}

.text-brand-500 {
    color: var(--brand-500);
}

.text-accent-400 {
    color: var(--accent-400);
}

.text-slate-400 {
    color: var(--slate-400);
}

.text-slate-500 {
    color: var(--slate-500);
}

.text-green-500 {
    color: var(--green-500);
}

.bg-slate-800 {
    background-color: var(--slate-800);
}

.bg-slate-900 {
    background-color: var(--slate-900);
}

.bg-brand-500\/10 {
    background-color: rgba(14, 165, 233, 0.1);
}

.bg-accent-500\/10 {
    background-color: rgba(139, 92, 246, 0.1);
}

.bg-green-500\/10 {
    background-color: rgba(34, 197, 94, 0.1);
}

.border-white\/5 {
    border-color: rgba(255, 255, 255, 0.05);
}

.border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1);
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* Glow effect for main input */
.input-glow-wrapper {
    position: relative;
}

.input-glow-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(to right, var(--brand-500), var(--accent-600));
    border-radius: 1rem;
    filter: blur(8px);
    opacity: 0.25;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.input-glow-wrapper:hover::before,
.input-glow-wrapper:focus-within::before {
    opacity: 0.5;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-dot {
    position: relative;
    width: 8px;
    height: 8px;
}

.status-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--brand-400);
    border-radius: 50%;
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--brand-500);
    border-radius: 50%;
}

/* Hide default Blazor elements */
#blazor-error-ui {
    background: var(--slate-800);
    border-top: 2px solid var(--red-500);
}

/* Loading spinner for Blazor */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--brand-500);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--slate-700);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: var(--slate-300);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}