body {
    font-family: 'Inter', sans-serif;
}

/* Custom breakpoint styles - show sidebar only above 1810px */
@media (min-width: 1811px) {
    /* Show sidebar on screens > 1810px */
    .sidebar-show-2xl {
        transform: translateX(0) !important;
        /* Calculate left position: 50% - 640px (half of max-w-7xl) + 32px (lg:px-8) - 330px offset */
        left: calc(50% - 640px + 32px - 330px) !important;
    }
    
    /* Hide top navigation on screens > 1810px */
    .nav-show-below-2xl {
        display: none !important;
    }
    
    /* Add margin for content when sidebar is visible */
    .content-offset-2xl {
        margin-left: 0 !important;
    }
}

/* Additional responsive positioning for sidebar */
@media (min-width: 1811px) and (max-width: 1920px) {
    .sidebar-show-2xl {
        /* For screens between 1811px and 1920px, ensure minimum distance from left edge */
        left: max(calc(50% - 640px + 32px - 330px), 20px) !important;
    }
}

@media (min-width: 1921px) {
    .sidebar-show-2xl {
        /* For very large screens, maintain the calculated position */
        left: calc(50% - 640px + 32px - 330px) !important;
    }
}

/* Hide sidebar on screens <= 1810px unless mobile menu is open */
@media (max-width: 1810px) {
    .sidebar-hide-below-2xl {
        transform: translateX(-100%) !important;
    }
    
    .nav-show-below-2xl {
        display: block !important;
    }
    
    .content-full-below-2xl {
        margin-left: 0 !important;
    }
}

/* Sidebar transition styles */
.sidebar-transition {
    transition: transform 0.3s ease-in-out, left 0.3s ease-in-out;
}

/* Main content wrapper transition */
.content-transition {
    transition: margin-left 0.3s ease-in-out;
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.schema-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.schema-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.form-section {
    transition: all 0.3s ease;
}

.form-section:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ai-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.ai-button-direct {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-button-direct:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.code-output {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
}

.hidden-form {
    display: none;
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* FontAwesome icon square formatting and layout shift prevention */
.fas, .far, .fab {
    display: inline-block;
    width: 1em;
    text-align: center;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* FontAwesome spinner animation - must override display properties */
.fa-spin {
    animation: fa-spin 1s infinite linear !important;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.schema-card .fas,
.schema-card .far,
.schema-card .fab,
.bg-purple-100 .fas,
.bg-purple-100 .far,
.bg-purple-100 .fab {
    width: 1.25em;
    height: 1.25em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    aspect-ratio: 1;
}

/* Reserve space for navigation icons */
.fas.fa-sitemap {
    width: 1.5em;
    height: 1.5em;
}

.fas.fa-chevron-down {
    width: 0.75em;
    height: 0.75em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fas.fa-bars {
    width: 1.125em;
    height: 1.125em;
}

/* Star Rating Styles */
.star-rating {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 1.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star:hover {
    color: #f97316;
    transform: scale(1.1);
}

.star.filled {
    color: #f97316;
}

.star-rating .star:hover {
    color: #f97316;
}

.star-rating .star:hover ~ .star {
    color: #d1d5db;
}

/* Fix search icon alignment in currency input fields */
input[data-form-type="search"]::-webkit-search-decoration,
input[data-form-type="search"]::-webkit-search-cancel-button,
input[data-form-type="search"]::-webkit-search-results-button,
input[data-form-type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none !important;
}

input[data-form-type="search"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

/* Prevent search icons from appearing in any input field */
input[type="text"]::-webkit-search-decoration,
input[type="text"]::-webkit-search-cancel-button,
input[type="text"]::-webkit-search-results-button,
input[type="text"]::-webkit-search-results-decoration,
input::-webkit-search-decoration,
input::-webkit-search-cancel-button,
input::-webkit-search-results-button,
input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none !important;
}

/* Ensure modal content doesn't inherit search styling */
.fixed.inset-0 input {
    -webkit-appearance: none;
    appearance: none;
}

.fixed.inset-0 input::-webkit-search-decoration,
.fixed.inset-0 input::-webkit-search-cancel-button,
.fixed.inset-0 input::-webkit-search-results-button,
.fixed.inset-0 input::-webkit-search-results-decoration {
    display: none !important;
}

/* Custom currency search styling */
.currency-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.currency-field {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.currency-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.currency-search-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 0.875rem;
    color: #9ca3af;
    user-select: none;
}

.currency-search-icon:hover {
    color: #4b5563;
}

/* Image constraints for preview sections */
[id*="Preview"] img,
[id*="preview"] img,
.preview-section img {
    max-width: 200px;
    max-height: 150px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Specific constraints for different preview types */
#logoPreview img {
    max-width: 150px;
    max-height: 150px;
}

#videoPreview img,
#videoPreview video {
    max-width: 264px;
    max-height: 198px;
}

#imagePreview img {
    max-width: 300px;
    max-height: 200px;
}

/* Profile and creator images */
[id*="Profile"] img[alt*="profile"],
[id*="Profile"] img[alt*="photo"],
img[alt*="Creator logo"],
img[alt*="profile"] {
    max-width: 64px;
    max-height: 64px;
    border-radius: 50%;
}

/* Global fallback for any uncaught preview images */
.grid .space-y-6 img,
.lg\\:grid-cols-2 img {
    max-width: 300px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

/* Sticky Output Column Styles */
.sticky-active {
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrollbar for sticky output when content overflows */
.sticky-active {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.sticky-active::-webkit-scrollbar {
    width: 6px;
}

.sticky-active::-webkit-scrollbar-track {
    background: transparent;
}

.sticky-active::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.sticky-active::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

/* Ensure smooth transitions for sticky activation */
.lg\\:grid-cols-2 .space-y-6:last-child {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent layout shift when sticky is activated */
.lg\\:grid-cols-2 .space-y-6:last-child.sticky-active {
    will-change: transform;
}

/* Subtle shadow for sticky column to indicate elevation */
.sticky-active {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Clear button confirmation state styles */
#clear-builder-btn {
    transition: all 0.3s ease-in-out;
}

#clear-builder-btn.confirm-clear {
    animation: pulse-warning 1.5s infinite;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
    }
}

/* Limit height of builder code output to prevent excessive vertical expansion */
#builder-code-output {
    max-height: 400px !important;
    overflow-y: auto;
}

/* Style the added schemas list container and items */
#added-schemas-list {
    max-height: 240px !important; /* Increased from 128px to fit ~3 items */
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
}

/* Style individual schema list items to be more visible */
#added-schemas-list > div:not(#no-schemas-message) {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}

#added-schemas-list > div:not(#no-schemas-message):hover {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}