/**
 * FINEART Edit Gallery Styles - Visual Layout Version
 * 
 * Mirrors the public gallery page layout for intuitive editing
 * 
 * @package FINEART
 * @since 3.3
 */

/* =====================================================
   BASE WRAPPER
   ===================================================== */

.fineart-edit-gallery-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Oswald', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =====================================================
   EDIT SECTIONS
   ===================================================== */

.edit-section {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.section-preview {
    position: relative;
}

.section-form {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

/* =====================================================
   SECTION 1: COVER PHOTO
   ===================================================== */

.cover-section .cover-preview {
    height: 280px;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.cover-section .cover-preview:before {
    content: "";
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    background-color: #00000063;
    z-index: 0;
    width: 100%;
    display: block;
    height: 100%;
    position: absolute;
}

.cover-overlay {
    text-align: center;
    color: #fff;
    z-index: 1;
    padding: 20px;
}

.cover-label {
    display: block;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.cover-title {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0 0 16px 0;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.cover-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cover-tag-divider {
    opacity: 0.5;
}

/* Cover Upload Overlay */
.cover-upload-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cover-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cover-upload-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.cover-requirements {
    margin: 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* =====================================================
   SECTION 2: SHORT BIO
   ===================================================== */

.short-bio-section .short-bio-preview {
    padding: 40px 24px;
    text-align: center;
    background: #0a0a0a;
    color: #fff;
}

.preview-label {
    display: block;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.preview-short-bio {
    margin: 0;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    max-width: 700px;
    margin: 0 auto;
}

/* =====================================================
   SECTION 3: ARTIST IMAGE + LONG BIO
   ===================================================== */

.artist-section {
    background: transparent;
    box-shadow: none;
}

.artist-section-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}

/* Artist Card */
.artist-card-wrapper {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.artist-card-preview {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.artist-card {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.artist-card-image {
    width: 100%;
    aspect-ratio: 1;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    position: relative;
}

.artist-card-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
}

.artist-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
}

.artist-card-label {
    display: block;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.artist-card-name {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color:#fff;
}

.artist-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.artist-card-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Artist Image Upload Button */
.artist-image-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #1a1a1a;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.artist-image-upload-btn:hover {
    background: #333;
    transform: translateY(-2px);
}

.upload-hint {
    margin: 0;
    font-size: 12px;
    color: #999;
}

/* Long Bio */
.long-bio-wrapper {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.long-bio-preview {
    padding: 32px 28px;
    flex: 1;
    background: #0a0a0a;
}

.preview-long-bio {
    margin: 0;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
}

/* =====================================================
   SECTION 4: SOCIAL LINKS
   ===================================================== */

.social-section {
    background: #fff;
}

.section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    transition: background 0.2s ease;
}

.section-toggle:hover {
    background: #f9f9f9;
}

.toggle-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-chevron {
    color: #999;
    transition: transform 0.3s ease;
}

.section-toggle.active .toggle-chevron {
    transform: rotate(180deg);
}

.section-collapsible {
    padding: 0 24px 24px;
    border-top: 1px solid #f0f0f0;
}

.section-description {
    margin: 20px 0;
    font-size: 14px;
    color: #666;
}

.social-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.social-link-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.social-link-field label svg {
    color: #888;
}

.social-link-field input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Oswald', sans-serif;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.social-link-field input:focus {
    outline: none;
    border-color: #333;
    background: #fff;
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group .required {
    color: #ef4444;
    margin-left: 4px;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    background: #fff;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.field-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #888;
}

/* Word Counter */
.word-counter {
    font-weight: 500;
    color: #888;
    font-size: 11px;
}

.word-counter.exceeded {
    color: #ef4444;
}

.word-counter .current-words {
    font-weight: 700;
}

/* =====================================================
   FORM ACTIONS
   ===================================================== */

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-actions .button-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #1a1a1a;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions .button-primary:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.form-actions .button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.view-gallery-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.view-gallery-link:hover {
    background: #f5f5f5;
    color: #333;
}

/* =====================================================
   MESSAGES
   ===================================================== */

.form-messages {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid;
}

.form-messages.success {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.form-messages.error {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.form-messages p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* =====================================================
   CROP MODAL
   ===================================================== */

.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.crop-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.crop-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.crop-modal-header .close-modal {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crop-modal-header .close-modal:hover {
    background: #ef4444;
    color: #fff;
}

.crop-modal-body {
    padding: 24px;
    flex: 1;
    overflow: auto;
    background: #f9f9f9;
}

.crop-container {
    max-width: 100%;
    max-height: 500px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.crop-container img {
    max-width: 100%;
    display: block;
}

.crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #eee;
}

.crop-modal-footer .button {
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crop-modal-footer .button-secondary {
    background: #f5f5f5;
    border: none;
    color: #666;
}

.crop-modal-footer .button-secondary:hover {
    background: #eee;
}

.crop-modal-footer .button-primary {
    background: #10b981;
    border: none;
    color: #fff;
}

.crop-modal-footer .button-primary:hover {
    background: #059669;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {
    .artist-section-grid {
        grid-template-columns: 1fr;
    }
    
    .artist-card-wrapper {
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .fineart-edit-gallery-wrapper {
        padding: 0 16px;
    }
    
    .cover-section .cover-preview {
        height: 220px;
    }
    
    .cover-title {
        font-size: 28px;
        letter-spacing: 2px;
    }
    
    .short-bio-section .short-bio-preview {
        padding: 30px 20px;
    }
    
    .social-links-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-gallery-link {
        margin-left: 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .cover-section .cover-preview {
        height: 180px;
    }
    
    .cover-title {
        font-size: 24px;
    }
    
    .cover-upload-btn {
        padding: 10px 18px;
        font-size: 12px;
    }
    
    .artist-card-name {
        font-size: 18px;
    }
}


/* =====================================================
   COMPLETION BANNER
   ===================================================== */

.completion-banner {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.completion-banner.incomplete {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
}

.completion-banner.complete {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
}

.completion-banner-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.completion-banner.incomplete .completion-banner-icon {
    background: #f59e0b;
    color: #fff;
}

.completion-banner.complete .completion-banner-icon {
    background: #10b981;
    color: #fff;
}

.completion-banner-content {
    flex: 1;
}

.completion-banner-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.completion-banner-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #4a4a4a;
}

/* Missing Fields List */
.missing-fields-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.missing-fields-list li {
    margin: 0;
}

.missing-field-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #dc2626;
    text-decoration: none;
    transition: all 0.2s ease;
}

.missing-field-link:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #b91c1c;
    transform: translateY(-1px);
}

.missing-field-link svg {
    opacity: 0.7;
}

/* Progress Indicator */
.completion-banner-progress {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress-text {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ef4444;
}

.progress-text.complete {
    color: #10b981;
}

.progress-bar {
    width: 80px;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.completion-banner.complete .progress-fill {
    background: #10b981;
}

/* =====================================================
   REQUIRED FIELD HIGHLIGHTING
   ===================================================== */

/* Section with required field */
.edit-section.field-required {
    position: relative;
}

.edit-section.field-required::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

/* Artist card wrapper with required */
.artist-card-wrapper.field-required {
    position: relative;
}

.artist-card-wrapper.field-required::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

/* Required badge on buttons */
.required-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Required label next to field label */
.required-label {
    display: inline-block;
    padding: 2px 8px;
    background: #fef2f2;
    color: #ef4444;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-left: auto;
}

/* Optional label */
.optional-label {
    display: inline-block;
    padding: 2px 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-left: auto;
}

/* Form group with required field */
.form-group.field-required label {
    color: #b91c1c;
}

/* Input with required styling */
.form-group.field-required input,
.form-group.field-required textarea,
.input-required {
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

.form-group.field-required input:focus,
.form-group.field-required textarea:focus,
.input-required:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Highlighted upload buttons */
.highlight-required {
    animation: pulse-required 2s ease-in-out infinite;
}

@keyframes pulse-required {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.cover-upload-btn.highlight-required {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

.artist-image-upload-btn.highlight-required {
    background: #ef4444;
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */

@media (max-width: 768px) {
    .completion-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .completion-banner-icon {
        margin: 0 auto;
    }
    
    .missing-fields-list {
        justify-content: center;
    }
    
    .completion-banner-progress {
        width: 100%;
    }
    
    .progress-bar {
        width: 100%;
        max-width: 200px;
    }
}

/* Flash highlight when scrolling to field */
@keyframes flash-highlight {
    0%, 100% { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3); }
}

.edit-section.highlight-flash,
.artist-card-wrapper.highlight-flash {
    animation: flash-highlight 0.5s ease-in-out 3;
}