/* ==================== APPOINTMENT BOOK LIGHT MODE FIX ==================== */

html:not(.dark) #appointmentBookContent {
    background: #ffffff !important;
}

html:not(.dark) #appointmentBookContent .calendar-grid,
html:not(.dark) #appointmentBookContent .calendar-grid-body {
    background: #d1d5db !important;
}

html:not(.dark) #appointmentBookContent .time-slot {
    background: #f9fafb !important;
    color: #6b7280 !important;
    border-right: 1px solid #d1d5db !important;
}

html:not(.dark) #appointmentBookContent .calendar-cell {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
}

html:not(.dark) #appointmentBookContent .calendar-cell:hover:not(.appointment) {
    background: #f9fafb !important;
    border-color: #7c3aed !important;
}

html:not(.dark) #appointmentBookContent .calendar-cell.selected {
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%) !important;
    border-color: #7c3aed !important;
    color: white !important;
}

html:not(.dark) #appointmentBookContent .calendar-cell.closed-hours {
    background: #f3f4f6 !important;
    opacity: 0.7 !important;
}

html:not(.dark) #appointmentBookContent .calendar-header th,
html:not(.dark) #appointmentBookContent .calendar-header-fixed th {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%) !important;
    color: #ffffff !important;
}

html:not(.dark) #appointmentBookContent input[type="date"] {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-color: #d1d5db !important;
}

html:not(.dark) #selectionInfo {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
    border: 1px solid #d1d5db !important;
}

html:not(.dark) #selectionInfo .text-sm {
    color: #6b7280 !important;
}

html:not(.dark) #selectedTimeRange {
    color: #111827 !important;
}

/* ==================== MAP SECTION LIGHT MODE FIX ==================== */

html:not(.dark) #mapSection {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%) !important;
    border: 1px solid #e5e7eb !important;
}

html:not(.dark) #mapSection h2 {
    color: #111827 !important;
}

html:not(.dark) #mapSection p {
    color: #6b7280 !important;
}

html:not(.dark) #mapContainer {
    background-color: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
}

html:not(.dark) #searchMap {
    background-color: #ffffff !important;
}

/* ==================== PROFILE CARD BOTTOM SECTION FIX ==================== */

html:not(.dark) #profilesGrid .bg-slate-800 > div:last-child {
    background-color: #f9fafb !important;
}

html:not(.dark) [class*="bg-slate-900"] {
    background-color: #f9fafb !important;
}

/* Skeleton Loading States */
.skeleton {
    background: linear-gradient(90deg, #334155 0%, #475569 50%, #334155 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text-lg {
    height: 1.5rem;
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 12rem;
    border-radius: 0.5rem;
}

.skeleton-button {
    height: 2.5rem;
    border-radius: 0.5rem;
}

/* ==================== MOBILE PORTRAIT MODE LOCK (INSTAGRAM STYLE) ==================== */

/* Lock entire app to portrait on mobile devices - only on actual small screens */
@media (max-width: 768px) and (max-height: 500px) and (orientation: landscape) {
    html {
        transform: rotate(-90deg);
        transform-origin: left top;
        width: 100vh;
        height: 100vw;
        overflow-x: hidden;
        position: absolute;
        top: 100%;
        left: 0;
    }
}

/* ==================== MOBILE SEARCH INTERFACE OPTIMIZATIONS ==================== */

@media (max-width: 768px) {
    /* Make search section more compact on mobile */
    #search {
        padding: 1rem 0.875rem !important;
        margin: 0.75rem !important;
        border-radius: 1rem !important;
    }

    /* Tighter spacing between form elements */
    #search .space-y-4 {
        gap: 0.75rem !important;
    }

    #search > div > div {
        margin-bottom: 0.75rem !important;
    }

    /* Reduce label spacing */
    #search label {
        margin-bottom: 0.375rem !important;
        font-size: 0.875rem !important;
    }

    /* Larger, easier to tap inputs but more compact */
    #search input,
    #search select {
        min-height: 46px !important;
        font-size: 1rem !important;
        padding: 0.625rem 0.875rem !important;
    }

    /* Larger location button */
    #useMyLocationBtn {
        min-height: 46px !important;
        min-width: 46px !important;
        padding: 0.625rem !important;
    }

    /* More compact search/clear buttons */
    #search button[type="submit"],
    #search button:not([type]) {
        min-height: 48px !important;
        font-size: 0.95rem !important;
        padding: 0.75rem 1.25rem !important;
        margin-top: 0.5rem !important;
    }

    /* Better spacing for search title */
    #search h1 {
        font-size: 1.4rem !important;
        margin-bottom: 0.75rem !important;
        line-height: 1.3 !important;
    }

    /* Improve dropdown select appearance on mobile */
    #search select {
        background-size: 18px !important;
        padding-right: 2.5rem !important;
    }

    /* Reduce gap between button group and last input */
    #search form > div:last-of-type {
        margin-top: 0.5rem !important;
    }

    /* Force close gap between filters and buttons */
    #search > form > div:last-of-type,
    #search > div > div:last-of-type {
        margin-top: 0.5rem !important;
        padding-top: 0 !important;
    }
}

