/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #0066b3;
    --color-primary-dark: #004d87;
    --color-primary-light: #e6f2fa;
    --color-success: #059669;
    --color-success-light: #d1fae5;
    --color-error: #dc2626;
    --color-error-light: #fee2e2;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: var(--color-gray-800);
    line-height: 1.5;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--color-gray-200);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-shipto {
    height: 48px;
}

.logo-hydro {
    height: 40px;
}

.logo-divider {
    width: 1px;
    height: 32px;
    background: var(--color-gray-300);
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-success);
    font-size: 0.875rem;
    font-weight: 500;
}

.icon-shield {
    width: 18px;
    height: 18px;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 560px;
    border: 1px solid var(--color-gray-200);
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-900);
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--color-gray-500);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--color-gray-300);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--color-gray-50);
}

.upload-zone:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.upload-zone.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transform: scale(1.01);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--color-primary);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 0.25rem;
}

.upload-subtext {
    font-size: 0.875rem;
    color: var(--color-gray-500);
    margin-bottom: 0.75rem;
}

.upload-formats {
    font-size: 0.75rem;
    color: var(--color-gray-400);
    font-family: monospace;
    letter-spacing: 0.05em;
}

/* Files Section */
.files-section {
    margin-top: 1.5rem;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.files-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-700);
}

.btn-clear {
    background: none;
    border: none;
    color: var(--color-gray-500);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.btn-clear:hover {
    color: var(--color-error);
    background: var(--color-error-light);
}

.files-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--color-gray-200);
}

.file-icon {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
}

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

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

.file-format {
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 500;
}

.file-remove {
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.file-remove:hover {
    color: var(--color-error);
    background: var(--color-error-light);
}

.file-remove svg {
    width: 16px;
    height: 16px;
}

/* Analysis Section */
.analysis-section {
    margin-top: 1.5rem;
}

.analysis-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--color-primary-light);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 102, 179, 0.2);
}

.analysis-icon {
    width: 40px;
    height: 40px;
    color: var(--color-primary);
}

.analysis-icon svg {
    width: 100%;
    height: 100%;
}

.analysis-stats {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--color-gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-secondary {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--color-gray-700);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
}

/* Progress */
.progress-section {
    margin-top: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--color-gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-gray-600);
    margin-top: 0.75rem;
}

/* Results */
.results-section {
    margin-top: 1.5rem;
}

.result-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.result-success {
    background: var(--color-success-light);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.result-partial {
    background: #fef3c7;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.result-partial h3 {
    color: #d97706;
}

.result-partial .result-icon {
    color: #d97706;
}

.result-error {
    background: var(--color-error-light);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.result-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
}

.result-success .result-icon {
    color: var(--color-success);
}

.result-error .result-icon {
    color: var(--color-error);
}

.result-icon svg {
    width: 100%;
    height: 100%;
}

.result-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-success h3 {
    color: var(--color-success);
}

.result-error h3 {
    color: var(--color-error);
}

.result-card p {
    font-size: 0.9375rem;
    color: var(--color-gray-600);
}

.error-list {
    list-style: none;
    margin-top: 1rem;
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
}

.error-list li {
    font-size: 0.8125rem;
    color: var(--color-gray-700);
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

/* Footer */
.footer {
    padding: 1rem 2rem;
    text-align: center;
    color: var(--color-gray-500);
    font-size: 0.8125rem;
}

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

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 640px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }

    .analysis-card {
        flex-wrap: wrap;
        justify-content: center;
    }
}
