/* Clean & Simple Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    /* backdrop-filter: blur(10px); - Removed for compatibility */
    background: rgba(255, 255, 255, 0.98);
    position: relative;
}

.header-actions {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-delete-all {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-delete-all:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #667eea;
}

.logo h1 {
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 10px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    /* backdrop-filter: blur(10px); - Removed for compatibility */
    background: rgba(255, 255, 255, 0.98);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    /* backdrop-filter: blur(10px); - Removed for compatibility */
    background: rgba(255, 255, 255, 0.98);
}

.tab-content.active {
    display: block;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    font-size: 1.8rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

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

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Settings Sections */
.settings-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.settings-section h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.settings-form,
.scene-config-form,
.character-config-form,
.advanced-settings-form {
    display: grid;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-inputs input {
    flex: 1;
}

.range-inputs span {
    font-weight: 600;
    color: #666;
}

/* Preview Container */
.preview-container {
    background: white;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    overflow: hidden;
}

.preview-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.preview-tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.preview-tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.preview-tab-btn.active {
    background: #667eea;
    color: white;
}

.preview-content {
    padding: 20px;
}

.preview-panel {
    display: none;
}

.preview-panel.active {
    display: block;
}

.preview-panel h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.preview-text {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    border: 1px solid #e9ecef;
    min-height: 100px;
}

/* AI Status Section */
.ai-status-section {
    background: #e3f2fd;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid #2196f3;
}

.ai-status-section h3 {
    color: #1976d2;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-display p {
    color: #333;
    margin: 0;
}

.ai-setup-section h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setup-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

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

.form-group small {
    color: #666;
    font-size: 0.8rem;
}

.api-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    font-size: 14px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.status-indicator.real-api {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Chat Section */
.ai-chat-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.ai-chat-section h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-container {
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    background: white;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.message-content {
    max-width: 70%;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.message-text {
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 15px;
}

#chatInput {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
}

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

.chat-send-btn {
    height: 60px;
    width: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Final Generation Section */
.final-generation-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

.ai-generation-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #2196f3;
}

.ai-generation-info h4 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-generation-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-generation-info li {
    padding: 8px 0;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-generation-info li::before {
    content: '✓';
    color: #4caf50;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 2px;
}

.ai-generation-info strong {
    color: #1976d2;
    font-weight: 600;
}

/* Bulk Upload Modal */
.bulk-upload-modal {
    max-width: 900px !important;
    width: 90% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 20px auto !important;
    position: relative !important;
    background: white !important;
    border-radius: 20px !important;
}

/* Reset font inheritance for modal */
.bulk-upload-modal * {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Fix Font Awesome icons in modal */
.bulk-upload-modal i[class*="fa-"] {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900;
    font-style: normal;
}

.bulk-upload-hero {
    text-align: center;
    background: #667eea;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.hero-icon i {
    display: inline-block;
}

.bulk-upload-hero h2 {
    margin: 0 0 10px 0;
    font-size: 2rem;
    font-weight: 700;
}

.bulk-upload-hero p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.bulk-upload-features {
    /* display: grid; - Replaced with compatible layout */
    /* grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); */
    /* gap: 20px; */
    margin-bottom: 25px;
    overflow: hidden;
    display: block;
}

.bulk-upload-features:after {
    content: "";
    display: table;
    clear: both;
}

.feature-card {
    background: #f8f9fa;
    background-image: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    vertical-align: top;
}

/* For table layout */
td.feature-card {
    width: 33.33%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.feature-icon {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.feature-icon i {
    display: inline-block;
    color: #667eea;
}

.feature-card h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Bulk Upload Instructions */
.bulk-upload-instructions {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #2196f3;
}

.bulk-upload-instructions h4 {
    color: #1976d2;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instruction-steps {
    /* display: grid; - Replaced with compatible layout */
    /* grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); */
    /* gap: 20px; */
    overflow: hidden;
    display: block;
}

.instruction-steps:after {
    content: "";
    display: table;
    clear: both;
}

.step {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e3f2fd;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    vertical-align: top;
}

/* For table layout */
td.step {
    width: 25%;
}

.step:hover {
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.2);
}

.step-number {
    background: #2196f3;
    background-image: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-block;
    text-align: center;
    line-height: 35px;
    font-weight: bold;
    font-size: 1.1rem;
    position: absolute;
    top: 20px;
    left: 20px;
}

.step-content {
    padding-left: 50px;
}

.step-content h5 {
    color: #1976d2;
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.step-content p {
    color: #555;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bulk-upload-area {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

.upload-header {
    /* display: flex; - Using compatible layout */
    /* justify-content: space-between; */
    /* align-items: center; */
    margin-bottom: 15px;
    overflow: hidden;
}

.upload-header h4 {
    color: #333;
    margin: 0;
    font-size: 1.2rem;
    /* display: flex; - Using inline layout */
    /* align-items: center; */
    /* gap: 10px; */
    float: left;
}

.upload-header h4 i {
    margin-right: 10px;
}

.upload-stats {
    /* display: flex; - Using float layout */
    /* gap: 15px; */
    font-size: 0.9rem;
    color: #666;
    float: right;
}

.upload-stats span {
    background: white;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
    display: inline-block;
    margin-left: 10px;
}

#bulkUploadText {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: white;
}

#bulkUploadText:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

.upload-footer {
    margin-top: 15px;
}

.paste-tips {
    /* display: flex; - Using inline-block layout */
    /* align-items: center; */
    /* gap: 10px; */
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 15px;
    color: #856404;
    font-size: 0.9rem;
}

.paste-tips i {
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
    color: #f39c12;
    font-size: 1.1rem;
}

.paste-tips span {
    display: inline-block;
    vertical-align: middle;
}

.final-generation-section h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.generation-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.generation-result {
    background: white;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #28a745;
}

.generation-result h4 {
    color: #28a745;
    margin-bottom: 15px;
}

.prompts-output {
    background: #f8f9fa !important;
    border-radius: 10px !important;
    padding: 20px !important;
    max-height: 1000px !important;
    overflow-y: auto !important;
    margin-bottom: 20px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    white-space: pre-wrap !important;
    border: 1px solid #e9ecef !important;
}

/* Style scene headers in prompts output */
.prompts-output h2 {
    color: #800000 !important; /* Maroon color */
    font-weight: bold !important;
    font-size: 1.1rem !important;
    margin: 5px 0 5px 0 !important;
    font-family: 'Courier New', monospace !important;
}


/* Lists */
.characters-list,
.scenes-list {
    display: grid;
    gap: 20px;
}

.character-item,
.scene-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.character-item:hover,
.scene-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.item-details {
    display: grid;
    gap: 10px;
}

.detail-row {
    display: flex;
    gap: 10px;
}

.detail-label {
    font-weight: 600;
    color: #666;
    min-width: 100px;
}

.detail-value {
    color: #333;
    flex: 1;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* backdrop-filter: blur(5px); - Removed for compatibility */
    overflow-y: scroll !important; /* Force scroll for entire modal */
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Special rule to ensure body doesn't interfere */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    height: auto; /* Auto height for better compatibility */
    max-height: none; /* Remove max-height restriction */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    display: block; /* Change from flex to block */
    position: relative;
    overflow: visible; /* Allow content to be visible */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    color: #333;
    font-size: 1.5rem;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    /* flex: 1; - Removed for compatibility */
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 500px; /* Fixed pixel height for better compatibility */
    position: relative;
    display: block;
}

/* Specific fix for bulk upload modal body */
.bulk-upload-modal .modal-body {
    max-height: none !important;
    overflow: visible !important;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 25px 30px;
    border-top: 2px solid #f0f0f0;
}

.bulk-upload-instructions {
    background: #e3f2fd;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

.bulk-upload-instructions h4 {
    color: #1976d2;
    margin-bottom: 10px;
}

.bulk-upload-instructions p {
    margin-bottom: 8px;
    color: #333;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Convert tables to block layout on mobile */
    .bulk-upload-features table,
    .instruction-steps table {
        display: block;
    }
    
    .bulk-upload-features tr,
    .instruction-steps tr {
        display: block;
    }
    
    td.feature-card,
    td.step {
        display: block;
        width: 100% !important;
        margin-bottom: 15px;
    }
    
    .step-number {
        position: static;
        display: block;
        margin: 0 auto 10px;
    }
    
    .step-content {
        padding-left: 0;
        text-align: center;
    }
    .container {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .nav-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-btn {
        padding: 12px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .setup-form,
    .generation-form {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
}

/* Delete All Modal */
.delete-modal {
    max-width: 600px;
    max-height: 80vh;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #dc3545;
    box-shadow: 0 20px 60px rgba(220, 53, 69, 0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.delete-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.delete-warning {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.warning-icon {
    font-size: 3rem;
    color: #856404;
    margin-bottom: 15px;
}

.delete-warning h4 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.delete-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.delete-list li {
    padding: 8px 0;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-list li i {
    color: #dc3545;
    width: 20px;
}

.warning-text {
    color: #dc3545;
    font-size: 1.1rem;
    margin-top: 15px;
}

.delete-options {
    background: white;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

.delete-options h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.checkbox-item:hover {
    background: #f8f9fa;
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #dc3545;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-item input[type="checkbox"]:checked + .checkmark {
    background: #dc3545;
    border-color: #dc3545;
}

.checkbox-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.checkbox-item i {
    color: #dc3545;
    width: 20px;
    text-align: center;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar,
.prompts-output::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.prompts-output::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb,
.prompts-output::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.prompts-output::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Generation Actions Styling */
.generation-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.generation-actions .btn {
    min-width: 150px;
}

/* Text Count Styling */
.word-count-row {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 10px;
    border-left: 4px solid #2196f3;
}

.word-count {
    font-weight: 600;
    color: #1976d2;
    background: rgba(33, 150, 243, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.detail-label {
    font-weight: 600;
    color: #1976d2;
}

/* Image Drop Zone */
.image-drop-zone {
    border: 2px dashed #6c757d;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #ffffff;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-drop-zone:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.image-drop-zone.drag-over {
    border-color: #28a745;
    background: #f0fff4;
}

.image-drop-zone i {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 10px;
    display: block;
}

.image-drop-zone span {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Image Preview */
.image-preview {
    margin: 15px 0;
    text-align: center;
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.image-preview .btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Message Image Preview */
.message-image-preview {
    margin: 10px 0;
    text-align: center;
}

.message-image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}