        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 15px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(45deg, #667eea, #764ba2);
            color: white;
            padding: 16px;
            text-align: center;
        }

        .header h1 {
            font-size: 2.1em;
            margin-bottom: 10px;
            font-weight: 300;
        }

        .header p {
            font-size: 1.0em;
            opacity: 0.9;
        }

        .upload-section {
            padding: 10px;
            text-align: center;
            border-bottom: 2px solid #515151;
            background: #cfcfcf;
        }

        .button-row .button {
            display: inline-block;
            padding: 4px 14px;
            color: white;
            border-radius: 50px;
            font-size: 0.9em;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
            min-height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .file-input-button {
            background: #6c8575;
            box-shadow: 0 5px 15px rgba(85, 107, 93, 0.3);
        }

        /* Configure API button styling to match file input button */
        .config-api-button {
            background: #6c7896;
            box-shadow: 0 5px 15px rgba(111, 66, 193, 0.3);
        }

        .file-input-wrapper:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(141, 193, 158, 0.4);
        }

        .config-api-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(153, 165, 221, 0.4);
        }

        /* Button row styling for aligned buttons */
        .button-row {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            margin-top: 4px;
            flex-wrap: wrap;
        }

        .button-row .file-input-wrapper {
            margin-bottom: 0;
            position: relative;
        }

        /* Fix file input overlay to work with flexbox buttons */
        .button-row .file-input {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
            z-index: 2;
        }

        /* Ensure proper positioning context */
        .button-row .file-input-wrapper {
            position: relative;
            display: inline-block;
            margin-bottom: 0;
        }
        .file-input-wrapper {
            position: relative;
            display: inline-block;
            margin-bottom: 20px;
        }

        .file-input {
            position: absolute;
            opacity: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
        }

        

        /* Brand Prompt Section Styling */
        .brand-prompt-section {
            margin: 14px 0;
            padding: 16px;
            background: #fff8e1;
            border-radius: 12px;
            border-left: 4px solid #ff9800;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .brand-prompt-title {
            color: #ff9800;
            margin: 0 0 4px 0;
            font-size: 1.3em;
            font-weight: 600;
        }

        .brand-prompt-description {
            color: #666;
            font-size: 0.9em;
            margin-bottom: 12px;
            line-height: 1.2;
        }

        .brand-prompt-container {
            background: white;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .brand-prompt-field {
            margin-bottom: 16px;
        }

        .brand-prompt-label {
            display: block;
            color: #333;
            font-weight: 600;
            margin-bottom: 8px;
            font-size: 0.9em;
        }

        .brand-prompt-input {
            width: 100%;
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-family: inherit;
            font-size: 0.9em;
            line-height: 1.5;
            resize: none;
            min-height: 48px;
            max-height: 200px;
            height: 48px;
            overflow-y: auto;
            transition: border-color 0.3s ease, height 0.2s ease;
        }

        .brand-prompt-input:focus {
            outline: none;
            border-color: #ff9800;
            box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
        }

        .brand-prompt-input::placeholder {
            color: #999;
            font-style: italic;
        }

        .brand-prompt-buttons {
            display: flex;
            gap: 12px;
            justify-content: flex-start;
            flex-wrap: wrap;
        }

        .brand-prompt-buttons .custom-prompt-btn {
            font-size: 0.85em;
            padding: 8px 16px;
        }

        /* Custom Prompts Section Styling */
        .custom-prompts-section {
            margin: 14px 0;
            padding: 16px;
            background: #f8f9fa;
            border-radius: 12px;
            border-left: 4px solid #28a745;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .custom-prompts-title {
            color: #28a745;
            margin: 0 0 4px 0;
            font-size: 1.3em;
            font-weight: 600;
        }

        .custom-prompts-description {
            color: #666;
            font-size: 0.9em;
            margin-bottom: 8px;
            line-height: 1.2;
        }

        .custom-prompts-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .custom-prompts-table thead {
            color: black;
            font-weight: 600;
            font-size: 0.8em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 8px;
            text-align: left;
        }
        .custom-prompts-table tbody {
            padding: 10px;
            text-align: left;
            border-bottom: 1px solid #ddd;
            vertical-align: top;
        }
        .custom-prompts-table tbody tr {
            border-bottom: 1px solid #ddd;
        }

        .custom-prompts-table th {
            background: linear-gradient(45deg, #28a745, #20c997);
            padding: 8px;
        }

        .custom-prompts-table td {
            padding: 8px;
        }

        .custom-prompts-table tr:last-child td {
            border-bottom: none;
        }

        .prompt-property-input {
            width: 100%;
            padding: 8px;
            border: 2px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            transition: border-color 0.3s;
        }

        .prompt-property-input:focus {
            outline: none;
            border-color: #28a745;
        }

        .prompt-text-input {
            width: 100%;
            min-height: 80px;
            padding: 8px;
            border: 2px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            resize: vertical;
            font-family: inherit;
            transition: border-color 0.3s;
        }

        .prompt-text-input:focus {
            outline: none;
            border-color: #28a745;
        }

        .custom-prompts-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .custom-prompt-btn {
            padding: 6px 10px;
            border: none;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            background: #007bff;
            color: white;
        }

        .custom-prompt-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,123,255,0.3);
        }

        .custom-prompt-btn.reset-btn {
            background: #dc3545;
        }

        .custom-prompt-btn.reset-btn:hover {
            box-shadow: 0 4px 12px rgba(220,53,69,0.3);
        }

        .custom-prompt-btn.export-btn {
            background: #28a745;
        }

        .custom-prompt-btn.export-btn:hover {
            box-shadow: 0 4px 12px rgba(40,167,69,0.3);
        }

        .custom-prompt-btn.import-btn {
            background: #17a2b8;
        }

        .custom-prompt-btn.import-btn:hover {
            box-shadow: 0 4px 12px rgba(23,162,184,0.3);
        }

        .remove-prompt-btn {
            background: #dc3545;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .remove-prompt-btn:hover {
            background: #c82333;
        }

        .info-text {
            color: #000000;
            font-size: 0.9em;
            margin-bottom: 10px;
        }

        .stats {
            display: flex;
            justify-content: center;
            gap: 30px;
            flex-wrap: wrap;
        }

        .stat-item {
            text-align: center;
            padding: 8px;
            background: #f8f9ff;
            border-radius: 10px;
            min-width: 120px;
        }

        .stat-number {
            font-size: 1.2em;
            font-weight: bold;
            color: #667eea;
        }

        .stat-label {
            color: #666;
            font-size: 0.9em;
            margin-top: 2px;
        }

        .thumbnails-section {
            padding: 12px;
        }

        .section-title {
            font-size: 1.5em;
            color: #333;
            margin-bottom: 8px;
            text-align: center;
        }

        .thumbnails-grid {
            display: flex;
            flex-direction: column;
            gap: 20px;
            margin-top: 20px;
        }

        .thumbnail-item {
            display: flex;
            align-items: flex-start;
            background: #f8f9ff;
            border-radius: 15px;
            overflow: hidden;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(0,0,0,0.08);
            padding: 20px;
            min-height: 240px;
            gap: 20px;
        }

        .thumbnail-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            background: #f0f2ff;
        }

        .thumbnail-image-container {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            width: 220px;
            height: 200px;
            background: #f8f9fa;
            border-radius: 12px;
        }

        .thumbnail-image {
            max-width: 200px;
            max-height: 200px;
            width: auto;
            height: auto;
            object-fit: contain;
            border-radius: 12px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .thumbnail-image:hover {
            transform: scale(1.02);
            box-shadow: 0 6px 20px rgba(0,0,0,0.15);
        }

        .thumbnail-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            min-width: 200px;
            margin-right: 20px;
        }

        .thumbnail-metadata {
            flex: 2;
            display: flex;
            gap: 20px;
            min-width: 0;
        }

        .metadata-column {
            gap: 8px;
            flex: 1;
            display: flex;
            flex-direction: column;
            text-align: center;
            padding: 4px;
            background: #f0fff4;
            border-radius: 6px;
            border: 1px solid #28a745;
        }
        .metadata-column-header {
            font-weight: 700;
            font-size: 0.9em;
            text-align: center;
            padding: 4px;
            background: #e5e5e5;
            margin-top: -4px;
            margin-left: -4px;
            margin-right: -4px;
            border-top-left-radius: 6px;
            border-top-right-radius: 6px;
            /* border: 1px solid #28a745; */
        }

        /* .metadata-column:first-of-type {
            border-color: #667eea;
            background: #f0f4ff;
        }

        .metadata-column:first-of-type .metadata-column-header {
            color: #667eea;
            border-color: #667eea;
        }

        .metadata-column:last-of-type {
            border-color: #28a745;
            background: #f0fff4;
        }

        .metadata-column:last-of-type .metadata-column-header {
            color: #28a745;
            border-color: #28a745;
        } */

        .metadata-field {
            display: flex;
            flex-direction: column;
            margin-bottom: 4px;
        }

        .metadata-label {
            font-weight: 600;
            color: #667eea;
            font-size: 0.85em;
            margin-bottom: 4px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .metadata-input {
            border: 2px solid #e1e5f2;
            border-radius: 8px;
            padding: 8px;
            font-size: 0.9em;
            font-family: inherit;
            transition: all 0.3s ease;
            resize: vertical;
            min-height: 20px;
        }

        .metadata-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .metadata-textarea {
            min-height: 60px;
            max-height: 120px;
        }

        .tags-input {
            min-height: 40px;
        }

        .tags-hint {
            font-size: 0.75em;
            color: #888;
            margin-top: 2px;
            font-style: italic;
        }

        .thumbnail-name {
            font-weight: 600;
            color: #333;
            font-size: 1.1em;
            margin-bottom: 8px;
            word-break: break-word;
            line-height: 1.3;
        }

        .thumbnail-details {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            color: #666;
            font-size: 0.9em;
        }

        .thumbnail-size {
            color: #666;
            font-size: 0.9em;
        }

        .thumbnail-dimensions {
            color: #667eea;
            font-weight: 500;
        }

        .thumbnail-date {
            color: #888;
            font-size: 0.85em;
        }

        .thumbnail-index {
            background: #667eea;
            color: white;
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 0.8em;
            font-weight: 600;
            margin-right: 15px;
            flex-shrink: 0;
            align-self: flex-start;
        }

        .loading {
            text-align: center;
            padding: 40px;
            color: #666;
        }

        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

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

        .no-images {
            text-align: center;
            padding: 40px;
            color: #666;
            font-style: italic;
        }

        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.9);
        }

        .modal-content {
            position: relative;
            margin: 5% auto;
            max-width: 90%;
            max-height: 90%;
        }

        .modal-image {
            width: 100%;
            height: auto;
            max-height: 80vh;
            object-fit: contain;
        }

        .close {
            position: absolute;
            top: 15px;
            right: 35px;
            color: #f1f1f1;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
        }

        .close:hover {
            color: #667eea;
        }

        .api-config-modal {
            display: none;
            position: fixed;
            z-index: 1001;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.7);
        }

        .api-config-content {
            background-color: white;
            margin: 5% auto;
            padding: 30px;
            border-radius: 15px;
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
        }

        .api-config-title {
            font-size: 1.5em;
            font-weight: bold;
            color: #333;
            margin-bottom: 20px;
            text-align: center;
        }

        .api-config-field {
            margin-bottom: 20px;
        }

        .api-config-label {
            display: block;
            font-weight: 600;
            color: #667eea;
            margin-bottom: 5px;
        }

        .api-config-input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e1e5f2;
            border-radius: 8px;
            font-size: 1em;
            font-family: inherit;
        }

        .api-config-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .api-config-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-top: 30px;
        }

        .auto-generate-btn {
            background: linear-gradient(45deg, #17a2b8, #20c997) !important;
            margin-left: 10px;
            padding: 8px 15px;
            font-size: 0.9em;
        }

        .generating {
            opacity: 0.6;
            pointer-events: none;
        }

        .generate-status {
            font-size: 0.8em;
            color: #28a745;
            margin-top: 5px;
            font-style: italic;
        }

        .load-more-button {
            display: block;
            margin: 30px auto;
            padding: 15px 30px;
            background: linear-gradient(45deg, #667eea, #764ba2);
            color: white;
            border: none;
            border-radius: 50px;
            font-size: 1.1em;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
        }

        .load-more-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
        }

        .image-counter {
            text-align: center;
            margin: 6px 0;
            color: #666;
            font-size: 1em;
        }

        .export-section {
            text-align: center;
            margin: 8px 0;
            padding: 8px;
            background: #f8f9ff;
            border-radius: 10px;
        }

        .export-button {
            padding: 6px 12px;
            background: linear-gradient(45deg, #28a745, #20c997);
            color: white;
            border: none;
            border-radius: 25px;
            font-size: 1em;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
            margin: 0 10px;
        }

        .export-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
        }

        @media (max-width: 768px) {
            .container {
                margin: 10px;
                border-radius: 10px;
            }
            
            .header {
                padding: 20px;
            }
            
            .header h1 {
                font-size: 2em;
            }
            
            .upload-section {
                padding: 8px;
            }
            
            .thumbnails-section {
                padding: 20px;
            }
            
            .thumbnails-grid {
                gap: 15px;
            }
            
            .thumbnail-item {
                flex-direction: column;
                text-align: left;
                padding: 15px;
                min-height: auto;
                gap: 15px;
            }
            
            .thumbnail-image-container {
                width: 140px;
                height: 140px;
                align-self: center;
            }
            
            .thumbnail-image {
                max-width: 140px;
                max-height: 140px;
                width: auto;
                height: auto;
            }
            
            .thumbnail-info {
                min-width: auto;
                margin-right: 0;
                text-align: center;
            }
            
            .thumbnail-metadata {
                flex-direction: column;
                gap: 15px;
            }
            
            .metadata-column {
                gap: 8px;
                flex: 1;
                display: flex;
                flex-direction: column;
                padding: 10px;
                padding-top: 4px;
                background: #f0f4ff;
                border-radius: 10px;
                border: 2px solid #28a745;
            }
            
            .thumbnail-details {
                justify-content: center;
                gap: 10px;
            }
            
            .thumbnail-index {
                align-self: center;
                margin-bottom: 10px;
            }
            
            .stats {
                gap: 15px;
            }
        }

        /* Custom Prompts Modal Styles */
        .custom-prompts-container {
            max-height: 60vh;
            overflow-y: auto;
        }

        .custom-prompts-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }

        .custom-prompts-table tr:hover {
            background-color: #f8f9ff;
        }

        .prompt-property-input {
            width: 100%;
            padding: 8px;
            border: 2px solid #e1e5f2;
            border-radius: 6px;
            font-size: 0.9em;
            font-family: inherit;
        }

        .prompt-property-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
        }

        .prompt-text-input {
            width: 100%;
            min-height: 80px;
            padding: 10px;
            border: 2px solid #e1e5f2;
            border-radius: 6px;
            font-size: 0.9em;
            font-family: inherit;
            resize: vertical;
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        .prompt-text-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
        }

        .remove-prompt-btn {
            background: #dc3545;
            color: white;
            border: none;
            border-radius: 4px;
            padding: 6px 12px;
            cursor: pointer;
            font-size: 0.8em;
            transition: background-color 0.3s ease;
        }

        .remove-prompt-btn:hover {
            background: #c82333;
        }

        .add-button {
            background: linear-gradient(45deg, #28a745, #20c997);
            color: white;
            border: none;
            border-radius: 25px;
            padding: 10px 20px;
            font-size: 0.9em;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
        }

        .add-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
        }

        .custom-prompts-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* Better responsive design for custom prompts */
        @media (max-width: 768px) {
            .custom-prompts-table,
            .custom-prompts-table thead,
            .custom-prompts-table tbody,
            .custom-prompts-table th,
            .custom-prompts-table td,
            .custom-prompts-table tr {
                display: block;
            }

            .custom-prompts-table thead tr {
                position: absolute;
                top: -9999px;
                left: -9999px;
            }

            .custom-prompts-table tr {
                border: 1px solid #ccc;
                margin-bottom: 10px;
                padding: 10px;
                border-radius: 8px;
                background: white;
            }

            .custom-prompts-table td {
                border: none;
                position: relative;
                padding: 8px 8px 8px 40%;
                text-align: left;
            }

            .custom-prompts-table td:before {
                content: attr(data-label) ": ";
                position: absolute;
                left: 6px;
                width: 35%;
                padding-right: 10px;
                white-space: nowrap;
                font-weight: bold;
                color: #667eea;
            }

            .custom-prompts-buttons {
                flex-direction: column;
                align-items: center;
            }

            .export-button,
            .add-button {
                width: 100%;
                max-width: 200px;
                margin: 5px 0;
            }
        } 

        /* confidence pill styles */
        .confidence-pill {
		display: inline-block;
		margin-left: 8px;
		padding: 2px 8px;
		border-radius: 9999px;
		font-size: 12px;
		line-height: 1;
		background: #eef2f7;
		color: #3b3f45;
		border: 1px solid #d7dde6;
        }
        .confidence-pill--hidden {
		display: none;
        }
        .confidence-pill--low {
		background: #f1f3f5;
		color: #6c757d;
		border-color: #e2e6ea;
        }
        .confidence-pill--medium {
		background: #fff3cd;
		color: #856404;
		border-color: #ffeeba;
        }
        .confidence-pill--high {
		background: #d4edda;
		color: #155724;
		border-color: #c3e6cb;
        }