/* Extra compact for smaller screens */
@media (max-width: 480px) {
    #search {
        padding: 0.875rem 0.75rem !important;
        margin: 0.5rem !important;
    }

    #search h1 {
        font-size: 1.25rem !important;
        margin-bottom: 0.625rem !important;
    }

    #search .space-y-4 {
        gap: 0.625rem !important;
    }
}

/* ==================== MOBILE PROFILE CARDS OPTIMIZATIONS ==================== */

@media (max-width: 768px) {
    /* Better card sizing and spacing on mobile */
    .bg-slate-800 {
    margin: 0.75rem 0 !important;
    padding: 1rem !important;
}

/* Limit portfolio grid height to ~3 rows on mobile */
    #profilesGrid .portfolio-grid-view {
        max-height: 400px !important;
        overflow-y: auto !important;
    }

    #profilesGrid .portfolio-scroll-view {
        max-height: 70vh !important;
        overflow-y: auto !important;
    }

    /* Ensure the portfolio container doesn't expand indefinitely */
    #profilesGrid .mobile-portfolio-container {
        max-height: 75vh !important;
        overflow: hidden !important;
    }

    /* ==================== CAROUSEL EDITOR MOBILE FIX ==================== */
    /* Prevent body scroll when modal open */
    body.carousel-editor-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    #photoEditorModal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
    }

    #photoEditorModal > div:last-child {
        height: 100% !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Smaller image preview on mobile */
    #photoEditorModal > div:last-child > div:nth-child(2) {
        min-height: auto !important;
        flex: 0 0 auto !important;
    }

    #photoEditorModal #imageViewport {
        flex: 0 0 auto !important;
        max-height: 32vh !important;
        min-height: 150px !important;
    }

    #photoEditorModal #imageToEdit {
        max-height: 32vh !important;
        object-fit: contain !important;
    }

    /* Compact thumbnail strip */
    #photoEditorModal #photoNavStrip {
        flex: 0 0 auto !important;
        padding: 0.5rem 0 !important;
    }

    #photoEditorModal .photo-thumbnail {
        width: 50px !important;
        height: 50px !important;
    }

    /* Tools panel takes remaining space */
    #photoEditorModal #editorToolsPanel {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        padding: 0.5rem !important;
        max-height: none !important;
    }

    /* Smaller crop/adjust buttons */
    #photoEditorModal .editor-tab {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Compact ratio buttons */
    #photoEditorModal #cropPanel button {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.75rem !important;
    }

    /* Make scrollbar visible on mobile for portfolio */
    #profilesGrid .portfolio-grid-view::-webkit-scrollbar,
    #profilesGrid .portfolio-scroll-view::-webkit-scrollbar {
        width: 4px !important;
    }

    #profilesGrid .portfolio-grid-view::-webkit-scrollbar-thumb,
    #profilesGrid .portfolio-scroll-view::-webkit-scrollbar-thumb {
        background: rgba(139, 92, 246, 0.5) !important;
        border-radius: 2px !important;
    }

    /* Larger profile images on mobile */
    .bg-slate-800 img[alt*="work sample"],
    .bg-slate-800 img[class*="h-48"],
    .bg-slate-800 img[class*="h-64"] {
        min-height: 200px !important;
        max-height: 250px !important;
        object-fit: cover !important;
    }

    /* Better text sizing for readability */
    .bg-slate-800 h3,
    .bg-slate-800 .text-xl {
        font-size: 1.125rem !important;
        line-height: 1.4 !important;
    }

    .bg-slate-800 .text-sm {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }

    /* Larger, easier to tap buttons in cards */
    .bg-slate-800 button {
        min-height: 48px !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
    }

    /* Better spacing for service dropdown */
    .bg-slate-800 select {
        min-height: 46px !important;
        font-size: 0.95rem !important;
        padding: 0.625rem 2rem 0.625rem 0.875rem !important;
    }

    /* Larger star ratings - easier to see */
    .bg-slate-800 svg[class*="w-4"],
    .bg-slate-800 svg[class*="w-5"] {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    /* Better spacing within cards */
    .bg-slate-800 > div {
        gap: 0.75rem !important;
    }

    /* Force bottom stats to edge - backup selector */
    .bg-slate-800 > .mt-auto {
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        margin-bottom: -1rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-bottom: 1rem !important;
        width: calc(100% + 2rem) !important;
        border-radius: 0 0 1rem 1rem !important;
    }

    /* Make portfolio section use more width */
    .bg-slate-800 .mobile-portfolio-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Make phone/text row fill width */
    .bg-slate-800 .text-center.pb-4.text-sm.text-indigo-300 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Compact toggle buttons and filter dropdown */
    .bg-slate-800 .view-toggle-btn {
        min-height: auto !important;
        padding: 0.5rem !important;
    }

    .bg-slate-800 .portfolio-filter {
        min-height: 38px !important;
        padding: 0.375rem 2rem 0.375rem 0.625rem !important;
    }
    /* Make action buttons full width on mobile */
    .bg-slate-800 .schedule-appointment-btn,
    .bg-slate-800 .send-message-btn {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Remove extra padding from button containers */
    .bg-slate-800 .px-5.pb-3 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Make top info section full width on mobile */
    .bg-slate-800 > .p-5 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Reduce gap between avatar and info */
    .bg-slate-800 .flex.items-center.space-x-4 {
        gap: 0.75rem !important;
    }

    .bg-slate-800 .flex.items-center.space-x-4 > *:not(:first-child) {
        margin-left: 0 !important;
    }

    /* Make bio section full width */
    .bg-slate-800 .px-5.pb-4 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Extra small screens - even more mobile-friendly */
@media (max-width: 480px) {
    .bg-slate-800 {
        margin: 0.5rem 0.375rem !important;
        padding: 0.875rem !important;
    }

    /* Full-width buttons on small screens */
    .bg-slate-800 button[onclick*="scheduleAppointment"],
    .bg-slate-800 button[class*="bg-gradient"] {
        width: 100% !important;
        min-height: 52px !important;
        font-size: 1rem !important;
    }
}

/* ==================== MOBILE HEADER OPTIMIZATIONS ==================== */

/* Mobile header adjustments */
@media (max-width: 768px) {
    /* Smaller logo text on mobile */
    #logo {
        font-size: 1.25rem !important; /* Smaller than desktop's text-2xl */
    }

    /* Reduce header height slightly on mobile */
    #mainHeader .h-16 {
        height: 3.5rem !important;
    }

    /* Reduce spacing between nav items */
    #publicNav {
        gap: 0.25rem !important; /* Smaller than space-x-2 */
    }

    #userNav {
        gap: 0.5rem !important; /* Smaller than space-x-4 */
    }

    /* Make buttons smaller on mobile */
    #joinBtn, #signInBtn {
        padding: 0.375rem 0.75rem !important; /* Smaller than px-4 py-2 */
        font-size: 0.75rem !important; /* Smaller text */
    }

    #myAccountBtn, #signOutBtn {
        padding: 0.375rem 0.625rem !important; /* Even smaller padding */
        font-size: 0.7rem !important; /* Slightly smaller text */
        white-space: nowrap !important; /* Prevent text wrapping */
        min-width: fit-content !important; /* Allow button to size to content */
    }

    /* Ensure userNav doesn't overflow */
    #userNav {
        gap: 0.375rem !important; /* Even tighter spacing when signed in */
        flex-wrap: nowrap !important; /* Prevent wrapping */
    }

    /* Hide theme toggle labels on mobile, show icons only */
    .theme-label {
        display: none !important;
    }

    .theme-toggle-pill {
        min-width: 2.5rem !important; /* Smaller toggle */
        padding: 0.25rem !important;
    }

    .theme-option {
        padding: 0.25rem !important;
    }

    /* Smaller notification bell on mobile */
    #notificationBellBtn {
        padding: 0.5rem !important;
    }

    #notificationBellBtn svg {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    /* Reduce container padding on mobile */
    #mainHeader .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Ensure portfolio section fills space to push footer down */
    .bg-slate-800 .mobile-portfolio-container,
    .bg-slate-800 .px-5.pb-5.flex-grow {
        flex: 1 1 auto !important;
        min-height: 50px !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    #logo {
        font-size: 1.1rem !important; /* Even smaller logo */
    }

    /* Stack or hide less important elements */
    .theme-toggle-container {
        display: none !important; /* Hide theme toggle on very small screens */
    }
}

