/* Modern shadcn/ui inspired styling */
* {
    box-sizing: border-box;
}

/* Clerk Authentication Styles */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}



/* Clerk component styling - Modern Design */
.auth-container [data-clerk-sign-in],
.auth-container [data-clerk-sign-up] {
    width: 100%;
}

/* Clerk Form Container */
.auth-container .clerk-form {
    width: 100%;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* Clerk Input Fields */
.auth-container .clerk-form input,
.auth-container .clerk-form input[type="email"],
.auth-container .clerk-form input[type="password"],
.auth-container .clerk-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    background: #ffffff;
    color: #1f2937;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.auth-container .clerk-form input:focus {
    outline: none;
    border-color: #222;
    box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.1);
}

.auth-container .clerk-form input::placeholder {
    color: #9ca3af;
}

/* Clerk Buttons */
.auth-container .clerk-form button,
.auth-container .clerk-form button[type="submit"] {
    width: 100%;
    padding: 12px 16px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.auth-container .clerk-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.auth-container .clerk-form button:active {
    transform: translateY(0);
}

/* Clerk Secondary Buttons (like "Sign in instead") */
.auth-container .clerk-form button[data-variant="secondary"] {
    background: transparent;
    color: #222;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.auth-container .clerk-form button[data-variant="secondary"]:hover {
    background: #f9fafb;
    border-color: #222;
    transform: none;
}

/* Clerk Form Labels */
.auth-container .clerk-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Clerk Form Groups */
.auth-container .clerk-form .form-group {
    margin-bottom: 20px;
}

/* Clerk Error Messages */
.auth-container .clerk-form .error-message,
.auth-container .clerk-form [data-clerk-error] {
    color: #dc2626;
    font-size: 12px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* Clerk Success Messages */
.auth-container .clerk-form .success-message {
    color: #059669;
    font-size: 12px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
}

/* Clerk Divider */
.auth-container .clerk-form .divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #6b7280;
    font-size: 12px;
}

.auth-container .clerk-form .divider::before,
.auth-container .clerk-form .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-container .clerk-form .divider::before {
    margin-right: 12px;
}

.auth-container .clerk-form .divider::after {
    margin-left: 12px;
}

/* Clerk Social Buttons */
.auth-container .clerk-form .social-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.auth-container .clerk-form .social-button {
    flex: 1;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-container .clerk-form .social-button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

/* Clerk Loading States */
.auth-container .clerk-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Clerk Form Validation */
.auth-container .clerk-form input:invalid {
    border-color: #dc2626;
}

.auth-container .clerk-form input:valid {
    border-color: #10b981;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-container .clerk-form input,
    .auth-container .clerk-form button {
        padding: 10px 14px;
        font-size: 16px; /* Better for mobile */
    }
}

/* Additional Clerk Component Styling */
/* Target Clerk's actual component classes */
.auth-container [class*="clerk-"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Override any Clerk positioning that might interfere with centering */
.auth-container [class*="clerk-"] {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* Ensure Clerk components are centered within their containers */
.auth-container [class*="clerk-formField"],
.auth-container [class*="clerk-formButton"],
.auth-container [class*="clerk-socialButtons"] {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Clerk Form Fields */
.auth-container [class*="clerk-formField"] {
    margin-bottom: 16px;
}

.auth-container [class*="clerk-formFieldInput"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #1f2937;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.auth-container [class*="clerk-formFieldInput"]:focus {
    outline: none;
    border-color: #222;
    box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.1);
}

/* Clerk Buttons */
.auth-container [class*="clerk-formButtonPrimary"] {
    width: 100%;
    padding: 12px 16px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.auth-container [class*="clerk-formButtonPrimary"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.auth-container [class*="clerk-formButtonSecondary"] {
    background: transparent;
    color: #222;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.auth-container [class*="clerk-formButtonSecondary"]:hover {
    background: #f9fafb;
    border-color: #222;
    transform: none;
}

/* Clerk Form Labels */
.auth-container [class*="clerk-formFieldLabel"] {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Clerk Error Messages */
.auth-container [class*="clerk-formFieldError"] {
    color: #dc2626;
    font-size: 12px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* Clerk Form Container */
.auth-container [class*="clerk-form"] {
    width: 100%;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* Clerk Social Buttons */
.auth-container [class*="clerk-socialButtons"] {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.auth-container [class*="clerk-socialButtonsButton"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-container [class*="clerk-socialButtonsButton"]:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

/* Clerk Divider */
.auth-container [class*="clerk-divider"] {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #6b7280;
    font-size: 12px;
}

.auth-container [class*="clerk-divider"]::before,
.auth-container [class*="clerk-divider"]::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-container [class*="clerk-divider"]::before {
    margin-right: 12px;
}

.auth-container [class*="clerk-divider"]::after {
    margin-left: 12px;
}

/* App container */
#app-container {
    display: none;
    width: 100%;
    height: 100vh;
}

/* Profile Popover - shadcn style */
.profile-popover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.profile-popover.active {
    pointer-events: none; /* Keep overlay non-blocking */
}

.profile-popover-content {
    position: absolute;
    top: 80px;
    left: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    min-width: 240px;
    overflow: hidden;
    animation: profilePopoverIn 0.2s ease-out;
    pointer-events: auto; /* Allow interaction with the popover content */
}

@keyframes profilePopoverIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.profile-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
}

.profile-actions {
    padding: 8px;
}

.profile-action {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-align: left;
}

.profile-action:hover {
    background: #f9fafb;
    color: #111827;
}

.profile-action svg {
    flex-shrink: 0;
}

body {
    margin: 0;
    padding: 0;
    background: #fafafa;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: background-color 150ms ease-out;
}

#viewer {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, #ffffff 0%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
    transition: background 150ms ease-out;
}

/* Add smooth transitions to 3Dmol canvas elements */
#viewer canvas {
    transition: all 150ms ease-out;
}

/* Add smooth transitions to 3Dmol container elements */
#viewer > div {
    transition: all 150ms ease-out;
}

/* Drag and drop styling */
.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drag-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.loading-spinner-large {
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.drag-message {
    background: hsl(0 0% 100%);
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: hsl(222.2 84% 4.9%);
}

.drag-message svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: hsl(262.1 83.3% 57.8%);
}

.floating-toolbar {
    background: hsl(0 0% 100%);
    backdrop-filter: blur(12px);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* File Toolbar - Top Left */
.file-toolbar {
    position: fixed;
    top: 24px;
    left: 24px;
    background: transparent;
    backdrop-filter: blur(40px);
    border: none;
    border-radius: 12px;
    box-shadow: none;
    padding: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    min-width: fit-content;
}

/* Surface Style Tabs */
.surface-style-tabs {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.surface-tab {
    flex: 1;
    padding: 6px 12px;
    background: hsl(210 40% 98%);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: hsl(215.4 16.3% 46.9%);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.surface-tab:hover {
    background: hsl(210 40% 96%);
}

.surface-tab.active {
    background: hsl(0 0% 100%);
    border-color: hsl(222.2 84% 4.9%);
    color: hsl(222.2 84% 4.9%);
    font-weight: 600;
}

/* Bottom Layout Container */
.bottom-layout-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

/* Capture Buttons Container */
.capture-buttons-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Standalone Capture Buttons */
.capture-button {
    width: 68px;
    height: 68px;
    background: hsl(0 0% 100%);
    backdrop-filter: blur(12px);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.capture-button:hover {
    background: hsl(0 0% 96%);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1);
}

.capture-button svg {
    width: 28px;
    height: 28px;
}

.section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Color controls section - prevent wrapping */
.floating-toolbar .section:first-child {
    flex-wrap: nowrap;
    min-width: 0;
}

.section-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.record-status {
    font-size: 11px;
    color: hsl(215.4 16.3% 46.9%);
    text-align: center;
    min-height: 0;
    line-height: 1.2;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.record-status.active {
    color: hsl(0 72% 51%);
    font-weight: 600;
    opacity: 1;
    animation: pulse 1.5s infinite;
}

.record-status.recording {
    color: hsl(0 72% 51%);
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

/* Global Toast Notification */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    pointer-events: none;
}

.toast {
    background: #1b1b1b;
    color: hsl(0 0% 98%);
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #1b1b1b;
    color: hsl(0 0% 98%);
}

.toast.error {
    background: #ef4444;
    color: white;
}

/* Universal Search Modal */
.pdb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdb-modal.active {
    display: flex;
    opacity: 1;
}

.pdb-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
    width: 440px;
    max-width: 440px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    transition-delay: 0.1s;
}

.pdb-modal.active .pdb-modal-content {
    opacity: 1;
    transform: translateY(0);
}

.pdb-modal-title {
    font-size: 32px;
    font-weight: 600;
    color: hsl(0 0% 100%);
    margin: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    transition-delay: 0.2s;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pdb-modal.active .pdb-modal-title {
    opacity: 1;
    transform: translateY(0);
}





/* Universal Search Styles */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 16px;
}

/* AI Enhancement Modal */
.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-modal.active {
    display: flex;
    opacity: 1;
}

.ai-modal-content {
    display: flex;
    flex-direction: column;
    background: hsl(0 0% 100%);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    transition-delay: 0.1s;
}

.ai-modal.active .ai-modal-content {
    opacity: 1;
    transform: translateY(0);
}

.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 0 32px;
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
    padding-bottom: 20px;
}

.ai-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: hsl(222.2 84% 4.9%);
    margin: 0;
}

.ai-modal-close {
    background: none;
    border: none;
    color: hsl(215.4 16.3% 46.9%);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-modal-close:hover {
    background: hsl(214.3 31.8% 91.4%);
    color: hsl(222.2 84% 4.9%);
}

.ai-modal-body {
    display: flex;
    padding: 32px;
    gap: 32px;
    max-height: calc(90vh - 120px);
    overflow: hidden;
}

/* Left Sidebar */
.ai-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
}

.ai-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-section-title {
    font-size: 14px;
    font-weight: 600;
    color: hsl(222.2 84% 4.9%);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Style Preset Buttons */
.style-preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.style-preset-btn {
    padding: 10px 12px;
    background: hsl(0 0% 98%);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: hsl(222.2 84% 4.9%);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.style-preset-btn:hover {
    background: hsl(214.3 31.8% 91.4%);
}

.style-preset-btn.active {
    background: hsl(0 0% 98%);
    color: hsl(222.2 84% 4.9%);
    border: 2px solid #000000;
    font-weight: 600;
}

/* Custom Prompt Input */
.custom-prompt-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s ease;
}

.custom-prompt-input:focus {
    border-color: hsl(222.2 84% 4.9%);
}



/* Generate Button */
.ai-generate-btn {
    padding: 16px 24px;
    background: hsl(222.2 84% 4.9%);
    color: hsl(0 0% 98%);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.ai-generate-btn:hover:not(:disabled) {
    background: hsl(222.2 84% 6.9%);
    transform: translateY(-1px);
}

.ai-generate-btn:disabled {
    background: hsl(215.4 16.3% 46.9%);
    cursor: not-allowed;
    transform: none;
}

/* Right Preview Area */
.ai-preview {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 20px;
    min-height: 0;
}

/* Tab Toggle */
.ai-tab-toggle {
    display: flex;
    gap: 4px;
    background: hsl(214.3 31.8% 91.4%);
    border-radius: 8px;
    padding: 4px;
}

.ai-tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: hsl(215.4 16.3% 46.9%);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.ai-tab-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.ai-tab-btn.active {
    background: hsl(0 0% 100%);
    color: hsl(222.2 84% 4.9%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-tab-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-tab-btn.disabled:hover {
    background: none;
}

/* Image Container */
.ai-image-container {
    flex: 1;
    min-height: 0;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 8px;
    overflow: hidden;
    background: hsl(0 0% 98%);
}

.ai-image-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
}

.ai-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: hsl(215.4 16.3% 46.9%);
}

.ai-placeholder svg {
    opacity: 0.5;
}

.ai-placeholder p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.ai-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.ai-image-preview img.loading {
    animation: imageLoading 2s ease-in-out infinite;
}

@keyframes imageLoading {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.7; }
}

/* Download Overlay Buttons */
.ai-download-overlay-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 8px 16px;
    background: hsl(0 0% 100%);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: hsl(222.2 84% 4.9%);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.ai-download-overlay-btn:hover:not(:disabled) {
    background: hsl(210 40% 98%);
    transform: translateY(-1px);
}

.ai-download-overlay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ai-modal-body {
        flex-direction: column;
        gap: 24px;
    }
    
    .ai-sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .ai-preview {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .ai-modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .ai-modal-header {
        padding: 20px 24px 0 24px;
    }
    
    .ai-modal-body {
        padding: 24px;
    }
    
    .ai-modal-title {
        font-size: 20px;
    }
}

/* Universal Search Styles */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 16px;
}

.universal-search-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.16);
    color: hsl(0 0% 100%);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.universal-search-input:focus {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: none;
}

.universal-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.universal-search-btn {
    width: 100%;
    height: 40px;
    padding: 0 16px;
    background: hsl(0 0% 100%);
    color: hsl(222.2 84% 4.9%);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    position: relative;
    gap: 8px;
    box-sizing: border-box;
}

.universal-search-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.universal-search-btn:focus-visible {
    outline: 2px solid hsl(262.1 83.3% 57.8%);
    outline-offset: 2px;
}

.universal-search-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
    transform: none;
}

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

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

.search-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    max-width: 500px;
    margin-bottom: 20px;
}

.search-info small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14pt;
    line-height: 1.4;
    text-align: center;
}

/* Results Modal CSS removed - kept logic in JS for future restoration */



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

/* Recording button blink animation */
.recording-blink {
    animation: recordingBlink 1s infinite;
}

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

/* Recording quality indicator */
.recording-quality {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recording-quality.high {
    background: #10b981;
}

.recording-quality.medium {
    background: #f59e0b;
}

.recording-quality.low {
    background: #ef4444;
}

.section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.separator {
    width: 1px;
    height: 20px;
    background: hsl(214.3 31.8% 91.4% / 0.24);
    margin: 0 4px;
}

.separator-horizontal {
    width: 100%;
    height: 1px;
    background: hsl(214.3 31.8% 91.4%);
    margin: 12px 0;
}

/* shadcn/ui Button Component */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    height: 36px;
    padding: 0 16px;
    position: relative;
    gap: 8px;
}

/* Icon-only button variant */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    min-width: 36px;
}

.btn:focus-visible {
    outline: 2px solid hsl(262.1 83.3% 57.8%);
    outline-offset: 2px;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn-primary {
    background: #1b1b1b;
    color: hsl(0 0% 98%);
}

.btn-primary:hover {
    background: #2a2a2a;
}

.btn-outline {
    background: transparent;
    color: #1b1b1b;
    border: 2px solid #1b1b1b;
}

.btn-outline:hover {
    background: rgba(27, 27, 27, 0.1);
    color: #1b1b1b;
}

.btn-secondary {
    background-color: hsl(210 40% 98%);
    color: hsl(222.2 84% 4.9%);
    border: 1px solid hsl(214.3 31.8% 91.4%);
}

.btn-secondary:hover {
    background-color: hsl(210 40% 96%);
}

/* shadcn/ui Select Component */
.select-trigger {
    display: flex;
    height: 36px;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    border-radius: 6px;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background-color: hsl(0 0% 100%);
    padding: 0 12px;
    font-size: 14px;
    color: hsl(222.2 84% 4.9%);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    position: relative;
    user-select: none;
}

.select-trigger:hover {
    background-color: hsl(210 40% 98%);
}

.select-trigger:focus {
    outline: 2px solid hsl(222 83.3% 57.8%);
    outline-offset: 2px;
}

.select-trigger.active {
    border-color: hsl(222 83.3% 57.8%);
    box-shadow: 0 0 0 2px hsl(222 83.3% 57.8% / 0.2);
}

.select-value {
    flex: 1;
    text-align: left;
}

.select-chevron {
    color: hsl(215.4 16.3% 46.9%);
    transition: transform 0.2s ease;
}

.select-trigger.active .select-chevron {
    transform: rotate(180deg);
}

/* Hide default select styling */
.style-select,
.animation-select,
.effect-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    cursor: inherit;
    line-height: inherit;
    outline: none;
    color: inherit;
}

.style-select {
    min-width: 100px;
}

.animation-select {
    min-width: 100px;
}

.effect-select {
    min-width: 100px;
}

/* Select containers with shadcn/ui styling */
.select-container {
    position: relative;
    display: inline-block;
    width: 140px;
    max-width: 140px;
}

.select-container .select-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    gap: 8px;
}

.select-container .select-trigger .select-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.select-container .select-trigger .select-chevron {
    flex-shrink: 0;
}

/* Dropdown content */
.select-content {
    position: absolute;
    bottom: 100%;
    left: 0;
    z-index: 1000;
    background-color: hsl(0 0% 100%);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 4px;
    margin-bottom: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.2s ease;
    max-height: 200px;
    overflow-y: auto;
    white-space: nowrap;
    min-width: 100%;
    width: max-content;
}

.select-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: hsl(222.2 84% 4.9%);
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    min-width: 0;
}

