/* AI Web Builder Studio - Custom Styles */
:root {
    --accent: #7c3aed;
    --accent-light: #a78bfa;
}

* { font-family: 'Inter', system-ui, sans-serif; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(124, 58, 237, 0.2); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideUp 0.4s ease-out; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* Onboarding entrance animation */
.onboarding-enter {
    animation: onboardingEnter 0.5s ease-out;
}
@keyframes onboardingEnter {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Status Badges */
.badge-draft { background: #374151; color: #9ca3af; }
.badge-analyzing, .badge-designing, .badge-writing, .badge-building {
    background: linear-gradient(90deg, #92400e, #d97706, #92400e);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    color: #fef3c7;
}
.badge-completed { background: #065f46; color: #6ee7b7; }
.badge-error { background: #7f1d1d; color: #fca5a5; }

/* Cards */
.project-card {
    transition: all 0.2s ease;
    border: 1px solid rgba(75, 85, 99, 0.3);
}
.project-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    transition: all 0.2s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #6d28d9, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-ghost {
    transition: all 0.2s ease;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Progress Steps */
.step-item {
    transition: all 0.3s ease;
}
.step-item.active .step-icon {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    animation: pulse-glow 2s ease-in-out infinite;
}
.step-item.completed .step-icon {
    background: #059669;
}
.step-item.pending .step-icon {
    background: #374151;
}
.step-connector {
    transition: background 0.5s ease;
}

/* Preview Frame */
.preview-frame {
    transition: width 0.3s ease, max-width 0.3s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Textarea */
textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111827; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* Hosting Badges */
.hosting-badge-online {
    background: #065f46;
    color: #6ee7b7;
}
.hosting-badge-deploying {
    background: linear-gradient(90deg, #92400e, #d97706, #92400e);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    color: #fef3c7;
}

/* Domain Badges */
.domain-badge-pending {
    background: #92400e;
    color: #fef3c7;
}
.domain-badge-active {
    background: #065f46;
    color: #6ee7b7;
}
.domain-badge-error {
    background: #7f1d1d;
    color: #fca5a5;
}

/* Domain Modal */
.domain-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.domain-modal-overlay.hidden {
    display: none;
}

/* Domain Search Results */
.domain-result {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.domain-result:hover {
    border-color: rgba(124, 58, 237, 0.3);
}
.domain-avail-badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}
.domain-avail-yes {
    background: #065f46;
    color: #6ee7b7;
}
.domain-avail-no {
    background: #374151;
    color: #9ca3af;
}

/* Purchase Steps */
.purchase-step {
    transition: all 0.3s ease;
}
.purchase-step-icon {
    transition: all 0.3s ease;
}

/* Domain Status Panel */
#domain-status-panel {
    animation: fadeIn 0.3s ease-out;
}

/* Empty state */
.empty-state {
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
}

/* Sidebar */
.sidebar-link.active,
.sidebar-link[class*="bg-violet-600"] {
    position: relative;
}

/* Site cards clickable */
.project-card.cursor-pointer:hover {
    border-color: rgba(124, 58, 237, 0.4);
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
    background: #1f2937;
    color: #f3f4f6;
    font-size: 0.875rem;
    min-width: 280px;
    max-width: 420px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s ease-out;
}
.toast.toast-removing {
    animation: toastOut 0.3s ease-in forwards;
}
.toast-success { border-left: 3px solid #10b981; }
.toast-error { border-left: 3px solid #ef4444; }
.toast-info { border-left: 3px solid #3b82f6; }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}
.toast-success .toast-icon { color: #10b981; }
.toast-error .toast-icon { color: #ef4444; }
.toast-info .toast-icon { color: #3b82f6; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-msg { flex: 1; }
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    font-size: 1.125rem;
}
.toast-close:hover { color: #d1d5db; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* Media Manager */
.media-thumb:hover .media-delete-btn { opacity: 1 !important; }
.media-thumb:hover { background: #111827 !important; }
.media-thumb.selected { border-color: #7c3aed !important; }

/* Confirm Modal */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease-out;
}
.confirm-box {
    background: #1f2937;
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}
.confirm-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 0.5rem;
}
.confirm-message {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
.confirm-cancel {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: #374151;
    color: #d1d5db;
    border: 1px solid rgba(75, 85, 99, 0.5);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}
.confirm-cancel:hover { background: #4b5563; }
.confirm-ok {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.confirm-ok:hover {
    background: linear-gradient(135deg, #6d28d9, #4f46e5);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* US-001: Dashboard Hero with Aurora Gradient */
.dashboard-hero {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    background: #030712;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 30% 20%, rgba(124, 58, 237, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 70% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 50% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

/* US-002: Dashboard Tab Bar */
.dashboard-tab-bar {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-tab {
    cursor: pointer;
    white-space: nowrap;
}

/* Dashboard Prompt Bar focus glow */
.dashboard-hero .bg-\\[\\#1a1a2e\\]\\/90:focus-within {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.25), 0 0 60px rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.4);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* US-004: CTA Pulse Animation */
@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
.cta-pulse {
    animation: pulse-scale 3s ease-in-out infinite;
}

/* US-004: Chip Stagger Animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chip-stagger {
    animation: fadeInUp 0.4s ease-out backwards;
}
.chip-stagger:nth-child(1) { animation-delay: 0.1s; }
.chip-stagger:nth-child(2) { animation-delay: 0.2s; }
.chip-stagger:nth-child(3) { animation-delay: 0.3s; }
.chip-stagger:nth-child(4) { animation-delay: 0.4s; }

/* US-004: Aurora Shift Animation for Hero Gradient */
@keyframes aurora-shift {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
    33% { background-position: 5% 5%, -5% 3%, 5% -3%, -3% 5%; }
    66% { background-position: -3% -3%, 5% -5%, -5% 5%, 5% -3%; }
    100% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
}
.dashboard-hero {
    background-size: 120% 120%, 120% 120%, 120% 120%, 120% 120%;
    animation: aurora-shift 10s ease-in-out infinite;
}

/* US-004: Tab Fade-in Animation */
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.tab-fade-in {
    animation: tabFadeIn 0.2s ease-out;
}

/* US-004: Card Stagger Animation */
.card-stagger {
    animation: fadeInUp 0.4s ease-out backwards;
}
.card-stagger:nth-child(1) { animation-delay: 0.05s; }
.card-stagger:nth-child(2) { animation-delay: 0.1s; }
.card-stagger:nth-child(3) { animation-delay: 0.15s; }
.card-stagger:nth-child(4) { animation-delay: 0.2s; }
.card-stagger:nth-child(5) { animation-delay: 0.25s; }
.card-stagger:nth-child(6) { animation-delay: 0.3s; }

/* User Dropdown Menu */
#user-dropdown-menu {
    z-index: 9999;
}

#user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#user-dropdown-chevron.rotate {
    transform: rotate(180deg);
}

/* Close dropdown when clicking outside */
.dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
}

/* US-004: Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .cta-pulse,
    .chip-stagger,
    .dashboard-hero,
    .tab-fade-in,
    .card-stagger,
    .animate-fade-in,
    .animate-slide-up,
    .animate-pulse-glow,
    .onboarding-enter {
        animation: none !important;
    }
}
