/* Modern CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
    background-color: #f9fafb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Utility Classes (Tailwind-inspired) */
.min-h-screen { min-height: 100vh; }

/* Responsive Utilities */
.max-w-7xl { max-width: 80rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-3xl { max-width: 48rem; }

/* Grid System */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Mobile-first responsive design */
/* Touch-friendly minimum tap targets */
button, .category-btn, select, input[type="submit"] {
    min-height: 44px;
    touch-action: manipulation;
}

/* Mobile optimizations */
@media (max-width: 639px) {
    /* Larger touch targets on mobile */
    .category-btn {
        min-height: 60px;
        padding: 0.75rem;
    }
    
    /* Better text sizing for mobile */
    body {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Optimize modal for mobile */
    .modal-content {
        border-radius: 12px 12px 0 0;
        max-height: 95vh;
    }
    
    /* Better spacing for mobile */
    .space-y-6 > * + * {
        margin-top: 1rem;
    }
}

/* Responsive Breakpoints */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:p-8 { padding: 2rem; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:text-5xl { font-size: 3rem; line-height: 1; }
    .sm\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
}

@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:p-12 { padding: 3rem; }
    .lg\:mb-16 { margin-bottom: 4rem; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .lg\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .xl\:text-7xl { font-size: 4.5rem; line-height: 1; }
}

.bg-gray-50 { background-color: #f9fafb; }
.bg-white { background-color: #ffffff; }
.bg-black { background-color: #000000; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #10b981; }
.bg-red-500 { background-color: #ef4444; }
.bg-orange-400 { background-color: #fb923c; }
.bg-emerald-400 { background-color: #34d399; }
.bg-blue-400 { background-color: #60a5fa; }

.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.text-green-800 { color: #166534; }

.border { border: 1px solid #e5e7eb; }
.border-b { border-bottom: 1px solid #e5e7eb; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-2 { border: 2px solid #e5e7eb; }
.border-black { border-color: #000000; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-600 { border-color: #4b5563; }
.border-gray-700 { border-color: #374151; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }

/* Model Card Styles */
.model-card {
    transition: all 0.2s ease;
}

.model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.model-card .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.model-card-footer {
    background: linear-gradient(to right, #f9fafb, #f3f4f6);
    border-top: 1px solid #e5e7eb;
}
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }

.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-16 { margin-top: 4rem; }
.mt-24 { margin-top: 6rem; }

.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-8 { width: 2rem; }
.w-16 { width: 4rem; }
.w-full { width: 100%; }
.h-2 { height: 0.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-16 { height: 4rem; }

.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-12 { gap: 3rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-6xl { font-size: 3.75rem; line-height: 1; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.leading-tight { line-height: 1.25; }

.cursor-pointer { cursor: pointer; }

.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }

.hidden { display: none; }

.list-decimal { list-style-type: decimal; }
.list-inside { list-style-position: inside; }

.resize-none { resize: none; }

.min-h-\[120px\] { min-height: 120px; }

/* Focus and Hover States */
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:text-gray-300:hover { color: #d1d5db; }
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:border-gray-300:hover { border-color: #d1d5db; }

.focus\:border-black:focus { border-color: #000000; }
.focus\:ring-black:focus { --tw-ring-color: #000000; }

/* API Status Colors */
.api-status-online { 
    background-color: #10b981; 
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}
.api-status-offline { 
    background-color: #ef4444; 
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}
.api-status-checking { 
    background-color: #f59e0b; 
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.1);
    }
}

/* Custom Components */
textarea, input[type="text"] {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
    outline: none;
}

textarea:focus, input[type="text"]:focus {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

button {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    outline: none;
    background: none; /* Default; specific buttons below override */
}



button:focus {
    outline: none;
    box-shadow: none;
}

button:active {
    background: none;
}

/* Category and Style Selection */
.category-btn {
    transition: all 0.15s ease-in-out;
}

.category-btn.selected {
    border-color: #000000 !important;
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* Style Dropdown */
#styleSelect {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

#styleSelect:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

#styleDescription {
    min-height: 1.5rem;
    line-height: 1.5;
}

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

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

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-menu .signed-in {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sign-in-btn {
    padding: 0.5rem 1rem;
    color: #374151;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    position: relative;
}

.sign-in-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

/* Legacy support for sign-in buttons inside user-menu */
.user-menu .sign-in-btn {
    /* Inherit all styles from .sign-in-btn above */
}

.user-menu .user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
}

.user-menu .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.user-menu .user-info:hover {
    background-color: #f9fafb;
}

.user-menu .user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Buy Tokens header button */
.buy-tokens-btn {
    position: relative;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 20px -4px rgba(102, 126, 234, 0.4), 0 4px 12px -2px rgba(118, 75, 162, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.buy-tokens-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.buy-tokens-btn:hover::before {
    left: 100%;
}

.buy-tokens-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -6px rgba(102, 126, 234, 0.5), 0 8px 20px -4px rgba(118, 75, 162, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.buy-tokens-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px -2px rgba(102, 126, 234, 0.4), 0 2px 8px -1px rgba(118, 75, 162, 0.3);
}

.buy-tokens-btn::after {
    content: '';
    font-size: 1rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}



/* Responsive Buy Tokens button */
@media (min-width: 640px) {
    .buy-tokens-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

.user-menu .user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}

/* Mobile user menu adjustments */
@media (max-width: 639px) {
    .user-menu .user-details {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
        line-height: 1.2;
    }
    
    .user-menu .user-name {
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    .user-menu .user-tokens {
        font-size: 0.6rem;
        color: #6b7280;
        margin-top: -2px;
    }
}

.user-menu .user-tokens {
    font-size: 0.75rem;
    color: #6b7280;
}

.user-menu .user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    min-width: 12rem;
    z-index: 50;
    display: none;
}

.user-menu .user-menu-dropdown.show {
    display: block;
}

.user-menu .menu-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    color: #374151;
    background: none;
    border: none;
    border-radius: 0;
    transition: background-color 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.user-menu .menu-item:hover {
    background-color: #f3f4f6;
}

.user-menu .menu-item:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.user-menu .menu-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Admin Console Link Styling */
.user-menu .admin-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border-top: 1px solid #e5e7eb;
    position: relative;
}

.user-menu .admin-link:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
}

.user-menu .admin-link::before {
    content: '🔒';
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* Ensure hidden class actually hides modal overlays despite the base rule above */
.modal-overlay.hidden {
    display: none;
}

/* Profile page buttons (ensure visibility without Tailwind) */
#changeEmailBtn,
#changePasswordBtn {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #000000;
    color: #ffffff;
}

#changeEmailBtn:hover,
#changePasswordBtn:hover {
    background-color: #1f2937;
}

/* Danger Zone delete button */
#deleteAccountBtn {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #dc2626; /* red-600 */
    color: #ffffff;
}

#deleteAccountBtn:hover {
    background-color: #b91c1c; /* red-700 */
}

/* Delete confirmation modal buttons */
#confirmDeleteBtn {
    background-color: #dc2626;
    color: #ffffff;
}

#confirmDeleteBtn:hover {
    background-color: #b91c1c;
}

#cancelDeleteBtn {
    background-color: #e5e7eb;
    color: #1f2937;
}

#cancelDeleteBtn:hover {
    background-color: #d1d5db;
}

/* Auth Modal Styles */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.auth-modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 28rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    animation: slideUp 0.3s ease;
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.auth-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.close-auth-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.close-auth-modal:hover {
    color: #111827;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-tab.active {
    color: #000000;
    border-bottom-color: #000000;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form.hidden {
    display: none;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.15s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.auth-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-btn.primary {
    background-color: #000000;
    color: white;
}

.auth-btn.primary:hover {
    background-color: #1f2937;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
    z-index: 1;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.social-auth {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.social-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 28rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-tab {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.modal-tab.active {
    color: #000000;
    border-bottom-color: #000000;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-form label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.modal-form input {
    width: 100%;
}

.modal-form button {
    width: 100%;
    padding: 0.75rem;
    background-color: #000000;
    color: white;
    font-weight: 500;
    margin-top: 0.5rem;
}

.modal-form button:hover {
    background-color: #1f2937;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.toast {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    max-width: 24rem;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

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

/* Enhanced Responsive Design */
@media (max-width: 640px) {
    .category-btn {
        justify-content: center;
        text-align: center;
    }
    
    .gap-12 {
        gap: 2rem;
    }
}

@media (min-width: 768px) {
    .category-btn {
        justify-content: flex-start;
    }
}

/* Download Modal Styles */
.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.download-modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 32rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.download-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.15s ease-in-out;
}

.download-option:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

.download-option-info {
    display: flex;
    flex-direction: column;
}

.download-option-title {
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.25rem;
}

.download-option-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

.download-btn {
    padding: 0.5rem 1rem;
    background-color: #000000;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease-in-out;
}

.download-btn:hover {
    background-color: #1f2937;
    color: white;
}

/* Purchase Page Styles */
.package-indicator {
    transition: all 0.2s ease;
    cursor: pointer;
}

.package-indicator:hover {
    transform: scale(1.2);
}

/* Token counter animation */
@keyframes countUp {
    from {
        transform: scale(0.9);
        opacity: 0.7;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tokens-animate {
    animation: countUp 0.3s ease;
}

/* Plus/Minus button styles */
#prevPackage, #nextPackage {
    border: 1px solid #d1d5db;
    transition: all 0.15s ease;
    font-size: 1.5rem;
    font-weight: bold;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Slight vertical alignment nudge so +/- align optically with large number */
.token-row {
    gap: 3.5rem; /* increase spacing between +/- and number */
}

.token-row .align-center-fix {
    position: relative;
    top: 0.1rem;
}

#prevPackage:hover, #nextPackage:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

#prevPackage:active, #nextPackage:active {
    transform: scale(0.95);
}

/* Buy Now button styles - similar to Buy Tokens but black */
.buy-now-btn {
    position: relative;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    color: #ffffff;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 20px -4px rgba(17, 24, 39, 0.4), 0 4px 12px -2px rgba(55, 65, 81, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.buy-now-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.buy-now-btn:hover::before {
    left: 100%;
}

.buy-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -6px rgba(17, 24, 39, 0.5), 0 8px 20px -4px rgba(55, 65, 81, 0.4);
    background: linear-gradient(135deg, #000000 0%, #1f2937 100%);
}

.buy-now-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px -2px rgba(17, 24, 39, 0.4), 0 2px 8px -1px rgba(55, 65, 81, 0.3);
}

/* Loading state for buy button */
#buyNowBtn.loading {
    pointer-events: none;
    opacity: 0.7;
}

#buyNowBtn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Progress panel animations */
.progress-panel {
    animation: fadeIn 0.3s ease-in;
}

.progress-visual {
    animation: slideUp 0.5s ease-out;
}

#progressDescription {
    animation: textFadeIn 0.6s ease-out;
}

/* Progress bar smooth animation */
#progressFill {
    transition: width 0.5s ease-out;
}

/* Keyframe animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes textFadeIn {
    from { 
        opacity: 0;
        transform: translateY(10px); 
    }
    to { 
        opacity: 1;
        transform: translateY(0); 
    }
}

/* Model card styles */
.model-card {
    transition: all 0.2s ease;
}

.model-card:hover {
    transform: translateY(-2px);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}



/* Model Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 48rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: #111827;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-info-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-info-value {
    font-size: 1rem;
    color: #111827;
}

.modal-preview {
    width: 100%;
    height: 400px;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-btn.primary {
    background-color: #000000;
    color: white;
}

.modal-btn.primary:hover {
    background-color: #1f2937;
}

.modal-btn.secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.modal-btn.secondary:hover {
    background-color: #d1d5db;
}

.modal-btn.danger {
    background-color: #dc2626;
    color: white;
}

.modal-btn.danger:hover {
    background-color: #b91c1c;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modal-preview {
        height: 300px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Model Preview and 3D Viewer */
.model-preview {
    background: #f9fafb;
    border-radius: 8px;
    overflow: hidden;
}

.model-viewer-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.model-viewer-container canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px;
}

/* Loading spinner for 3D viewer */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}