/* Custom Styles for Asset File Mapping Tool */

/* Color Variables */
:root {
    --success-green-bg: #dcfce7;
    --success-green-text: #16a34a;
    --success-green-border: #86efac;

    --error-red-bg: #fee2e2;
    --error-red-text: #dc2626;
    --error-red-border: #fca5a5;

    --warning-orange-bg: #fed7aa;
    --warning-orange-text: #ea580c;
    --warning-orange-border: #fdba74;

    --info-blue-bg: #dbeafe;
    --info-blue-text: #0891b2;
    --info-blue-border: #7dd3fc;

    --primary-accent: #0891b2;
    --bg-gray: #f9fafb;
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f4f6;
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Step Transitions */
.workflow-step {
    transition: all 0.3s ease;
}

.workflow-step.active .step-card {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.step-card.step-completed {
    border-color: #34D399; /* Tailwind Green 400 */
    border-width: 2px;
}

.workflow-step .step-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.workflow-step .step-summary {
    transition: opacity 0.3s ease;
}

/* Step Arrow Animation */
.step-arrow {
    animation: fadeIn 0.5s ease;
}

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

/* Drag and Drop Zones */
.border-dashed {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.border-dashed.drag-over {
    border-color: var(--primary-accent);
    background-color: var(--info-blue-bg);
}

/* Toast Notifications */
.toast {
    min-width: 300px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.toast.success {
    background-color: var(--success-green-bg);
    border-left: 4px solid var(--success-green-text);
    color: var(--success-green-text);
}

.toast.error {
    background-color: var(--error-red-bg);
    border-left: 4px solid var(--error-red-text);
    color: var(--error-red-text);
}

.toast.warning {
    background-color: var(--warning-orange-bg);
    border-left: 4px solid var(--warning-orange-text);
    color: var(--warning-orange-text);
}

.toast.info {
    background-color: var(--info-blue-bg);
    border-left: 4px solid var(--info-blue-text);
    color: var(--info-blue-text);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.data-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.data-table tr.row-success {
    background-color: var(--success-green-bg);
}

.data-table tr.row-error {
    background-color: var(--error-red-bg);
}

.data-table tr.row-warning {
    background-color: var(--warning-orange-bg);
}

.data-table tr.row-info {
    background-color: var(--info-blue-bg);
}

/* Thumbnail Styles */
.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* Table Row Hover */
.table-row-hover {
    transition: background-color 0.15s ease;
}

.table-row-hover:hover {
    background-color: rgba(8, 145, 178, 0.05) !important;
}

/* File Icon Preview with Hover */
.file-icon-preview {
    font-size: 24px;
    cursor: pointer;
    display: inline-block;
    position: relative;
}

.file-icon-preview:hover::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-top: 8px;
    width: 250px;
    height: 250px;
    background-image: attr(data-preview-path);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 100;
    pointer-events: none;
}

/* Hover Preview Tooltip */
.preview-tooltip {
    position: absolute;
    display: none;
    z-index: 1000;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    max-width: 320px;
}

.preview-tooltip img {
    max-width: 280px;
    max-height: 280px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.preview-tooltip.active {
    display: block;
    animation: tooltipFadeIn 0.15s ease-out;
}

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

.preview-tooltip-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.preview-tooltip-filename {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-all;
    line-height: 1.4;
}

.preview-tooltip-meta {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-accent);
    transition: width 0.3s ease;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: color 0.2s ease;
}

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

.modal-body {
    padding: 24px;
}

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

.match-column {
    background-color: #f9fafb;
    padding: 16px;
    border-radius: 8px;
}

.preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 4px;
}

.file-info {
    background-color: white;
    padding: 12px;
    border-radius: 6px;
}

.info-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
}

.info-value {
    color: #1f2937;
    font-size: 13px;
}

.btn-secondary {
    padding: 8px 16px;
    background-color: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

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

/* Button States */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .step-card {
        border-radius: 8px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* Utility Classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

/* Scrollbar Styling */
.scrollbar-thin::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   PROGRESS STEPPER STYLES
   ======================================== */

/* Progress Stepper Container */
#progressStepper {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Step Circle - Default (Pending) */
.step-circle {
    background-color: #f3f4f6; /* Gray background */
    border-color: #d1d5db; /* Gray border */
    color: #9ca3af; /* Gray text */
}

/* Step Circle - Current (Active) */
.step-circle.current {
    background-color: #dbeafe; /* Light blue background */
    border-color: #0891b2; /* Blue border */
    color: #0891b2; /* Blue text */
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Step Circle - Completed */
.step-circle.completed {
    background-color: #34D399; /* Green background */
    border-color: #34D399; /* Green border */
    color: white; /* White checkmark */
}

/* Step Label - Default */
.step-label {
    color: #9ca3af; /* Gray text */
}

/* Step Label - Current */
.step-label.current {
    color: #0891b2; /* Blue text */
}

/* Step Label - Completed */
.step-label.completed {
    color: #16a34a; /* Green text */
}

/* Step Item - Add pointer cursor only for completed steps */
.step-item.completed {
    cursor: pointer;
}

.step-item.completed:hover .step-circle {
    transform: scale(1.1);
}

/* Step Item - Disable pointer for pending/current steps */
.step-item.pending,
.step-item.current {
    cursor: default;
}

/* Progress Line Animation */
.progress-line > div {
    transition: width 0.5s ease-in-out;
}

/* Pulsing Animation for Current Step */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(8, 145, 178, 0.2);
    }
}

/* Mobile Responsive - Horizontal Scroll */
@media (max-width: 768px) {
    #progressStepper .flex {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    #progressStepper .flex::-webkit-scrollbar {
        height: 4px;
    }

    #progressStepper .flex::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    #progressStepper .flex::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 2px;
    }

    .step-circle {
        width: 36px !important;
        height: 36px !important;
        font-size: 12px;
    }

    .step-label {
        font-size: 10px;
    }

    .progress-line {
        min-width: 40px;
        flex: 0 0 40px;
    }
}

/* ========================================
   TYPE BADGES (Image/Video)
   ======================================== */

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Image - Blue badge */
.type-image {
    background-color: #3B82F6;
    color: white;
}

/* Video - Purple badge */
.type-video {
    background-color: #8B5CF6;
    color: white;
}

/* Unknown - Gray badge */
.type-unknown {
    background-color: #9ca3af;
    color: white;
}

/* ========================================
   AIRTABLE STATUS BADGES
   ======================================== */

/* Already Uploaded - Orange badge */
.airtable-already-uploaded {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #FFA500;
    color: white;
    white-space: nowrap;
}

/* Not Yet Uploaded - Green badge */
.airtable-not-uploaded {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #22c55e;
    color: white;
    white-space: nowrap;
}

/* Unknown - Gray badge (when Airtable check failed) */
.airtable-unknown {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #9ca3af;
    color: white;
    white-space: nowrap;
}