/* ==================== USER MENU DROPDOWN ==================== */
#userMenu {
    animation: userMenuFadeIn 0.15s ease-out;
    transform-origin: top right;
}

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

/* Light mode styling */
html:not(.dark) #userMenu {
    background-color: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
html:not(.dark) #userMenu .border-slate-700,
html:not(.dark) #userMenu .border-t {
    border-color: #e5e7eb !important;
}
html:not(.dark) #userMenuName { color: #111827; }
html:not(.dark) #userMenuEmail { color: #6b7280; }
html:not(.dark) #userMenu button[role="menuitem"] {
    color: #374151;
}
html:not(.dark) #userMenu button[role="menuitem"]:hover {
    background-color: #f3f4f6;
}
html:not(.dark) #userMenu #userMenuSignOut {
    color: #dc2626;
}
html:not(.dark) #userMenuBtn {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Avatar tap target on mobile — keep it 40px (already sized) but ensure no clipping */
@media (max-width: 480px) {
    #userMenu {
        width: 14rem;
    }
}

/* Mobile theme toggle - icon only */
.mobile-theme-toggle {
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 480px) {
    .mobile-theme-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: transparent;
        color: #d1d5db;
        cursor: pointer;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }
    html:not(.dark) .mobile-theme-toggle {
        color: #6b7280;
    }
    .mobile-theme-toggle:hover {
        color: #c4b5fd;
    }
    /* In dark mode: show moon (reflects current mode), hide sun */
    html.dark .mobile-theme-toggle .mobile-theme-moon { display: block; }
    html.dark .mobile-theme-toggle .mobile-theme-sun { display: none; }
    /* In light mode: show sun (reflects current mode), hide moon */
    html:not(.dark) .mobile-theme-toggle .mobile-theme-sun { display: block; }
    html:not(.dark) .mobile-theme-toggle .mobile-theme-moon { display: none; }

    }

