/* Memorial Video AI - Internal QA Review Gallery */
/* https://internalreview.memorialvideo.ai/ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 20px;
    border: 1px solid #2d3748;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #f39c12;
    font-size: 24px;
    font-weight: 700;
}

.order-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #a0aec0;
}

.order-info strong {
    color: #e0e0e0;
    font-family: monospace;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: #16213e;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid #2d3748;
}

.action-bar-left,
.action-bar-center,
.action-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-bar-center {
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 16px;
}

.btn-save {
    background: #3498db;
    color: white;
}

.btn-save:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-approve {
    background: #27ae60;
    color: white;
}

.btn-approve:hover:not(:disabled) {
    background: #219a52;
    transform: translateY(-1px);
}

.btn-reject {
    background: #e74c3c;
    color: white;
}

.btn-reject:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #4a5568;
    color: white;
}

.btn-secondary:hover {
    background: #2d3748;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-timer {
    background: #6c5ce7;
    color: white;
}

.btn-timer:hover:not(:disabled) {
    background: #5b4cdb;
    transform: translateY(-1px);
}

/* Save Status */
.save-status {
    font-size: 13px;
    color: #a0aec0;
}

.save-status.saved {
    color: #27ae60;
}

.save-status.saving {
    color: #f39c12;
}

.save-status.error {
    color: #e74c3c;
}

/* Instructions */
.instructions {
    background: #2d3748;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #a0aec0;
    border-left: 4px solid #f39c12;
}

.instructions strong {
    color: #e0e0e0;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #2d3748;
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: #a0aec0;
    font-size: 16px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    background: #16213e;
    border-radius: 12px;
    border: 1px solid #e74c3c;
}

.error-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.error-state h2 {
    color: #e74c3c;
    margin-bottom: 10px;
}

.error-state p {
    color: #a0aec0;
}

.error-detail {
    font-family: monospace;
    font-size: 12px;
    margin-top: 15px;
    padding: 10px;
    background: #1a1a2e;
    border-radius: 6px;
}

/* Gallery */
.gallery-container {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #2d3748;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* Photo Item */
.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    background: #1a1a2e;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.photo-item:hover {
    border-color: #f39c12;
    transform: scale(1.02);
}

.photo-item:active {
    cursor: grabbing;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-item.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #2d3748;
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
}

.photo-item.loading img {
    opacity: 0;
}

/* Photo Number Badge */
.photo-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #f39c12;
    font-size: 12px;
    font-weight: 700;
    font-family: monospace;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
}

/* Age Bucket Badge */
.age-bucket {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #a0aec0;
    font-size: 10px;
    font-family: monospace;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 10;
}

/* Sortable States */
.sortable-ghost {
    opacity: 0.4;
    border-color: #f39c12 !important;
}

.sortable-chosen {
    border-color: #3498db !important;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.4);
}

.sortable-drag {
    opacity: 1 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Bottom Actions */
.bottom-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    margin-top: 20px;
    background: #16213e;
    border-radius: 12px;
    border: 1px solid #2d3748;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

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

.modal-content {
    background: #16213e;
    border-radius: 16px;
    padding: 30px 40px;
    max-width: 500px;
    width: 90%;
    border: 1px solid #2d3748;
    animation: slideUp 0.2s ease-out;
}

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

.modal-content h2 {
    color: #e0e0e0;
    margin-bottom: 15px;
}

.modal-content p {
    color: #a0aec0;
    margin-bottom: 15px;
}

.modal-content textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #2d3748;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 20px;
}

.modal-content textarea:focus {
    outline: none;
    border-color: #3498db;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirm-icon {
    font-size: 50px;
    text-align: center;
    margin-bottom: 15px;
}

/* Changed Indicator */
.order-changed {
    background: #f39c12;
    color: #1a1a2e;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-bar {
        flex-direction: column;
    }

    .action-bar-left,
    .action-bar-right {
        width: 100%;
        justify-content: center;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
