/* staging_review.css */

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f6fa;
    margin: 0;
    padding: 0;
    color: #2c3e50;
    line-height: 1.4;
}

.container {
    max-width: 1200px;
    margin: 12px auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 20px;
}

.header {
    border-bottom: 2px solid #e8ecf4;
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.header h1 {
    margin: 0 0 6px 0;
    font-size: 1.8em;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 i {
    color: #3498db;
}

.header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 1.05em;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    font-size: 1em;
    margin: 15px 0;
}

.error {
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 1em;
}

.summary-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    min-width: 120px;
    flex: 1;
}

.stat-value {
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.artist-list {
    margin-top: 5px;
}

.artist-card {
    background: #ffffff;
    border: 1px solid #e8ecf4;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    transition: box-shadow 0.2s ease;
}

.artist-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.artist-card.new {
    border-left: 4px solid #2ecc71;
}

.artist-card .artist-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.artist-card .artist-header .artist-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.artist-card .artist-header .artist-status {
    font-size: 0.75em;
    color: #fff;
    background: #2ecc71;
    border-radius: 12px;
    padding: 3px 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.artist-card .artist-header .artist-status.existing {
    background: #3498db;
}

.artist-card .artist-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.artist-card .artist-actions button {
    background: #ffffff;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.artist-card .artist-actions button:hover {
    background: #f8f9fa;
    border-color: #95a5a6;
}

.artwork-list {
    margin-top: 6px;
    padding-left: 8px;
}

.artwork-card {
    background: #fefefe;
    border: 1px solid #e8ecf4;
    border-radius: 6px;
    margin-bottom: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.artwork-card.new {
    border-left: 3px solid #f39c12;
}

.artwork-info {
    flex: 1;
    min-width: 0;
}

.artwork-image {
    flex: 0 0 150px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.artwork-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.artwork-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.artwork-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.artwork-fields label {
    margin-bottom: 2px;
    font-size: 0.9em;
}

.artwork-fields input[type="text"] {
    margin-bottom: 4px;
    padding: 6px 8px;
    font-size: 0.9em;
}

.artwork-card .artwork-header .artwork-title {
    font-size: 1em;
    font-weight: 500;
    color: #2c3e50;
}

.artwork-card .artwork-header .artwork-status {
    font-size: 0.7em;
    color: #fff;
    background: #f39c12;
    border-radius: 10px;
    padding: 2px 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.artwork-card .artwork-header .artwork-status.existing {
    background: #3498db;
}

.artwork-card .artwork-actions {
    position: absolute;
    top: 8px;
    right: 170px;
    display: flex;
    gap: 6px;
}

.artwork-card .artwork-actions button {
    background: #ffffff;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.artwork-card .artwork-actions button:hover {
    background: #f8f9fa;
    border-color: #95a5a6;
}

form {
    margin: 0;
}

input[type="text"], textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95em;
    margin-bottom: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    font-family: inherit;
}

input[type="text"]:focus, textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
    display: block;
    font-size: 0.95em;
}

.keyword-group {
    margin-bottom: 10px;
}

.keyword-group .keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.keyword-group .keyword-item {
    background: #ecf0f1;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 0.9em;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #d5dbdb;
    transition: all 0.2s ease;
}

.keyword-group .keyword-item:hover {
    background: #d5dbdb;
}

.keyword-group .keyword-item .remove-keyword {
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 4px;
    font-weight: 600;
}

.keyword-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.keyword-search-bar input[type="text"] {
    width: 180px;
    margin-bottom: 0;
}

.keyword-search-bar button {
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.keyword-search-bar button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.keyword-search-list {
    max-height: 120px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 8px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 4px 0;
}

.keyword-search-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.keyword-search-item:hover {
    background: #f8f9fa;
}

/* Add scrollable keyword checkboxes */
.checkbox-group {
    max-height: 140px;
    overflow-y: auto;
    border: 1px solid #e8ecf4;
    border-radius: 6px;
    padding: 8px;
    background: #fafbfc;
    margin-bottom: 8px;
}

.checkbox-group::-webkit-scrollbar {
    width: 6px;
}

.checkbox-group::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.checkbox-group::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.checkbox-group::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.95em;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #3498db;
    color: #fff;
    transition: all 0.2s ease;
    font-weight: 500;
    text-decoration: none;
    margin: 2px;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-primary {
    background: #9b59b6;
}

.btn-primary:hover {
    background: #8e44ad;
}

/* Status badges */
.status-badge {
    font-size: 0.75em;
    color: #fff;
    border-radius: 12px;
    padding: 3px 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-new {
    background: #2ecc71;
}

.status-existing {
    background: #3498db;
}

.new-icon, .update-icon {
    font-size: 0.7em;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}

.new-icon {
    background: #f39c12;
}

.update-icon {
    background: #3498db;
}

/* Artist form sections */
.artist-item {
    background: #ffffff;
    border: 1px solid #e8ecf4;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.artist-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.artist-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.detail-section {
    background: #fafbfc;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e8ecf4;
}

.detail-section h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #ecf0f1;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(44, 62, 80, 0.2);
    backdrop-filter: blur(3px);
}

.modal-content {
    background: #fff;
    margin: 40px auto;
    padding: 24px;
    border-radius: 10px;
    width: 95%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

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

.modal .close {
    color: #95a5a6;
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 1.8em;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal .close:hover {
    color: #e74c3c;
}

/* Description containers - scrollable after max height */
.description-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e8ecf4;
    border-radius: 6px;
    padding: 8px;
    background: #fafbfc;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.description-container::-webkit-scrollbar {
    width: 6px;
}

.description-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.description-container::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.description-container::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

.description-source {
    font-weight: 600;
    color: #3498db;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ecf0f1;
}

.description-field {
    margin-bottom: 8px;
}

.description-field:last-child {
    margin-bottom: 0;
}

.description-field b {
    color: #2c3e50;
    font-weight: 500;
}

.description-field textarea {
    margin-top: 2px;
    min-height: 40px;
    resize: vertical;
}

/* Make nested descriptions more visually distinct */
.description-container .description-container {
    background: #f8f9fa;
    border-color: #dee2e6;
    margin-left: 16px;
    margin-top: 8px;
    max-height: 150px;
}

/* Responsive adjustments for descriptions */
@media (max-width: 768px) {
    .artist-details {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .description-container {
        max-height: 150px;
    }
    
    .description-field textarea {
        width: 100% !important;
        min-width: unset !important;
    }
}

/* Better spacing for description fields */
.description-field {
    margin-bottom: 8px;
}

.description-field:last-child {
    margin-bottom: 0;
}

/* Style for source labels (artsy, wikiart, etc.) */
.description-source {
    font-size: 0.95em;
    text-transform: capitalize;
    color: #3498db;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 2px solid #ecf0f1;
    font-weight: 600;
}

/* Better textarea styling within descriptions */
.description-container textarea {
    background: #ffffff;
    border: 1px solid #d1d5db;
    margin-bottom: 6px;
    font-size: 0.9em;
    line-height: 1.4;
}

.description-container textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Editable field names and values */
.field-name-value {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 2px;
}

.field-name-input {
    flex: 0 0 120px;
    min-width: 80px;
    max-width: 150px;
    height: 28px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f8f9fa;
    font-size: 0.85em;
    font-weight: 500;
    color: #2c3e50;
    resize: none;
}

.field-name-input:focus {
    border-color: #3498db;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.field-value-input {
    flex: 1;
    min-height: 28px;
    max-height: 80px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    font-size: 0.9em;
    line-height: 1.3;
    resize: vertical;
    font-family: inherit;
}

.field-value-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.source-name-input {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.9em;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 4px;
    width: 150px;
    max-width: 200px;
}

.source-name-input:focus {
    border-color: #2196f3;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* Update description-source styling */
.description-source {
    font-size: 0.95em;
    color: #3498db;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 2px solid #ecf0f1;
    font-weight: 600;
}

/* Make description fields more compact */
.description-field {
    margin-bottom: 2px;
}

.description-field:last-child {
    margin-bottom: 0;
}



/* Keywords and descriptions side-by-side layout */
.keywords-descriptions-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.keywords-section {
    display: flex;
    flex-direction: column;
}

.keywords-section label {
    margin-bottom: 8px;
    font-weight: 500;
}

.descriptions-section {
    display: flex;
    flex-direction: column;
}

.descriptions-section > div {
    margin-bottom: 8px;
}

.descriptions-section b {
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

/* Adjust checkbox group height for side-by-side layout */
.keywords-descriptions-container .checkbox-group {
    max-height: 200px;
}

/* Adjust description container height for side-by-side layout */
.keywords-descriptions-container .description-container {
    max-height: 200px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .field-name-value {
        flex-direction: column;
        gap: 4px;
    }
    
    .field-name-input {
        flex: none;
        width: 100%;
        max-width: none;
    }
    
    .source-name-input {
        width: 100%;
        max-width: none;
    }
    
    .artist-details {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .description-container {
        max-height: 150px;
    }
    
    .description-field textarea {
        width: 100% !important;
        min-width: unset !important;
    }
    
    .artwork-card {
        flex-direction: column;
        gap: 12px;
    }
    
    .artwork-image {
        flex: none;
        align-self: center;
    }
    
    .artwork-image img {
        max-width: 200px;
    }
    
    /* Stack keywords and descriptions vertically on mobile */
    .keywords-descriptions-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .keywords-descriptions-container .checkbox-group {
        max-height: 140px;
    }
    
    .keywords-descriptions-container .description-container {
        max-height: 140px;
    }
}

/* Final submission controls */
.final-controls {
    margin-top: 20px;
    padding: 15px;
    border: 2px solid #007bff;
    border-radius: 8px;
    background: #f8f9fa;
}

.final-controls h3 {
    margin: 0 0 10px 0;
    color: #007bff;
    font-size: 1.2em;
}

.final-controls p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 0.95em;
}

/* Artist actions */
.artist-actions {
    margin-top: 20px;
    padding: 15px;
    border-top: 2px solid #ddd;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.artist-actions .btn {
    font-size: 1.1em;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.artist-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.artist-actions .btn-primary {
    background: #007bff;
    color: white;
}

.artist-actions .btn-primary:hover {
    background: #0056b3;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

.status-indicator.success {
    color: #28a745;
}

.status-indicator.error {
    color: #dc3545;
}

.status-indicator.info {
    color: #007bff;
}