/* Mobile talent card fixes */
@media (max-width: 480px) {
    /* Wrap status buttons */
    #unlockedTalentsList .flex.items-center.gap-1\.5 {
        flex-wrap: wrap;
        gap: 6px;
    }
    /* Hide pipe separators on mobile */
    #unlockedTalentsList .flex.items-center.gap-1\.5 > span.text-slate-600 {
        display: none;
    }
    /* Constrain entire talent card and children */
    #findTalentContainer {
        overflow: hidden !important;
    }
    #findTalentContainer * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    /* Notes textarea */
    #unlockedTalentsList textarea {
        width: 100% !important;
        min-width: 0 !important;
    }
    /* Credits row: stack on mobile */
    #findTalentContainer .bg-slate-900\/50 .flex.items-center.justify-between {
        flex-wrap: wrap;
        gap: 12px;
    }
    #findTalentContainer .bg-slate-900\/50 .flex.items-center.justify-between > button {
        width: 100%;
    }
}

/* Remove bottom margin on portfolio container for mobile */
            @media (max-width: 768px) {
                .bg-slate-800 > div.mb-32 {
                    margin-bottom: 0 !important;
                }
            }

            /* ==================== MOBILE MESSAGES SECTION OPTIMIZATIONS ==================== */

@media (max-width: 768px) {
    /* More compact Messages section on mobile */
    #messagesSection .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    #messagesSection .pb-6 {
        padding-bottom: 1rem !important;
    }

    /* Larger, easier to tap conversation items */
    .conversation-item {
        padding: 1rem !important;
        min-height: 72px !important;
        border-width: 1.5px !important;
    }

    .conversation-item h4 {
        font-size: 1rem !important;
        font-weight: 600 !important;
    }

    .conversation-item p {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }

    /* Better touch target for Back button */
    #backToConversationsBtn {
        min-height: 44px !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
    }

    #backToConversationsBtn span:first-child {
        font-size: 1.25rem !important;
    }

    /* Better sizing for Delete button */
    #deleteConversationBtn {
        min-height: 44px !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem !important;
        font-weight: 600 !important;
    }

    /* Optimize message thread height for mobile screens */
    #messageThread {
        max-height: 60vh !important;
        min-height: 300px !important;
        padding: 0.75rem !important;
    }

    /* Better message bubble sizing on mobile */
    #messageThread .message-bubble > div {
        max-width: 85% !important;
        padding: 0.75rem 1rem !important;
    }

    #messageThread .message-bubble img {
        max-width: 100% !important;
        max-height: 250px !important;
        object-fit: cover !important;
    }

    #messageThread .message-bubble p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }

    /* Larger, easier to tap input area */
    #newMessageInput {
        font-size: 1rem !important;
        padding: 0.75rem !important;
        min-height: 80px !important;
        line-height: 1.5 !important;
    }

    /* Better touch targets for message input buttons */
    #sendMessageBtn {
        min-height: 48px !important;
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
    }

    /* Larger photo upload button */
    label[for="messageImageInput"] {
        min-height: 44px !important;
        padding: 0.5rem !important;
    }

    label[for="messageImageInput"] svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    label[for="messageImageInput"] span {
        font-size: 0.9rem !important;
    }

    /* Better image preview sizing */
    #messageImagePreview img {
        max-height: 150px !important;
    }

    #removeMessageImage {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.25rem !important;
    }

    /* Better conversation search */
    #conversationSearch {
        min-height: 46px !important;
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }

    /* Better spacing for "no conversations" state */
    #noConversations {
        padding: 2rem 1rem !important;
    }

    #noConversations .text-6xl {
        font-size: 4rem !important;
        margin-bottom: 1rem !important;
    }

    #noConversations p {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    #noConversations button {
        min-height: 48px !important;
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
    }

    /* Optimize recipient info display */
    #threadRecipientInfo {
        gap: 0.5rem !important;
    }

    #threadRecipientInfo h3 {
        font-size: 1rem !important;
        font-weight: 600 !important;
    }

    /* Better unread badge sizing */
    .unread-badge {
        padding: 0.25rem 0.625rem !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
    }

    #unreadMessagesCount {
        padding: 0.25rem 0.625rem !important;
        font-size: 0.75rem !important;
    }

    /* Character counter visibility */
    #charCount {
        font-size: 0.8rem !important;
    }
}

