/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Textarea focus glow */
textarea:focus {
    outline: none;
}

/* Pulse dot animation */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass effect */
.glass {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Shimmer effect */
.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Smooth iframe transition */
iframe {
    transition: opacity 0.3s ease;
}

/* Template card hover */
.template-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.template-card:hover {
    transform: translateY(-4px);
}

/* Light mode overrides */
body.light {
    background: #f9fafb;
    color: #111827;
}
body.light #navbar {
    background: rgba(249, 250, 251, 0.8);
    border-bottom-color: #e5e7eb;
}
body.light .bg-gray-950\/80 {
    background: rgba(249, 250, 251, 0.8);
}
body.light .bg-gray-900 {
    background: #ffffff;
    border-color: #e5e7eb;
}
body.light .bg-gray-900\/50 {
    background: #f3f4f6;
}
body.light .text-gray-400 {
    color: #6b7280;
}
body.light .text-gray-500 {
    color: #6b7280;
}
body.light .text-gray-600 {
    color: #4b5563;
}
body.light .bg-gray-800 {
    background: #e5e7eb;
    color: #374151;
}
body.light .bg-gray-800:hover {
    background: #d1d5db;
}
body.light .bg-gray-950 {
    background: #f9fafb;
}
body.light .border-gray-800 {
    border-color: #e5e7eb;
}
body.light .border-gray-800\/50 {
    border-color: #e5e7eb;
}
body.light .border-gray-700 {
    border-color: #d1d5db;
}
body.light .border-gray-700\/50 {
    border-color: #d1d5db;
}
body.light .text-gray-100 {
    color: #111827;
}
body.light .text-gray-200 {
    color: #374151;
}
body.light .text-gray-300 {
    color: #4b5563;
}
body.light .placeholder-gray-500::placeholder {
    color: #9ca3af;
}
body.light .bg-gray-700 {
    background: #d1d5db;
}
body.light .from-indigo-600 {
    --tw-gradient-from: #4f46e5;
}
body.light #previewContainer {
    border-color: #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
body.light #codeContainer,
body.light #splitContainer textarea {
    background: #1e1e2e;
    color: #e2e8f0;
}
body.light footer {
    border-top-color: #e5e7eb;
    color: #6b7280;
}
body.light #toast > div {
    background: #ffffff;
    border-color: #e5e7eb;
}
body.light .hover\:bg-gray-800:hover {
    background: #e5e7eb;
}
body.light .hover\:bg-gray-700:hover {
    background: #d1d5db;
}

/* Light mode text colors fix */
body.light .bg-gray-900 .text-gray-100 {
    color: #111827;
}
body.light #codeEditor {
    background: #1a1a2e;
    color: #c9d1d9;
}
body.light #splitEditor {
    background: #1a1a2e;
    color: #c9d1d9;
}

/* Responsive fixes */
@media (max-width: 640px) {
    #splitContainer {
        grid-template-columns: 1fr;
    }
    #splitContainer > div:last-child {
        display: none;
    }
}

/* Selection colors */
::selection {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* Focus ring */
button:focus-visible, textarea:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Bounce for CTA */
@keyframes gentle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
#generateBtn:hover {
    animation: gentle-bounce 0.6s ease-in-out;
}