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

svg {
    fill: none !important;
    width: auto;
    height: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fff;
    color: #333;
    overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-screen.active {
    opacity: 1;
    pointer-events: all;
}

.loading-bar-container {
    width: 300px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loading-bar {
    position: absolute;
    height: 100%;
    background: #ff6154;
    border-radius: 2px;
    width: 40%;
    will-change: transform;
    animation: loading 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(200%);
    }
    100% {
        transform: translateX(500%);
    }
}

.loading-text {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

.container {
    max-width: 1100px;
    height: calc(100vh - 81px);
    align-content: center;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Step Content */
.step-content {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-panel {
    display: none;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.step-panel.active {
    display: block;
}

.step-panel.show {
    opacity: 1;
    transform: translateY(0);
}

.step-title {
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
}

.step-description {
    font-size: 12.5px;
    color: #999;
    margin-bottom: 40px !important;
}

/* Step 1: Import */
.upload-area {
    max-width: 400px;
    margin: 40px auto;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff6154;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-label:hover {
    background: #e5554a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 97, 84, 0.4);
}

.upload-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.upload-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0;
    transition: opacity 0.3s ease;
}

.file-input-label:hover .upload-icon {
    opacity: 1;
}

.file-input-label:hover .upload-text {
    opacity: 0;
    visibility: hidden;
}

.file-input {
    display: none;
}

/* Step 2: Preview */
.preview-container {
    max-width: 1000px;
    margin: 0 auto;
}

.preview-info-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    margin-bottom: 40px;
}

.pdf-preview-section {
    display: flex;
    flex-direction: column;
}

.pdf-preview {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-preview:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    border-color: #d1d5db;
}

.pdf-preview canvas {
    max-width: 100%;
    max-height: 350px;
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-preview:hover canvas {
    transform: scale(1.02);
}

.preview-placeholder {
    color: #9ca3af;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

/* File Info Card */
.file-info-card,
.repair-info-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    text-align: left;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.info-header .header-dash {
    width: 16px;
    height: 2px;
    background: #ff6154;
    border-radius: 1px;
}

.info-header span {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 14px;
    color: #6b7280;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Repair Info Card */
.repair-description {
    font-size: 14px;
    color: #6b7280;
}

.repair-description p {
    margin-bottom: 12px;
}

.repair-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.repair-description li {
    padding: 6px 0;
    padding-left: 24px;
    position: relative;
}

.repair-description li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 2px;
    background: #9ca3af;
    border-radius: 1px;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    padding-top: 12px;
    margin-bottom: 20px;
}

.button-group .btn {
    flex: 1;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 17px 36px;
    margin: 0;
    font-size: 15px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-group .btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-group .btn-secondary {
    max-width: 150px;
    flex: 0.7;
    position: relative;
}

.button-group .btn-secondary .btn-icon-arrow {
    position: absolute;
    left: 20px;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-group .btn-secondary:hover .btn-icon-arrow {
    opacity: 1;
    transform: translateX(0);
}

.button-group .btn-secondary span {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-group .btn-secondary:hover span {
    transform: translateX(8px);
}

.button-group .btn-primary-action {
    flex: 1.3;
    max-width: 260px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 97, 84, 0.2);
}

.button-group .btn-primary-action:hover {
    box-shadow: 0 6px 20px rgba(255, 97, 84, 0.35);
    transform: translateY(-3px);
}

.button-group .btn-primary-action svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-group .btn-primary-action:hover svg {
    transform: translateX(4px);
}

.button-group .btn-primary-action.btn-loading svg {
    display: none;
}

@media (max-width: 768px) {
    .preview-info-wrapper {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .pdf-preview {
        min-height: 320px;
        padding: 32px;
    }

    .pdf-preview canvas {
        max-height: 240px;
    }

    .button-group {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .button-group .btn {
        max-width: 100%;
        width: 100%;
    }

    .button-group .btn-secondary,
    .button-group .btn-primary-action {
        max-width: 100%;
        flex: 1;
    }

    .button-group .btn-secondary .btn-icon-arrow {
        position: static;
        opacity: 1;
        transform: translateX(0);
    }

    .button-group .btn-secondary:hover span {
        transform: translateX(0);
    }
}

/* Step 3: Download */
.download-container {
    max-width: 480px;
    margin: 0 auto;
}

/* File Result Card */
.file-result-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.file-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #fff5f491 0%, #ffe5e273 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 32px;
    height: 32px;
    stroke: #ff6154;
}

.file-details {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.file-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 14px;
    color: #6b7280;
}

.status-badge {
    background: #10b981;
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.status-badge svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

/* Download Actions */
.download-actions {
}

.download-btn-group {
    margin-bottom: 16px;
}

.btn-download-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: #ff6154;
    color: white;
    border: none;
    border-radius: 14px;
    padding: 18px 32px;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(255, 97, 84, 0.25);
}

.btn-download-primary:hover {
    background: #e5554a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 97, 84, 0.35);
}

.btn-download-primary svg {
    width: 22px;
    height: 22px;
    stroke: white;
}

/* Secondary Actions */
.secondary-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
}

.secondary-action-btn {
    flex: 1;
    background: #f9fafb;
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #6b7280;
}

.secondary-action-btn:hover {
    background: #fff5f4;
    border-color: #ff6154;
    color: #ff6154;
    box-shadow: none;
}

.secondary-action-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* Repair Another Button */
.btn-repair-another {
    background: transparent;
    color: #ff6154;
    border: 2px solid #ff6154;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.btn-repair-another:hover {
    background: #fff5f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 97, 84, 0.1);
}

.btn-repair-another .arrow-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-repair-another:hover .arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

.btn-repair-another:hover span {
    transform: translateX(-4px);
}

.btn-repair-another span {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .secondary-actions {
        flex-direction: column;
    }

    .bottom-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* Buttons */
.btn {
    background: #ff6154;
    color: white !important;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin: 8px;
}

.btn:hover {
    background: #e5554a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 97, 84, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #ff6154 !important;
    border: 2px solid #ff6154;
}

.btn-secondary:hover {
    background: transparent !important;
    box-shadow: 0 4px 15px rgba(255, 97, 84, 0.1);
}

.btn:disabled {
    background: #cccccc20;
    color: #ccc !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

.btn-loading span {
    visibility: hidden;
}

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

.error-message {
    color: #d93025;
    background: #fce8e6;
    border-radius: 12px;
    padding: 16px;
    margin: 20px auto;
    display: none;
    max-width: 400px;
}
