/* Fallback CSS for when CDN fails */
/* Basic reset and layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9fafb;
    min-height: 100vh;
}

/* Header styles */
header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e5e7eb;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.header-left {
    display: flex;
    align-items: center;
}

.back-link {
    color: #2563eb;
    text-decoration: none;
    margin-right: 1rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: #1d4ed8;
}

h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111827;
}

/* Main content */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-title {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title h2 {
    font-size: 1.875rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 1rem;
}

.page-title p {
    color: #6b7280;
}

/* Card styles */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 42rem;
    margin: 0 auto;
}

/* Upload area */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #14b8a6;
    background-color: #f0fdfa;
}

.upload-area.drag-over {
    border-color: #14b8a6;
    background-color: #f0fdfa;
}

.upload-icon {
    font-size: 2.5rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.upload-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.upload-description {
    color: #6b7280;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: #14b8a6;
    color: white;
}

.btn-primary:hover {
    background-color: #0f766e;
}

.btn-secondary {
    background-color: #2563eb;
    color: white;
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* File info */
.file-info {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.file-icon {
    font-size: 1.5rem;
    color: #14b8a6;
    margin-right: 1rem;
}

.file-details h4 {
    font-weight: 600;
    color: #111827;
}

.file-details p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Progress bar */
.progress-container {
    margin-top: 1.5rem;
    text-align: center;
}

.progress-text {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #14b8a6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.75rem;
}

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

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #14b8a6;
    transition: width 0.3s ease;
    width: 45%;
}

/* Result section */
.result-section {
    margin-top: 1.5rem;
    text-align: center;
}

.success-card {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.success-icon {
    font-size: 1.875rem;
    color: #16a34a;
    margin-bottom: 0.75rem;
}

.success-text {
    color: #15803d;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Features section */
.features-section {
    margin-top: 3rem;
    background-color: #f0fdfa;
    border-radius: 0.5rem;
    padding: 2rem;
}

.features-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f766e;
    margin-bottom: 1.5rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    font-size: 1.875rem;
    color: #14b8a6;
    margin-bottom: 0.75rem;
}

.feature-title {
    font-weight: 600;
    color: #0f766e;
    margin-bottom: 0.5rem;
}

.feature-description {
    color: #0f766e;
    font-size: 0.875rem;
}

/* Utility classes - Tailwind provides these, no need to duplicate */

/* Responsive */
@media (max-width: 768px) {
    .header-container,
    main {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}
/* Fix 
for long filename layout issues */
.file-result-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #f9fafb !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem !important;
    margin-bottom: 0.5rem !important;
    min-height: 60px !important;
    overflow: hidden !important;
}

.file-result-content {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    min-width: 0 !important; /* Allow shrinking */
    margin-right: 1rem !important;
}

.file-result-icon {
    flex-shrink: 0 !important;
    margin-right: 0.75rem !important;
    font-size: 1.25rem !important;
}

.file-result-details {
    flex: 1 !important;
    min-width: 0 !important; /* Allow shrinking */
}

.file-result-name {
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    margin-bottom: 0.25rem !important;
    /* Handle long filenames */
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    line-height: 1.3 !important;
    max-height: 2.6em !important; /* Show max 2 lines */
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.file-result-status {
    font-size: 0.75rem !important;
    color: #6b7280 !important;
}

.file-result-button {
    flex-shrink: 0 !important;
    background-color: #2563eb !important;
    color: white !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.375rem !important;
    font-size: 0.75rem !important;
    border: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
    white-space: nowrap !important;
    min-width: 80px !important;
}

.file-result-button:hover {
    background-color: #1d4ed8 !important;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .file-result-item {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 1rem !important;
    }
    
    .file-result-content {
        margin-right: 0 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .file-result-button {
        width: 100% !important;
        min-width: auto !important;
        justify-content: center !important;
    }
    
    .file-result-name {
        max-height: none !important;
        -webkit-line-clamp: none !important;
        word-break: break-word !important;
    }
}

/* Additional utility classes for filename handling */
.filename-truncate {
    max-width: 200px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.filename-wrap {
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* Ensure flex containers don't overflow */
.flex-container-safe {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.flex-content-safe {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.flex-button-safe {
    flex-shrink: 0 !important;
    margin-left: 0.75rem !important;
}


/* ========================================== */
/* Missing Tailwind Classes - Manual Addition */
/* ========================================== */

/* Decimal spacing values (0.5 = 2px, 2.5 = 10px) */
.mt-0\.5 {
    margin-top: 0.125rem !important; /* 2px */
}

.py-0\.5 {
    padding-top: 0.125rem !important; /* 2px */
    padding-bottom: 0.125rem !important;
}

.px-2\.5 {
    padding-left: 0.625rem !important; /* 10px */
    padding-right: 0.625rem !important;
}

.p-2\.5 {
    padding: 0.625rem !important; /* 10px */
}

/* Fractional positioning */
.top-1\/2 {
    top: 50% !important;
}

/* Resize utility */
.resize-vertical {
    resize: vertical !important;
}

/* Arbitrary min-height value */
.min-h-\[600px\] {
    min-height: 600px !important;
}
