/* Enhanced animations and styles for AI-powered features */

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

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

@keyframes celebration {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.3) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

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

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

/* Custom scrollbar for the entire application */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #374151 0%, #1F2937 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6B7280 0%, #4B5563 100%);
    border-radius: 10px;
    border: 2px solid #374151;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9CA3AF 0%, #6B7280 100%);
}

/* Enhanced glassmorphism effects */
.glassmorphism {
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Code syntax highlighting improvements */
code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.6;
    font-size: 13px;
}

/* Enhanced transitions for all interactive elements */
button, input, select, textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Advanced focus states with accessibility */
input:focus, textarea:focus, select:focus {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.1),
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Enhanced hover effects for requirements */
.requirement-item {
    position: relative;
    transition: all 0.3s ease;
}

.requirement-item:hover {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.6) 0%, rgba(75, 85, 99, 0.4) 100%);
    transform: translateX(5px);
    border-left: 3px solid #3B82F6;
}

.requirement-item:hover .group-hover\:opacity-100 {
    opacity: 1;
}

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

.loading-shimmer {
    background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* AI Assistant enhanced styling */
.ai-assistant {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-assistant:hover {
    transform: scale(1.15) !important;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.3),
        0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Enhanced button styling */
button:not(:disabled) {
    position: relative;
    overflow: hidden;
}

button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.3),
        0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

button:not(:disabled):active {
    transform: translateY(-1px);
}

/* Gradient button enhancements */
button[class*="gradient"] {
    position: relative;
}

button[class*="gradient"]:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

button[class*="gradient"]:hover:before {
    left: 100%;
}

/* Checkbox styling enhancements */
input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #6B7280;
    border-radius: 4px;
    background: transparent;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-color: #10B981;
    transform: scale(1.1);
}

input[type="checkbox"]:checked:after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Panel border enhancements with gradients */
.border-gray-700 {
    border-color: #3F3F46;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.border-gray-600 {
    border-color: #52525B;
}

/* Code block improvements */
pre {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    border: 1px solid #374151;
    border-radius: 12px;
    position: relative;
}

pre:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
}

/* Iframe styling */
iframe {
    border-radius: 8px;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Example prompt animations */
.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Custom requirement styling */
.custom-requirement {
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.3) 0%, rgba(91, 33, 182, 0.2) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
}

.custom-requirement:hover {
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.5) 0%, rgba(91, 33, 182, 0.3) 100%);
    border-color: rgba(124, 58, 237, 0.5);
    transform: scale(1.02);
}

/* Success and error states */
.success-glow {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    animation: glow 2s ease-in-out infinite alternate;
}

.error-glow {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    animation: glow 2s ease-in-out infinite alternate;
}

/* Category badges */
.category-badge {
    transition: all 0.2s ease;
}

.category-badge:hover {
    transform: scale(1.1);
}

/* Responsive improvements */
@media (max-width: 1024px) {
    .lg\:flex-row {
        flex-direction: column;
    }
    
    .lg\:w-2\/5, .lg\:w-3\/5 {
        width: 100%;
    }
    
    .lg\:w-2\/5 {
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .ai-assistant {
        bottom: 20px;
        right: 20px;
        transform: scale(0.9);
    }
}

@media (max-width: 768px) {
    .ai-assistant {
        bottom: 15px;
        right: 15px;
        transform: scale(0.8);
    }
    
    button {
        min-height: 44px; /* Touch-friendly */
    }
    
    input, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Enhanced input styling */
input[type="text"], input[type="url"], input[type="password"], textarea, select {
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
    border: 1px solid #6B7280;
    color: #F9FAFB;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="url"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
    background: linear-gradient(135deg, #374151 0%, #4B5563 100%);
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Float animation for floating elements */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Backdrop blur support */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-md {
        backdrop-filter: blur(12px);
    }
    
    .backdrop-blur-sm {
        backdrop-filter: blur(4px);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-800 {
        background-color: #000000;
    }
    
    .text-gray-400 {
        color: #FFFFFF;
    }
    
    .border-gray-700 {
        border-color: #FFFFFF;
    }
}

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

/* Dark mode specific enhancements */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* Print styles */
@media print {
    .ai-assistant,
    button {
        display: none;
    }
    
    .bg-gray-900,
    .bg-gray-800 {
        background: white;
        color: black;
    }
}