/* General Styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Header */
header {
    background-color: #004b8d; /* New blue color */
    color: white;
    padding: 10px 20px;
}

/* Flex container for logo and title */
.header-container {
    display: flex;
    align-items: center;
}

/* Logo styling */
.logo {
    max-height: 100px;
    margin-right: 20px; /* Space between logo and text */
}

/* Title styling */
.header-container h1 {
    margin: 0;
    font-size: 1.8rem;
}

/* Navigation Menu */
nav {
    background-color: transparent;
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 0;
    box-shadow: none;
    z-index: 1000;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

nav li {
    margin: 0;
}

nav a {
    color: #004b8d;
    text-decoration: none;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 200px;
}

nav a.active {
    background-color: #004b8d;
    color: white;
    padding-right: 0;
    border-radius: 5px 0 0 5px;
    margin-right: 0;
    box-shadow: none;
    width: 220px;
}

nav a.active:after {
    content: '';
    position: absolute;
    right: -20px;
    top: 0;
    width: 20px;
    height: 100%;
    background-color: #004b8d;
}

nav a.active:before {
    background-color: white;
    color: #004b8d;
    z-index: 1;
}

nav a:before {
    content: counter(step);
    counter-increment: step;
    display: inline-block;
    margin-right: 10px;
    background-color: #004b8d;
    color: white;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    border-radius: 50%;
    font-size: 0.9rem;
}

nav a:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

/* Reset counter for nav items */
nav ul {
    counter-reset: step;
}

/* Content */
main {
    padding: 20px;
    padding-bottom: 80px;  /* Increased padding at bottom */
    text-align: center;
}

/* Button Styles */
a.button {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    color: white;
    background-color: #004b8d; /* New blue color */
    text-decoration: none;
    border-radius: 5px;
    font-size: 1rem;
}

a.button:hover {
    background-color: #003366; /* Darker blue for hover */
}

/* Button Container */
.button-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Upload Section Styles */
.upload-section {
    max-width: 600px;
    margin: 2rem auto;
    padding: 20px;
}

.upload-container {
    border: 2px dashed #004b8d; /* New blue color */
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background-color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-container.highlight {
    border-color: #003366; /* Darker blue for highlight */
    background-color: #e0f2f1;
}

.upload-container.has-file {
    border-style: solid;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 3rem;
    color: #009688;
}

.upload-subtitle {
    color: #666;
    margin: 0.5rem 0;
}

.upload-button {
    background-color: #004b8d; /* New blue color */
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-button:hover {
    background-color: #003366; /* Darker blue for hover */
}

.file-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.submit-button {
    background-color: #004b8d; /* New blue color */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #003366; /* Darker blue for hover */
}

/* Flash Messages */
.flash-messages {
    max-width: 600px;
    margin: 1rem auto;
}

.flash-message {
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 5px;
    background-color: #e0f2f1;
    color: #004b8d; /* New blue color */
    border: 1px solid #004b8d; /* New blue color */
}

/* Current File Display */
.current-file-container, .feedback-container {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 250px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
}

.current-file-container h3, .feedback-container h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.1rem;
}

.feedback-container {
    margin-top: 20px;
    justify-content: space-between;
}

.feedback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.envelope-icon {
    font-size: 3.5rem;
    color: #004b8d;
    line-height: 1;
    padding: 10px 0;
}

.feedback-link {
    color: #004b8d;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.feedback-link:hover {
    color: #003366;
}

.email {
    word-break: normal;
    font-size: 0.8rem;
}

/* Step Container */
.step-container {
    width: 100%;
    margin: 2rem auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Publication Status */
.publication-status {
    margin-top: 2rem;
}

.status-container {
    background-color: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.publication-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.publication-name {
    font-size: 1.1rem;
    color: #009688;
    font-weight: 500;
    word-break: break-all;
}

/* No Publication Message */
.no-publication {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    font-size: 3rem;
    color: #004b8d;
}

/* Extraction Controls */
.extraction-controls {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.extraction-controls h3 {
    margin-bottom: 1rem;
    color: #004b8d;
}

.control-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Action Buttons */
.action-button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.action-button.primary {
    background-color: #004b8d; /* New blue color */
    color: white;
    border: none;
}

.action-button.primary:hover {
    background-color: #003366; /* Darker blue for hover */
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.results-container p {
    color: #28a745;
    font-weight: 500;
}

/* Progress Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #004b8d;
}

.progress-container {
    background-color: #f5f5f5;
    border-radius: 5px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    width: 0%;
    height: 10px;
    background-color: #004b8d;
    transition: width 0.3s ease;
    animation: progress-animation 2s linear infinite;
}

@keyframes progress-animation {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

#progress-status, #progress-details, #current-topic {
    margin: 0.5rem 0;
    color: #666;
}

/* Error Section */
.error-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    text-align: left;
}

.error-message {
    color: #dc3545;
    margin: 0;
}

.excel-files-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.excel-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.excel-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.excel-file-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-name {
    font-size: 0.95rem;
    color: #495057;
}

.delete-button {
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.delete-button:hover {
    background: #c82333;
}

.delete-button:active {
    transform: translateY(1px);
}

/* Next Step Button */
.next-step-container {
    margin: 2rem auto;
    text-align: center;
}

.next-step-button {
    display: inline-flex;
    align-items: center;
    background-color: #004b8d;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.next-step-button:hover {
    background-color: #003366;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.next-step-button .arrow {
    margin-left: 10px;
    font-size: 1.4rem;
}

.intro-text {
    font-size: 1rem;
    font-weight: normal;
    color: #ffffff;
    margin: 15px 0;
    text-align: left; /* Ensure text is left-aligned */
}

/* Layout Container */
.layout-container {
    display: flex;
    min-height: calc(100vh - 180px);
    padding: 20px;
    gap: 20px;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    margin-left: 220px;
    margin-right: 140px;
}

/* Sidebar */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    position: fixed;
    right: max(40px, calc((100% - 1200px) / 2 + 40px));
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    max-width: 700px;
    margin: 0 auto;
    padding-right: 290px;
}

/* Sidebar specific styles */
.sidebar .current-file-container {
    width: 100%;
}

.sidebar .no-file-message {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar .delete-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.sidebar .delete-button:hover {
    background-color: #c82333;
}

.sidebar .action-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #004b8d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    width: auto;
    margin-top: 10px;
}

.sidebar .action-button:hover {
    background-color: #003366;
}

/* Classification Page Specific Styles */
.extraction-controls {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.extraction-controls h3 {
    margin-bottom: 1rem;
    color: #004b8d;
}

.control-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #004b8d;
}

.progress-container {
    background-color: #f5f5f5;
    border-radius: 5px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    width: 0%;
    height: 10px;
    background-color: #004b8d;
    transition: width 0.3s ease;
    animation: progress-animation 2s linear infinite;
}

@keyframes progress-animation {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

#progress-status, #progress-details, #current-topic {
    margin: 0.5rem 0;
    color: #666;
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.results-container p {
    color: #28a745;
    font-weight: 500;
}

/* Error Section */
.error-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    text-align: left;
}

.error-message {
    color: #dc3545;
    margin: 0;
}

/* No Publication Message */
.no-publication {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    font-size: 3rem;
    color: #004b8d;
}

/* Feedback Container */
.feedback-container {
    margin-top: 20px;
}

.feedback-container h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
}

.feedback-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #004b8d;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.feedback-link:hover {
    color: #003366;
}

.envelope-icon {
    font-size: 3.5rem;
    color: #004b8d;
    line-height: 1;
    padding: 10px 0;
}

.email {
    word-break: normal;
    font-size: 0.8rem;
}

/* Media Query for smaller screens */
@media screen and (max-width: 1200px) {
    .layout-container {
        margin-left: 200px;
        margin-right: 40px;
        padding: 20px 0;
    }

    .sidebar {
        right: 40px;
    }

    .main-content {
        padding-right: 290px;
    }
}

@media screen and (max-width: 1024px) {
    .layout-container {
        margin-left: 180px;
        margin-right: 30px;
    }

    .sidebar {
        right: 30px;
    }

    .current-file-container, .feedback-container {
        width: 220px;
        padding: 1.5rem;
    }

    .main-content {
        padding-right: 260px;
    }
}

#rewritten-files-input {
    display: none;
}
