/* Modern CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    min-height: 100vh;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl) 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.header h1 i {
    color: var(--primary-color);
    font-size: 2.25rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

/* Tab Styles */
.tab {
    display: flex;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.tab button {
    flex: 1;
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: var(--spacing-lg) var(--spacing-xl);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.tab button:hover {
    background-color: var(--background-color);
    color: var(--text-primary);
}

.tab button.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab button i {
    font-size: 1.125rem;
}

/* Tab Content */
.tabcontent {
    display: none;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.tabcontent h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.tabcontent h4 {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

/* Drop Zone Styles */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    background-color: var(--background-color);
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.02);
}

.drop-zone.active {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
    transform: scale(1.01);
}

.drop-zone-content {
    text-align: center;
}

.drop-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    display: block;
}

.drop-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: var(--spacing-lg);
}

.folder-structure {
    background-color: var(--surface-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    text-align: left;
    margin-top: var(--spacing-lg);
}

.folder-structure p {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.folder-structure pre {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background-color: var(--background-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin: 0;
}

/* File List Styles */
.file-list {
    background-color: var(--background-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-color);
}

.file-list h4 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.file-list ul {
    list-style: none;
    padding-left: var(--spacing-lg);
}

.file-list li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
}

.file-list > div > strong {
    color: var(--primary-color);
    font-weight: 600;
    display: block;
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #475569;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Progress Container */
.progress-container {
    background-color: var(--background-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    border: 1px solid var(--border-color);
}

.progress-container h4 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    font-weight: 600;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 16px;
    background: linear-gradient(90deg, var(--border-color) 0%, #f1f5f9 50%, var(--border-color) 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: progressBarPulse 2s ease-in-out infinite;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    animation: backgroundShimmer 3s ease-in-out infinite;
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, 
        var(--success-color) 0%, 
        #22c55e 25%, 
        #16a34a 50%, 
        #059669 75%, 
        #047857 100%);
    border-radius: var(--radius-md);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.progress-bar-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

.progress-bar-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 100%
    );
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Enhanced animations */
@keyframes shimmer {
    0% { 
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% { 
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes progressBarPulse {
    0%, 100% {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.1);
    }
}

@keyframes backgroundShimmer {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Progress bar states */
.progress-bar-inner.progress-active {
    animation: progressGlow 2s ease-in-out infinite alternate;
}

.progress-bar-inner.progress-complete {
    background: linear-gradient(135deg, 
        var(--success-color) 0%, 
        #22c55e 50%, 
        var(--success-color) 100%);
    animation: completePulse 0.6s ease-out;
}

@keyframes progressGlow {
    0% {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }
    100% {
        box-shadow: 0 2px 16px rgba(16, 185, 129, 0.6), 0 0 20px rgba(16, 185, 129, 0.2);
    }
}

@keyframes completePulse {
    0% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.1);
    }
    100% {
        transform: scaleY(1);
    }
}

/* Log Box */
.log-box {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    height: 250px;
    overflow-y: auto;
    padding: var(--spacing-lg);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.log-box::-webkit-scrollbar {
    width: 8px;
}

.log-box::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: var(--radius-sm);
}

.log-box::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

.log-box::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: var(--spacing-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dialog Styles */
.hidden {
    display: none !important;
}

#dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#dialog-box {
    background-color: var(--surface-color);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-color);
    animation: dialogSlideIn 0.3s ease-out;
}

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

.dialog-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
}

#dialog-message {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-lg);
    }
    
    .header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .tab {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .tab button {
        justify-content: center;
    }
    
    .tabcontent {
        padding: var(--spacing-lg);
    }
    
    .drop-zone {
        padding: var(--spacing-lg);
    }
    
    .drop-icon {
        font-size: 2rem;
    }
    
    .drop-text {
        font-size: 1rem;
    }
    
    .folder-structure pre {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.875rem;
    }
    
    #dialog-box {
        padding: var(--spacing-lg);
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }
