/* Custom CSS for TikSaver */

/* CSS Variables for theming */
:root {
    --tiktok-primary: #f5bf3f;
    --tiktok-secondary: #f7cd68;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

.dark {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --border-color: #16213e;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--tiktok-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tiktok-secondary);
}

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

/* Body styling */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animation keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-30px);
    }
    70% {
        transform: translateY(-15px);
    }
    90% {
        transform: translateY(-4px);
    }
}

/* Custom utility classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-bounce-slow {
    animation: bounce 2s infinite;
}

/* Header improvements */
.header-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Button enhancements */
.btn-primary {
    @apply bg-tiktok hover:bg-tiktok-dark text-white font-semibold py-3 px-6 rounded-xl transition-all duration-200 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-tiktok focus:ring-opacity-50;
}

.btn-secondary {
    @apply bg-gray-700 hover:bg-gray-800 text-white font-semibold py-3 px-6 rounded-xl transition-all duration-200 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-opacity-50;
}

/* Input field enhancements */
.input-primary {
    @apply w-full px-4 py-3 text-lg border border-gray-300 dark:border-dark-border rounded-xl focus:ring-2 focus:ring-tiktok focus:border-transparent bg-gray-50 dark:bg-dark-bg text-gray-900 dark:text-white transition-all duration-200;
}

.input-primary:focus {
    box-shadow: 0 0 0 3px rgba(255, 0, 80, 0.1);
}

/* Card enhancements */
.card {
    @apply bg-white dark:bg-dark-card rounded-xl shadow-lg border border-gray-200 dark:border-dark-border transition-all duration-300;
}

.card:hover {
    @apply shadow-xl;
    transform: translateY(-2px);
}

/* Feature cards specific styling */
.feature-card {
    @apply card p-6;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.feature-card:hover {
    @apply shadow-2xl;
    transform: translateY(-4px);
}

/* Progress bar styling */
.progress-container {
    @apply relative overflow-hidden bg-gray-200 dark:bg-dark-bg rounded-full h-2;
}

.progress-bar {
    @apply h-full rounded-full transition-all duration-300 ease-out;
    background: linear-gradient(90deg, var(--tiktok-primary), var(--tiktok-secondary));
}

.progress-bar.animate {
    background: linear-gradient(90deg, var(--tiktok-primary), var(--tiktok-secondary), var(--tiktok-primary));
    background-size: 200% 100%;
    animation: progress-shimmer 2s infinite;
}

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

/* Loading spinner */
.spinner {
    @apply inline-block w-4 h-4 border-2 border-white border-t-transparent rounded-full;
    animation: spin 1s linear infinite;
}

/* FAQ accordion styling */
.faq-button:hover {
    @apply bg-gray-50 dark:bg-dark-border;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-content.show {
    max-height: 200px;
    transition: max-height 0.3s ease-in, padding 0.3s ease-in;
}

/* Language dropdown styling */
#language-dropdown {
    @apply absolute right-0 mt-2 w-48 rounded-md shadow-lg z-50 border;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Mobile menu styling */
#mobile-menu {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hero section enhancements */
.hero-gradient {
    background: linear-gradient(135deg, rgba(255, 0, 80, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Download form styling */
.download-form {
    @apply bg-white dark:bg-dark-card rounded-2xl shadow-xl p-6 md:p-8 border border-gray-200 dark:border-dark-border;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Quality options styling */
.quality-option {
    @apply flex items-center space-x-2 p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-dark-border transition-colors;
}

.quality-option input[type="radio"]:checked + span,
.quality-option input[type="checkbox"]:checked + span {
    @apply text-tiktok font-medium;
}

/* Footer enhancements */
footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

/* Responsive design improvements */
@media (max-width: 640px) {
    .hero-title {
        @apply text-3xl;
    }
    
    .hero-subtitle {
        @apply text-lg;
    }
    
    .download-form {
        @apply p-4;
    }
    
    .btn-primary, .btn-secondary {
        @apply text-sm py-2 px-4;
    }
}

@media (max-width: 768px) {
    .container {
        @apply px-4;
    }
    
    .grid-cols-1.md\\:grid-cols-3 {
        @apply gap-6;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        @apply border-2;
    }
    
    .btn-primary, .btn-secondary {
        @apply border-2 border-black dark:border-white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus improvements for accessibility */
button:focus, 
input:focus, 
a:focus {
    @apply outline-none ring-2 ring-tiktok ring-opacity-50;
}

/* Custom checkbox and radio styling */
input[type="checkbox"], 
input[type="radio"] {
    @apply accent-tiktok;
}

/* Tooltip styling */
.tooltip {
    @apply absolute z-50 px-2 py-1 text-xs bg-gray-900 text-white rounded shadow-lg opacity-0 transition-opacity duration-200 pointer-events-none;
}

.tooltip.show {
    @apply opacity-100;
}

/* Success/Error message styling */
.message {
    @apply fixed top-4 right-4 p-4 rounded-lg shadow-lg z-50 max-w-md;
    animation: slideIn 0.3s ease-out;
}

.message.success {
    @apply bg-green-500 text-white;
}

.message.error {
    @apply bg-red-500 text-white;
}

.message.warning {
    @apply bg-yellow-500 text-black;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Video preview styling */
.video-preview {
    @apply relative rounded-lg overflow-hidden shadow-lg bg-black;
    aspect-ratio: 9/16;
    max-width: 300px;
}

.video-preview video {
    @apply w-full h-full object-cover;
}

.video-preview .overlay {
    @apply absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 hover:opacity-100 transition-opacity duration-200;
}

/* Download button states */
.download-btn {
    @apply relative overflow-hidden;
}

.download-btn.loading {
    @apply cursor-not-allowed opacity-75;
}

.download-btn.loading::after {
    content: '';
    @apply absolute inset-0 bg-gradient-to-r from-transparent via-white to-transparent opacity-20;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        @apply text-black bg-white;
    }
    
    .card {
        @apply border border-gray-300;
    }
}