/* Step Progress Bar */

/* Tool Step Styling */
.tool-step {
    background: var(--tool-card-bg);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--tool-card-shadow);
    margin-top: 20px;
}

.tool-step h2 {
    color: var(--dark-text);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8em;
    background: var(--section-header-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--primary-medium);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05); /* Slightly lighter background */
    margin-bottom: 25px;
}

.light-mode .upload-area {
    background: rgba(0, 0, 0, 0.03); /* Slightly darker background in light mode */
}

.upload-area.highlight {
    background: rgba(106, 156, 137, 0.2); /* var(--primary-medium) with opacity */
    border-color: var(--primary-dark);
}

.upload-area .drag-drop-text {
    font-size: 1.4em;
    color: var(--primary-light);
    margin-bottom: 10px;
}

.upload-area .or-text {
    font-size: 1em;
    color: var(--dark-text);
    margin: 15px 0;
}

.upload-area .btn-secondary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: var(--transition);
}

.upload-area .btn-secondary:hover {
    background: var(--secondary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.upload-area .file-size-limit {
    font-size: 0.9em;
    color: var(--primary-light);
    margin-top: 20px;
    opacity: 0.8;
}

/* File List */

.file-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 10px;
    color: var(--dark-text);
    transition: var(--transition);
    flex-direction: column;
}

.light-mode .file-list-item {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.file-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.file-name {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--primary-light);
     word-break: break-word; /* Break long names */
    max-width: 100%; /* Ensure it doesn't overflow */
}

.file-details {
    font-size: 0.85em;
    color: var(--dark-text);
    opacity: 0.8;
}

.file-remove {
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: 1.2em;
    cursor: pointer;
    transition: color 0.3s ease;
}

.file-remove:hover {
    color: #ff6b6b; /* A subtle red for remove */
}

/* Next Step Button */

.next-step-btn, .prev-step-btn {
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.next-step-btn {
    background: var(--primary-gradient);
    color: white;
}

.next-step-btn:hover:not(:disabled) {
    background: var(--secondary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.next-step-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.prev-step-btn {
    background: var(--light-bg);
    color: var(--dark-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.light-mode .prev-step-btn {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
}

.prev-step-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}
.light-mode .prev-step-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    .btn-wrapper {
        flex-direction: column;
    }
    .next-step-btn, .prev-step-btn {
        width: 100%;
        justify-content: center;
    }
}

.step-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 100%;
    margin: 2rem 0;
    padding: 0 1rem;
}

/*.step-progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-light);
    opacity: 0.3;
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
}*/

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
  /*  max-width: 150px;*/
    transition: var(--transition);
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    position: relative;
   /* background: var(--background-light);*/
    color: var(--primary-medium);
    border: 3px solid var(--primary-medium);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.step-name {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    color: var(--primary-medium);
    opacity: 0.7;
    transition: var(--transition);
    line-height: 1.3;
}

/* Active step styling */
.step.active .step-number {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(22, 66, 60, 0.3);
    transform: scale(1.1);
}

.step.active .step-number::before {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.step.active .step-number {
    color: transparent;
}

.step.active .step-name {
    color: var(--primary-dark);
    opacity: 1;
    font-weight: 600;
}

/* Completed step styling */
.step.completed .step-number {
    background: var(--primary-medium);
    color: transparent;
    border-color: var(--primary-medium);
    box-shadow: 0 2px 10px rgba(106, 156, 137, 0.3);
}

.step.completed .step-number::before {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.step.completed .step-name {
    color: var(--primary-medium);
    opacity: 0.8;
}

/* Progress line between steps */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 25px;
    left: calc(50% + 25px);
    width: calc(100% - 50px);
    height: 3px;
    background: var(--primary-light);
    opacity: 0.3;
    z-index: 1;
    border-radius: 2px;
    transition: var(--transition);
}

.step.active:not(:last-child)::after,
.step.completed:not(:last-child)::after {
    background: var(--primary-medium);
    opacity: 1;
}

/* Hover effects */
.step:hover .step-number {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(22, 66, 60, 0.2);
}

.step:hover .step-name {
    opacity: 1;
}

/* Light mode adjustments 
.light-mode .step-number {
  /*  background: white;
    color: var(--primary-dark);
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(22, 66, 60, 0.1);
}*/

.light-mode .step-name {
    color: var(--primary-dark);
}

/*.light-mode .step.active .step-number {
    background: var(--primary-gradient);
    color: transparent;
    border-color: var(--primary-dark);
}*/

.light-mode .step.active .step-number::before {
    color: white;
}

.light-mode .step.active .step-name {
    color: var(--primary-dark);
}

.light-mode .step.completed .step-number {
    background: var(--primary-medium);
    color: transparent;
}

.light-mode .step.completed .step-number::before {
    color: white;
}

.light-mode .step:hover .step-number {
    box-shadow: 0 4px 12px rgba(22, 66, 60, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
    .step-progress-bar {
        padding: 0 0.5rem;
        margin: 1.5rem 0;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .step-name {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .step:not(:last-child)::after {
        top: 20px;
        left: calc(50% + 20px);
        width: calc(100% - 40px);
    }
}

@media (max-width: 480px) {
    .step-progress-bar {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .step-progress-bar::before {
        display: none;
    }
    
    .step {
        flex-direction: row;
        max-width: 100%;
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        background: var(--home-tool-card-bg);
        border: var(--home-tool-card-border);
        border-radius: 12px;
        backdrop-filter: blur(10px);
    }
    
    .step-number {
        margin-bottom: 0;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    
    .step-name {
        text-align: left;
        flex: 1;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
}

/* Styling for the file list and upload area */


.upload-area.highlight {
    background-color: #e0e0e0;
    border-color: #007bff;
}

.drag-drop-text {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 5px;
}

.or-text {
    margin: 10px 0;
    color: #777;
}

.file-size-limit {
    font-size: 0.9em;
    color: #888;
    margin-top: 10px;
}

.file-list {
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    max-height: 400px; /* Max height for scrollable list */
    overflow-y: auto; /* Enable scrolling */
    display: none; /* Hidden by default when no files */
}



.file-list-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}




.file-status {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* Progress bar styles */
.progress-container {
    display: flex;
    align-items: center;
    width: 100%; /* Take full width below file info */
    margin-top: 10px; /* Space between info and progress */
}

.progress-bar {
    width: calc(100% - 40px); /* Adjust for remove button width */
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0; /* Prevent shrinking */
}

.progress {
    height: 100%;
    width: 0%;
    background-color: #007bff; /* Default blue for uploading */
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.file-list-item.upload-failed .progress {
    background-color: #dc3545; /* Red for failed */
}

.file-list-item.uploaded .progress {
    background-color: #28a745; /* Green for success */
}

/* Remove button styles */
.file-remove {
    background: none;
    border: none;
    color: #dc3545; /* Red color for remove icon */
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 10px;
    padding: 0; /* Remove default button padding */
    width: 30px; /* Fixed width */
    height: 30px; /* Fixed height */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.file-remove:hover {
    color: #bd2130;
}

.file-list-item.removing {
    opacity: 0.6;
    pointer-events: none; /* Disable interaction during removal */
}

/* Alert styling for general errors */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-info {
        width: 100%;
        margin-right: 0;
    }

    .progress-container {
        width: 100%;
        margin-top: 10px;
        justify-content: space-between; /* Space out progress bar and button */
    }

    .progress-bar {
        width: calc(100% - 40px); /* Adjust for remove button */
    }

    .file-remove {
        margin-left: auto; /* Push to right */
    }
}

.summary-icon {
    font-size: 3rem;
    color: var(--primary-medium);
    opacity: 0.9;
}

/* Generalized Step 3 Download UI Styles (from split-pdf.css) */



.download-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}
.download-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}
.files-list {
    text-align: left;
    margin-top: 2rem;
   /* max-height: 300px;
   /* overflow-y: auto;*/
}
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--primary-light);
    transition: var(--transition);
}
.file-item:hover {
    background-color: rgba(106, 156, 137, 0.05);
}
.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}
.file-name {
    font-weight: 600;
    color: var(--primary-dark);
    word-break: break-word;
}
.file-pages {
    font-size: 0.85rem;
    color: var(--primary-medium);
}
.file-size {
    font-size: 0.8rem;
    color: var(--light-text);
    opacity: 0.8;
}
.download-btn-small {
    padding: 0.5rem 1rem;
    background: var(--primary-medium);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
    margin-left: 1rem;
}
.download-btn-small:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.success-message {
    color: var(--primary-medium);
    font-size: 1.2em;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex-direction: column;
}
.success-icon {
    font-size: 3em;
    color: #28a745;
    margin-bottom: 0.2em;
}
@media (max-width: 768px) {
    .download-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .download-btn-small {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}