/* Extra small screens - even more compact */
@media (max-width: 480px) {
    /* Even more compact padding */
    #messagesSection .px-6 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Smaller message bubbles percentage */
    #messageThread .message-bubble > div {
        max-width: 90% !important;
        padding: 0.625rem 0.875rem !important;
    }

    /* Stack message input controls better on very small screens */
    #newMessageInput + div {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    /* Full-width send button on tiny screens */
    #sendMessageBtn {
        flex: 1 1 100% !important;
        order: 2 !important;
    }

    label[for="messageImageInput"] {
        order: 1 !important;
    }

    #charCount {
        order: 1 !important;
    }

    /* Reduce message thread max height on very small screens */
    #messageThread {
        max-height: 50vh !important;
        min-height: 250px !important;
    }
  }

  /* Upload Progress Overlay */
  .upload-progress-overlay {
      position: absolute;
      inset: 0;
      background: rgba(30, 41, 59, 0.95);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      border-radius: 1rem;
      z-index: 10;
  }

  .upload-spinner {
      width: 48px;
      height: 48px;
      border: 4px solid rgba(147, 51, 234, 0.3);
      border-top-color: #a855f7;
      border-radius: 50%;
      animation: spin 1s linear infinite;
  }

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

  .upload-progress-text {
      margin-top: 1rem;
      color: #e2e8f0;
      font-size: 0.95rem;
      font-weight: 500;
  }

  .upload-progress-checkmark {
      width: 48px;
      height: 48px;
      background: #22c55e;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 1.5rem;
  }

  /* Carousel Upload Thumbnails */
.carousel-thumbnail {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: grab;
    transition: all 0.2s;
}
.carousel-thumbnail:hover {
    border-color: #a855f7;
}
.carousel-thumbnail.dragging {
    opacity: 0.5;
    cursor: grabbing;
}
.carousel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-thumbnail .thumbnail-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 2px;
}
.carousel-thumbnail .thumbnail-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}
.carousel-thumbnail:hover .thumbnail-remove {
    opacity: 1;
}
.carousel-thumbnail .thumbnail-order {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: rgba(168, 85, 247, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
}

/* Carousel Display in Portfolio */
.carousel-post {
    position: relative;
    aspect-ratio: 1;
    background: #334155;
    border-radius: 8px;
    overflow: hidden;
}
.carousel-post .carousel-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}
.carousel-post .carousel-slide {
    min-width: 100%;
    height: 100%;
}
.carousel-post .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-post .carousel-nav {
    position: absolute;
    bottom: 6px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.carousel-post:hover .carousel-nav {
    opacity: 1;
}
.carousel-post .carousel-nav.prev {
    left: 6px;
}
.carousel-post .carousel-nav.next {
    right: 6px;
}
.carousel-post .carousel-dots {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 10;
}
.carousel-post .carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}
.carousel-post .carousel-dot.active {
    background: white;
}
.carousel-post .carousel-label {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(168, 85, 247, 0.9);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
}
.carousel-post .carousel-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
}

/* Hide scrollbar for horizontal carousel in scroll view */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
