/* Glassmorphism Card Styles */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

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

/* Platform Button Active State */
.platform-btn.active,
.caption-type-btn.active {
    background: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

/* Upload Area Drag State */
#uploadArea.drag-over {
    border-color: #9333ea;
    background: rgba(147, 51, 234, 0.1);
}

/* Caption Output Styling */
#captionOutput {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* History and Favorites Items */
.history-item,
.favorite-item {
    transition: all 0.2s ease;
}

.history-item:hover,
.favorite-item:hover {
    transform: translateX(4px);
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .glass-card {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Focus Styles for Accessibility */
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid #9333ea;
    outline-offset: 2px;
}

/* Color Palette Display */
.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.95);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

/* RTL Support for Arabic */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .toast {
    right: auto;
    left: 20px;
}

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

[dir="rtl"] .toast {
    animation: slideInRTL 0.3s ease-out;
}
