/* tools/upload-images/assets/style.css */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--gray-600);
}

/* System Check */
.system-check {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.system-check h3 {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.system-check ul {
    list-style: none;
}

.system-check li {
    padding: 0.5rem 0;
    color: var(--gray-600);
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--gray-50);
}

.upload-area:hover {
    border-color: var(--primary);
    background: #F5F3FF;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: #EEF2FF;
    transform: scale(1.02);
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-btn {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.file-input {
    display: none;
}

/* Action Buttons */
.action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-dark);
}

.action-btn.secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.action-btn.secondary:hover {
    background: var(--gray-50);
}

/* Status Section */
.status-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.status-card {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.status-card.processing {
    background: #EFF6FF;
}

.status-card.success {
    background: #F0FDF4;
}

.status-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.status-label {
    color: var(--gray-600);
    text-transform: uppercase;
    font-size: 0.875rem;
}

/* Progress Bar */
.progress-container {
    background: var(--gray-200);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 2rem 0;
}

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

/* Log Container */
.log-container {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.log-messages {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.log-entry {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
}

.log-entry.info {
    background: #EFF6FF;
    color: #3730A3;
}

.log-entry.success {
    background: #D1FAE5;
    color: #065F46;
}

.log-entry.error {
    background: #FEE2E2;
    color: #991B1B;
}

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

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content pre {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.875rem;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

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

/* Spinner */
.spinner {
    animation: spin 1s linear infinite;
}

.spinner-circle {
    stroke-dasharray: 63;
    stroke-dashoffset: 63;
    animation: draw 1.5s ease-in-out infinite;
}

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

@keyframes draw {
    0% { stroke-dashoffset: 63; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -63; }
}

/* File List Optimization */
.selected-files {
    margin: 1.5rem 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.file-item:hover {
    background: var(--gray-100);
}

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

.file-name {
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.file-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: all 0.2s;
}

.file-remove:hover {
    color: var(--danger);
    transform: scale(1.2);
}

/* Files Summary */
.files-summary {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.files-summary h3 {
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.files-summary p {
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.btn-show-details, .btn-clear-all {
    background: white;
    border: 1px solid var(--gray-300);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    margin: 0 0.25rem;
}

.btn-show-details:hover, .btn-clear-all:hover {
    background: var(--gray-100);
}

.btn-clear-all {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-clear-all:hover {
    background: #FEE2E2;
}

.arrow-icon {
    display: inline-block;
    transition: transform 0.3s;
    vertical-align: middle;
    margin-left: 0.25rem;
}

/* File Details */
.file-details {
    margin-top: 1rem;
}

.file-list-scrollable {
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.5rem;
}

.file-item-compact {
    display: grid;
    grid-template-columns: 30px 1fr 80px 30px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
}

.file-item-compact:last-child {
    border-bottom: none;
}

.file-item-compact:hover {
    background: var(--gray-50);
}

.file-index {
    color: var(--gray-500);
}

.file-name-compact {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-700);
}

.file-size-compact {
    color: var(--gray-500);
    text-align: right;
}

.file-remove-compact {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.file-remove-compact:hover {
    background: var(--danger);
    color: white;
}