/* Custom styles for the Consolidate Files page */

.page-container {
    margin: 0 auto;
}

.consolidate-section {
    text-align: center;
    animation: fadeIn 1s ease-out;
}

.page-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-intro {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 50px;
    color: var(--text-color);
    line-height: 1.6;
}

/* Updated grid for the three main cards */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.option-card {
    background: var(--secondary-bg-color);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Ensures content aligns nicely */
}

.option-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-heavy);
}

.option-card h2 {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 20px;
}

.option-card h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.option-card p {
    font-size: 1em;
    line-height: 1.5;
    margin-bottom: 20px;
}

.system-input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.system-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.system-input label {
    font-weight: 600;
    color: var(--primary-color);
}

.system-input input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

.integration-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: not-allowed;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.integration-btn:hover {
    background-color: #1a242f;
}

.integration-btn i {
    margin-right: 8px;
}

/* New styling for the file upload areas */
.file-upload-box {
    border: 2px dashed var(--accent-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    margin-top: 20px;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.file-upload-box.highlight {
    background-color: #e6ffe6;
    border-color: #2c974b;
}

.file-upload-box i {
    color: var(--accent-color);
    font-size: 3em;
    margin-bottom: 10px;
}

.file-upload-box p {
    margin: 5px 0;
    font-weight: 500;
}

.file-upload-info {
    font-size: 0.9em;
    color: #888;
}

.file-input {
    display: none;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
    font-size: 0.9em;
    width: 100%;
}

.file-list li {
    background-color: #f0f0f0;
    padding: 8px 12px;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- UPDATED STYLES FOR VISUAL CONFIRMATION --- */
.image-preview-container {
    text-align: center;
    padding: 10px; /* Reduced padding */
    border: 1px solid #ddd; /* Subtle border */
    border-radius: 10px;
    background-color: #fff; /* White background */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Reduced gap */
    height: 100%;
    box-sizing: border-box;
    flex-grow: 1;
}

.preview-image {
    max-width: 1000%; /* Make image slightly smaller to give more margin */
    max-height: 250px; /* Fixed height for consistency */
    width: auto; /* Allow width to adjust */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Lighter shadow */
/*     object-fit: contain; Ensures the entire image is visible within the bounds */
    margin-bottom: 5px; /* Added margin below image */
}

.reset-upload-btn {
    background-color: #ffffff; /* White background */
    color: var(--primary-color); /* Primary text color */
    border: 1px solid var(--primary-color); /* Border color matching primary */
    padding: 6px 12px; /* Smaller padding */
    border-radius: 20px; /* More subtle rounded corners */
    font-size: 0.8em; /* Smaller font size */
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    font-weight: 500;
}

.reset-upload-btn:hover {
    background-color: var(--primary-color); /* Hover background becomes primary color */
    color: #fff; /* Hover text becomes white */
    border-color: var(--primary-color); /* Border stays primary color */
}
/* --- END UPDATED STYLES --- */

/* New rule to center the unified button */
.process-button-container {
    width: 100%;
    /* Use text-align as a fallback */
    text-align: center; 
    margin-top: 20px;
    margin-bottom: 50px; /* Consolidate bottom margin here */
}

.process-button {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 15px 30px; 
    border-radius: 50px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    
    /* THE CRITICAL CENTERING RULES */
    display: block; /* MUST be a block element to use margin: auto */
    margin: 0 auto; /* This centers the block element */
}

.process-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}


.processing-info {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.unify-message,
.success-message,
.upload-status {
    margin-top: 15px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1em;
    display: none; /* Hide by default */
}

.unify-message {
    color: var(--primary-color);
}

.success-message {
    color: #28a745;
}

.completion-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    margin-top: 30px;
    width: 100%;
}

.completion-buttons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.bottom-nav {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 250px;
    margin: 20px auto 0;
}

.back-button {
    background-color: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.back-button:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.demo-button {
    background-color: #41ba64;
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.demo-button:hover {
    background-color: #2c974b;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.view-dashboard {
    background-color: var(--primary-color);
    color: #fff;
}

.view-dashboard:hover {
    background-color: #1a242f;
}

.tagline-link {
    font-size: 0.8em;
    display: block;
    margin-top: 5px;
}

/* New classes for state management */
.initial-state-container,
.unified-state-container {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* New temporary loading container for each system card */
.system-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    text-align: center;
    min-height: 150px;
    gap: 10px;
}

.system-loading p {
    font-weight: 500;
    color: var(--primary-color);
    margin: 0;
}
