/* Image Manager Styles */

/* Modal Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* WordPress Instructions Modal */
.wordpress-instructions-modal {
    max-width: 700px;
}

.warning-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    margin-bottom: 24px;
}

.warning-box i {
    color: #f59e0b;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.warning-box p {
    margin: 0;
    color: #92400e;
    font-size: 0.9rem;
}

.instruction-section {
    margin-bottom: 32px;
}

.instruction-section h4 {
    color: #1f2937;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.instruction-section ol {
    margin: 12px 0;
    padding-left: 24px;
    color: #4b5563;
    line-height: 1.8;
}

.url-copy-box {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.url-copy-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: #f9fafb;
}

.download-buttons {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.help-section {
    padding: 20px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    margin-top: 24px;
}

.help-section h4 {
    color: #1e40af;
    margin-bottom: 12px;
}

.help-section p {
    color: #1e3a8a;
    margin-bottom: 12px;
}

/* AI Tools Modal */
.ai-tools-modal {
    max-width: 900px;
}

.prompt-section {
    background: #f3f4f6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.prompt-section h4 {
    color: #1f2937;
    margin-bottom: 12px;
    font-size: 1rem;
}

.prompt-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 12px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tool-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.tool-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.tool-card.recommended {
    border-color: #10b981;
    background: linear-gradient(to bottom, #f0fdf4, #fff);
}

.recommended-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.tool-card h4 {
    color: #1f2937;
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.tool-description {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 8px 0;
    line-height: 1.5;
}

.tool-free {
    color: #059669;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 12px 0;
}

.tool-card .btn {
    width: 100%;
    margin-top: 12px;
}

.instructions-box {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 20px;
}

.instructions-box h4 {
    color: #1e40af;
    margin-bottom: 12px;
}

.instructions-box ol {
    color: #1e3a8a;
    padding-left: 24px;
    line-height: 1.8;
}

/* Article Images Section */
.article-images-section {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: center;
}

.images-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.images-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.images-header h3 i {
    color: #3b82f6;
}

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

/* Featured Image Preview */
.featured-image-preview {
    background: white;
    border: 2px solid #FF9900;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 24px;
    overflow: hidden;
    width: 100%;
}

.image-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 12px 16px 0;
    display: block;
}

.featured-img {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    display: block;
    margin: 0;
    background: #FFFFFF;
    object-fit: contain;
    object-position: center;
}

.image-error {
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 16px;
}

.image-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 12px 16px;
}

/* Additional Images */
.additional-images {
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    padding: 20px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.image-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.image-item img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 8px;
}

.image-size {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.image-item .btn {
    width: 100%;
}

/* Button Sizes */
.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        margin: 0;
        border-radius: 12px 12px 0 0;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .images-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .images-actions {
        width: 100%;
    }
    
    .images-actions .btn {
        flex: 1;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-buttons .btn {
        width: 100%;
    }
    
    .url-copy-box {
        flex-direction: column;
    }
    
    .url-copy-box .btn {
        width: 100%;
    }
}

/* Print styles (hide images when printing article) */
@media print {
    .article-images-section {
        display: none;
    }
}

/* AI Generation Modal Styles */
.ai-generation-modal {
    max-width: 600px;
}

.generation-progress {
    text-align: center;
    padding: 40px 20px;
}

.progress-spinner {
    margin-bottom: 24px;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 12px 0 4px 0;
}

.progress-subtext {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.prompt-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0;
    text-align: left;
}

.prompt-preview strong {
    display: block;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.prompt-preview p {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.6;
}

.generation-tips {
    text-align: left;
    padding: 16px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    margin-top: 20px;
}

.generation-tips h4 {
    color: #1e40af;
    font-size: 0.95rem;
    margin: 0 0 12px 0;
}

.generation-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #1e3a8a;
    font-size: 0.85rem;
}

.generation-tips li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Generation Success */
.generation-success {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.generation-success h3 {
    color: #059669;
    margin: 0 0 8px 0;
}

.generation-success p {
    color: #6b7280;
    margin: 0 0 24px 0;
}

.generated-image-preview {
    margin: 24px 0;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.generated-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.image-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Generation Error */
.generation-error {
    text-align: center;
    padding: 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.generation-error h3 {
    color: #dc2626;
    margin: 0 0 12px 0;
}

.error-message {
    color: #6b7280;
    margin: 0 0 24px 0;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.error-help {
    text-align: left;
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    margin-top: 20px;
}

.error-help h4 {
    color: #92400e;
    font-size: 0.95rem;
    margin: 0 0 12px 0;
}

.error-help ul {
    margin: 0;
    padding-left: 20px;
    color: #78350f;
    font-size: 0.85rem;
}

.error-help li {
    margin-bottom: 8px;
    line-height: 1.5;
}