.select-item:hover {
    background-color: hsl(210 40% 98%);
}

.select-item.selected {
    background-color: rgba(0, 0, 0, 0.08);
    color: hsl(222.2 84% 4.9%);
}

.select-shortcut {
    font-size: 12px;
    color: hsl(215.4 16.3% 46.9%);
    background-color: hsl(210 40% 96%);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.select-item.selected .select-shortcut {
    background-color: hsl(210 40% 96%);
    color: hsl(215.4 16.3% 46.9%);
}

/* File Input with shadcn/ui styling */
.file-input {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-label {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    background-color: hsl(210 40% 98%);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: hsl(222.2 84% 4.9%);
    transition: all 0.2s ease;
    position: relative;
}

.file-label:hover {
    background-color: hsl(210 40% 96%);
}

.file-label:focus-within {
    outline: 2px solid hsl(262.1 83.3% 57.8%);
    outline-offset: 2px;
}

/* Add right padding when clear icon is visible (file is loaded) */


.file-label:has(.clear-icon[style*="display: flex"]) {
    padding-right: 8px;
}

.file-label-text {
    flex: 1;
    text-align: left;
}

.clear-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 4px !important;
    margin-left: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-icon:hover {
    background-color: hsl(0 0% 90%);
}

.clear-icon svg {
    width: 16px;
    height: 16px;
    fill: #444444;
}

/* Color Picker with shadcn/ui styling */
.color-picker {
    width: 36px;
    height: 36px;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 6px;
    background: hsl(0 0% 100%);
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
}

.color-picker:hover {
    border-color: hsl(215.4 16.3% 46.9%);
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 4px;
    overflow: hidden;
}

.color-picker::-webkit-color-swatch {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

.color-picker::-moz-color-swatch {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

/* Molecule loading animation */
.molecule-loading {
    animation: moleculeFadeIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes moleculeFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Canvas animation wrapper */
.canvas-animation-wrapper {
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* shadcn/ui Tooltip Component */
.tooltip {
    position: relative;
    display: inline-block;
}

/* Keyboard shortcut styling */
.keyboard-shortcut {
    opacity: 0.6;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #1b1b1b;
    color: hsl(0 0% 98%);
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* Tooltip positioning for different elements */
.tooltip-left .tooltip-content {
    left: auto;
    right: 0;
    transform: translateX(4px);
}

.tooltip-left:hover .tooltip-content {
    transform: translateX(0);
}

.tooltip-right .tooltip-content {
    left: auto;
    right: 0;
    transform: translateX(-4px);
}

.tooltip-right:hover .tooltip-content {
    transform: translateX(0);
}

.tooltip-top .tooltip-content {
    bottom: 100%;
    top: auto;
    transform: translateX(-50%) translateY(4px);
}

.tooltip-top:hover .tooltip-content {
    transform: translateX(-50%) translateY(0);
}

.tooltip-bottom .tooltip-content {
    top: 100%;
    bottom: auto;
    margin-top: 8px;
    margin-bottom: 0;
    transform: translateX(-50%) translateY(-4px);
}

.tooltip-bottom:hover .tooltip-content {
    transform: translateX(-50%) translateY(0);
}

/* Material properties panel */
.material-panel {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: hsl(0 0% 100%);
    backdrop-filter: blur(12px);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
    min-width: 200px;
}

.material-panel.active {
    display: flex;
}

.material-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.material-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.material-label {
    font-size: 12px;
    font-weight: 500;
    color: #1b1b1b;
    min-width: 60px;
    text-align: left;
}

.material-value {
    font-size: 12px;
    font-weight: 500;
    color: #1b1b1b;
    min-width: 30px;
    text-align: right;
}

.material-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: hsl(214.3 31.8% 91.4%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.material-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1b1b1b;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.material-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1b1b1b;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Empty State Overlay */
.empty-state-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, background 150ms ease-out;
}

.empty-state-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.empty-state-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
    width: 90%;
}

.empty-state-image {
    margin-bottom: 24px;
}

.empty-state-image svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* Light theme text colors */
.empty-state-title {
    font-size: 16px;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.empty-state-title.dark-theme {
    color: #fff;
}

.load-example-link {
    color: #444;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.load-example-link.dark-theme {
    color: #fff;
}

.load-example-link:hover {
    color: #666;
}

.load-example-link.dark-theme:hover {
    color: #ccc;
}

.empty-state-subtitle {
    font-size: 13px;
    color: #444;
    opacity: 0.7;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.empty-state-subtitle.dark-theme {
    color: #fff;
    opacity: 0.8;
}






