.tabs {
    display: flex;
    border-bottom: 1px solid rgba(60, 60, 60, 0.3);
    margin-bottom: 30px;
    gap: 8px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border: none;
    background: rgba(40, 40, 40, 0.4);
    border-radius: 12px 12px 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #a0a0a0;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.tab.active {
    color: #f8fafc;
    background: rgba(255, 165, 0, 0.2);
    border-bottom: 2px solid #ff8c00;
}

.tab:hover {
    color: #f8fafc;
    background: rgba(60, 60, 60, 0.4);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.style-option {
    background: rgba(20, 20, 20, 0.5);
    border: 1px solid rgba(80, 80, 80, 0.3);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.style-option:hover {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.1);
    transform: translateY(-2px);
}

.style-option.selected {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.style-option h4 {
    margin-bottom: 8px;
    color: #f1f5f9;
    font-weight: 600;
    font-size: 1rem;
}

.style-option p {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* ============================================================================
   Custom Style Transfer Panel
   ============================================================================ */

/* Custom Style Panel Container */
.custom-style-panel {
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid rgba(80, 80, 80, 0.3);
    border-radius: 20px;
    padding: 28px;
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

.custom-style-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(80, 80, 80, 0.2);
}

.custom-style-header h3 {
    color: #f1f5f9;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.custom-style-header p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

/* Image Slots Grid */
.custom-image-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.image-slot {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(80, 80, 80, 0.3);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s ease;
    min-width: 0;
    overflow: hidden;
}

.image-slot:hover {
    border-color: rgba(255, 140, 0, 0.3);
    background: rgba(20, 20, 20, 0.8);
}

/* Slot Header */
.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.slot-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-clear-slot {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.btn-clear-slot:hover {
    background: rgba(220, 53, 69, 0.4);
    border-color: #dc3545;
    transform: scale(1.1);
}

/* Upload Area */
.slot-upload-area {
    background: rgba(30, 30, 30, 0.5);
    border: 2px dashed rgba(80, 80, 80, 0.4);
    border-radius: 12px;
    padding: 24px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.slot-upload-area:hover {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.05);
}

.slot-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-icon-small {
    font-size: 2rem;
    opacity: 0.6;
}

.upload-text {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Image Preview */
.slot-preview {
    position: relative;
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
    height: 150px;
    overflow: hidden;
}

.slot-preview-img {
    width: 100%;
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(80, 80, 80, 0.3);
}

.slot-preview-info {
    margin-top: 8px;
    padding: 8px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 8px;
}

.preview-filename {
    font-size: 0.8rem;
    color: #f1f5f9;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* URL Input Section */
.slot-url-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.slot-url-input .form-control {
    flex: 1;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(80, 80, 80, 0.4);
    border-radius: 8px;
    color: #f1f5f9;
    transition: all 0.3s ease;
}

.slot-url-input .form-control:focus {
    outline: none;
    border-color: #ff8c00;
    background: rgba(30, 30, 30, 1);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.btn-fetch-url {
    background: rgba(255, 140, 0, 0.2);
    border: 1px solid rgba(255, 140, 0, 0.4);
    color: #ff8c00;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-fetch-url:hover:not(:disabled) {
    background: rgba(255, 140, 0, 0.3);
    border-color: #ff8c00;
    transform: translateY(-1px);
}

.btn-fetch-url:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Image Count Display */
.image-count-display {
    text-align: center;
    padding: 12px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(80, 80, 80, 0.3);
}

#imageCountText {
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* Custom Style Option (in predefined grid) */
.style-option-custom {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
    border: 2px solid rgba(255, 140, 0, 0.3);
}

.style-option-custom:hover {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.2) 0%, rgba(255, 140, 0, 0.1) 100%);
    border-color: #ff8c00;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .custom-image-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile (below 768px) */
@media (max-width: 768px) {
    .custom-style-panel {
        padding: 20px 16px;
    }

    .custom-image-slots {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .slot-preview {
        width: 100%;
        max-width: 100%;
        height: 120px;
    }

    .slot-preview-img {
        width: 100%;
        max-width: 100%;
        height: 120px;
    }

    .custom-style-header h3 {
        font-size: 1.2rem;
    }

    .custom-style-header p {
        font-size: 0.85rem;
    }
}

.chat-container {
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid rgba(80, 80, 80, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    max-height: 350px;
    overflow-y: auto;
}

/* Custom scrollbar for chat container */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(40, 40, 40, 0.3);
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

.chat-message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.5;
}

.chat-message.user {
    background: rgba(255, 140, 0, 0.15);
    margin-left: 24px;
    border: 1px solid rgba(255, 140, 0, 0.2);
}

.chat-message.ai {
    background: rgba(139, 92, 46, 0.2);
    margin-right: 24px;
    border: 1px solid rgba(139, 92, 46, 0.3);
}

/* ============================================================================ */
/* Smart Generation Chat - Example Lists Styling */
/* ============================================================================ */

.chat-message .chat-sender {
    font-weight: 600;
    color: #f8fafc;
    margin-right: 8px;
    display: inline-block;
}

/* Different colors for user vs AI labels */
.chat-message.user .chat-sender {
    color: #ff8c00;
}

.chat-message.ai .chat-sender {
    color: #a78bfa;
}

.chat-message .chat-text {
    margin: 8px 0;
    line-height: 1.6;
    color: #cbd5e1;
}

.chat-message .chat-examples {
    margin: 12px 0 16px 0;
    padding: 0;
    list-style-type: none;
}

.chat-message .chat-examples li {
    position: relative;
    padding: 10px 12px 10px 32px;
    font-size: 14px;
    line-height: 1.5;
    color: #e2e8f0;
    margin-bottom: 8px;
    background: rgba(40, 40, 40, 0.4);
    border-left: 3px solid #8b5cf6;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.chat-message .chat-examples li:before {
    content: "→";
    position: absolute;
    left: 12px;
    top: 10px;
    color: #a78bfa;
    font-weight: bold;
    font-size: 16px;
}

/* User message arrows - orange theme */
.chat-message.user .chat-examples li:before {
    color: #ff8c00;
}

.chat-message .chat-examples li:hover {
    background: rgba(139, 92, 246, 0.15);
    border-left-color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateX(2px);
}

.chat-message .chat-examples li:last-child {
    margin-bottom: 0;
}

/* User messages - different styling */
.chat-message.user .chat-examples li {
    background: rgba(255, 140, 0, 0.1);
    border-left-color: #ff8c00;
    border-color: rgba(255, 140, 0, 0.2);
}

.chat-message.user .chat-examples li:hover {
    background: rgba(255, 140, 0, 0.2);
    border-color: rgba(255, 140, 0, 0.3);
}

/* AI messages - enhanced styling with clickable behavior */
.chat-message.ai .chat-examples li {
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.15);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.chat-message.ai .chat-examples li:hover {
    background: rgba(139, 92, 246, 0.12);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.25);
}

.chat-message.ai .chat-examples li:active {
    transform: translateX(4px);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 1px 2px rgba(139, 92, 246, 0.15);
}

/* Code snippets in chat messages */
.chat-message code {
    background: rgba(40, 40, 40, 0.6);
    color: #a78bfa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
}

.chat-message pre {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    overflow-x: auto;
    color: #e2e8f0;
}

.chat-message pre code {
    background: transparent;
    padding: 0;
}

@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tab {
        flex: 1;
        min-width: 100px;
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    .style-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}