:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #06d6a0;
    --accent: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --error: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.neon-glow {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.thumbnail-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.9), rgba(6, 214, 160, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail-container:hover .thumbnail-overlay {
    opacity: 1;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.3s;
}

.thumbnail-loading {
    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; }
}

.creator-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.creator-tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.creator-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.creator-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 8px solid transparent;
    border-top-color: white;
}

/* Portfolio button hover effects */
.portfolio-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    transition: all 0.3s ease;
}

.portfolio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
}

/* Social link hover animations */
.social-link {
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Prevent body scroll when tooltip is open on mobile */
body.tooltip-open {
    overflow: hidden;
}

/* Top Marquee - Always on top */
.top-marquee {
    position: relative;
    z-index: 1001;
}

/* Sticky Header - Only shows after scroll */
.sticky-header {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    z-index: 50;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(to right, rgba(124, 58, 237, 0.98), rgba(236, 72, 153, 0.98));
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sticky-header.is-visible {
    top: 0;
}

/* Add padding to body when sticky header is visible to prevent content jump */
body.sticky-header-active {
    padding-top: 80px;
}

@media (max-width: 640px) {
    body.sticky-header-active {
        padding-top: 100px; /* More space for mobile two-line layout */
    }
    
    .sticky-header {
        top: -120px;
    }
}

.sticky-header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 0;
}

.sticky-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.sticky-header-bottom {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (min-width: 640px) {
    .sticky-header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 8px 0;
    }
    
    .sticky-header-top {
        justify-content: flex-start;
    }
    
    .sticky-header-bottom {
        justify-content: flex-end;
    }
}

.main-header {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
}

.main-header.is-compact {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* Compact stats */
.compact-stats {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

/* Text truncate */
.truncate-2-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* History panel styles */
.history-panel {
    transition: all 0.3s ease;
}

.history-item {
    border-left: 4px solid #8b5cf6;
    transition: all 0.2s ease;
}

.history-item:hover {
    transform: translateX(4px);
    border-left-color: #06d6a0;
}

/* Mobile-specific improvements */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Header adjustments */
    .main-header h1 {
        font-size: 2rem !important;
    }

    .main-header p {
        font-size: 1rem !important;
    }

    /* Stats badges */
    .glass-effect {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem;
    }

    /* Format selection horizontal on mobile */
    .format-container {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.75rem !important;
    }

    .format-option {
        flex: 1;
    }

    .format-label {
        padding: 1rem !important;
        min-height: 120px;
    }

    .format-label .text-3xl {
        font-size: 1.5rem !important;
    }

    /* Buttons */
    button, .btn {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem;
    }

    /* History items - fixed button heights */
    .history-item {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .history-item-content {
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .history-item-buttons {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .history-item-buttons button,
    .history-item-buttons a {
        flex: 1;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Success result grid */
    .success-result-grid {
        grid-template-columns: 1fr !important;
    }

    .creator-badge {
        bottom: 15px;
        right: 15px;
    }
    
    .creator-tooltip {
        width: 280px !important;
        right: 0;
        bottom: 100%;
        margin-bottom: 15px;
    }
    
    .creator-tooltip::after {
        right: 20px;
    }
    
    #creatorBtn {
        width: 3.5rem;
        height: 3.5rem;
    }

    /* Thumbnail preview */
    .thumbnail-preview-mobile {
        max-height: 200px;
    }

    /* Marquee text */
    marquee {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 1.75rem !important;
    }

    .format-option {
        width: 100%;
    }

    .compact-stats {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Aspect ratio fix for thumbnails */
.aspect-video {
    aspect-ratio: 16 / 9;
}

/* Improve button responsiveness */
.btn-responsive {
    width: 100%;
}

@media (min-width: 640px) {
    .btn-responsive {
        width: auto;
    }
}
/* Notification animations */
@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification-enter {
    animation: slideInRight 0.3s ease-out;
}

/* History section improvements */
#historyList::-webkit-scrollbar {
    width: 8px;
}

#historyList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#historyList::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 10px;
}

#historyList::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}

/* Download button hover effect */
#downloadBtn:hover {
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

/* Format selection active state */
.format-label:has(input:checked) {
    border-width: 3px;
    transform: scale(1.02);
}

/* Success result animation */
#successResult {
    animation: slideIn 0.5s ease-out;
}

/* Loading step animations */
.loading-step {
    transition: all 0.3s ease;
}

/* Responsive thumbnail sizing */
@media (max-width: 640px) {
    .thumbnail-preview-mobile {
        max-height: 180px;
    }
}

/* History item hover effect */
#historyList > div:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}
