/* ===================================
   BulkReplaceTool - App Page Styles
   assets/css/app.css
   =================================== */

/* ===================================
   App Layout
   =================================== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 1024px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Upload Section
   =================================== */
.upload-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.upload-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.upload-header i {
    font-size: 1.125rem;
    margin-right: 0.5rem;
}

.upload-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

/* Enhanced Dropzone */
.dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: #f9fafb;
}

.dropzone:hover {
    border-color: #667eea;
    background: #fefefe;
}

.dropzone.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.02);
}

.dropzone-icon {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.dropzone:hover .dropzone-icon {
    color: #667eea;
    transform: translateY(-5px);
}

.dropzone-text {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.dropzone-subtext {
    font-size: 0.875rem;
    color: #9ca3af;
}

.dropzone-button {
    margin-top: 0.75rem;
    color: #667eea;
    font-weight: 600;
    transition: all 0.2s;
}

.dropzone-button:hover {
    color: #764ba2;
}

/* File Info Display */
.file-info {
    margin-top: 1rem;
    animation: slideIn 0.3s ease-out;
}

.file-info-card {
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.file-info-card.csv {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.file-info-card.zip {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.file-info-content {
    display: flex;
    align-items: center;
}

.file-info-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.file-info-icon.csv { color: #10b981; }
.file-info-icon.zip { color: #3b82f6; }

.file-info-details {
    display: flex;
    flex-direction: column;
}

.file-info-name {
    font-weight: 600;
    color: #111827;
}

.file-info-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.file-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ===================================
   Process Button
   =================================== */
.process-button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.process-button:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.process-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.3);
}

.process-button:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.process-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.process-button:not(:disabled):active::after {
    width: 300px;
    height: 300px;
}

/* ===================================
   Live Log Section
   =================================== */
.log-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    height: 600px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.log-title {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.log-title i {
    margin-right: 0.5rem;
    color: #667eea;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    transition: all 0.3s;
}

.status-badge.waiting {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.processing {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge i {
    font-size: 0.5rem;
    margin-right: 0.375rem;
}

/* Progress Section */
.progress-section {
    margin-bottom: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.progress-bar-container {
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Log Container */
.log-container {
    flex: 1;
    background: #1f2937;
    border-radius: 0.75rem;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Log Entries */
.log-entry {
    margin-bottom: 0.375rem;
    animation: logSlideIn 0.3s ease-out;
    padding: 0.25rem 0;
}

@keyframes logSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-info { color: #9ca3af; }
.log-success { color: #10b981; }
.log-warning { color: #f59e0b; }
.log-error { color: #ef4444; }
.log-replace { color: #3b82f6; }

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-value.green { color: #10b981; }
.stat-value.blue { color: #3b82f6; }
.stat-value.orange { color: #f59e0b; }

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* ===================================
   Download Button
   =================================== */
.download-button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    background: #10b981;
    color: white;
}

.download-button:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.3);
}

.download-button:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* ===================================
   Mobile Responsive
   =================================== */
@media (max-width: 640px) {
    .app-container {
        padding: 1rem;
    }
    
    .dropzone {
        padding: 2rem 1rem;
    }
    
    .log-section {
        height: 400px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}