body {
    font-family: 'Open Sans', sans-serif;
    font-style: normal;
}

/* Only apply flex layout to home page */
.home-page body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Page Header Styles - Consistent across all pages */
.page-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 25px 40px;
    margin-bottom: 20px;
}

/* Full width page header for home page */
.home-page .page-header {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    box-sizing: border-box;
}

.page-header-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: normal;
    color: #333;
    font-family: 'Albert Sans', sans-serif;
}

/* Responsive page header */
@media (max-width: 768px) {
    .page-header {
        padding: 20px 20px;
        margin-bottom: 15px;
    }
    
    .page-header-title h1 {
        font-size: 16px;
    }
}

.header {
    width: 100%;
    border-bottom: 1px solid #eee;
}

.title {
    margin-left: 45px;
    margin-top: 20px;
    margin-bottom: 25px;
    width: 100px;
    font-family: 'Albert Sans', sans-serif;
    background-color: white;
    color: black;
    text-align: left;
    font-size: 9px;
}

h1 {
    font-weight: normal;
    margin: 0;
}

/* Override for pages with navigation */
.input-page .page-wrapper,
.check-page .page-wrapper,
.guideline-page .page-wrapper,
.course-input-page .page-wrapper,
.assignment-input-page .page-wrapper {
    width: 100%;
    margin: 0;
}

/* Shared CSS classes used in both institution_context.html and decision_making.html */
.page-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.single-column-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.form-container {
    align-items: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-top: 20px;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    width: 90%;
}

.section-group {
    margin-top: 20px;
    margin-bottom: 50px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
}

.subsection {
    margin-top: 20px;
    margin-bottom: 25px;
}

.subsection-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.subsection-content {
    margin-top: 10px;
    margin-bottom: 10px;
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.subsection-fields {
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
}

.input-field {
    background-color: #EDEDED;
    width: 100%;
    max-width: 100%;
    padding: 8px;
    margin: 4px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.input-field:focus {
    outline: none;
    border-color: rgb(12,84,134);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

textarea.input-field {
    min-height: 100px;
    resize: vertical;
}

input[type="url"].input-field {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* File upload container */
.file-upload-container {
    width: 100%;
}

.file-input {
    display: none;
}

.file-upload-label {
    display: block;
    width: 100%;
    cursor: pointer;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: #f9f9f9;
    transition: background-color 0.3s ease;
}

.upload-area:hover {
    background-color: #f0f8ff;
    border-color: rgb(12,84,134);
}

.upload-text {
    font-size: 16px;
    color: #666;
}

/* Button styling */
.button-container {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 30px;
}

.extract-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: rgb(178, 142, 93);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1rem;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.extract-button:hover {
    background-color: rgb(105, 72, 26);
    color: white;
}

.extract-button {
    margin-right: 10px;
    transition: all 0.3s ease;
}



.reset-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1rem;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.reset-button:hover {
    background-color: #545b62;
}

/* Edit, Save, Cancel buttons */
.reset-button,
.extract-button,
.edit-button,
.save-button,
.cancel-button {
    padding: 7px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    border: none;
}

.edit-button {
    background-color: rgb(0, 106, 170);
    color: white;
}

.edit-button:hover {
    background-color: rgb(18, 39, 70);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.save-button {
    background-color: rgb(0, 165, 88);
    color: white;
}

.save-button:hover {
    background-color: rgb(0, 104, 55);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.cancel-button {
    background-color: rgb(139, 148, 153);
    color: white;
}

.cancel-button:hover {
    background-color: rgb(98, 104, 107);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.edit-button:disabled,
.save-button:disabled,
.cancel-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading overlay styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid rgb(12,84,134);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

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

/* Responsive design */
@media (max-width: 768px) {
    .page-wrapper {
        width: 90%;
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-text {
        font-size: 14px;
    }
    
    .section-group {
        margin-top: 30px;
        margin-bottom: 50px;
    }
    
    .subsection {
        margin-top: 25px;
    }
}



/* Navigation */

/* Navigation Tabs */
.navigation-container {
    position: fixed;
    left: 0;
    top: 0;
    width: 15%;
    height: 100vh;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    z-index: 1000;
    overflow-y: auto;
    min-width: 200px;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.navigation-container.collapsed {
    transform: translateX(-100%);
}

.navigation-title {
    padding: 25px 40px 25px 40px;
    border-bottom: 1px solid #e9ecef;
    background-color: #ffffff;
}

.navigation-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: normal;
    color: #333;
    font-family: 'Albert Sans', sans-serif;
}

.navigation-title a {
    text-decoration: none;
    color: inherit;
}

/* New Session-based Navigation */
.navigation-sessions {
    padding: 20px;
}

.navigation-session {
    margin-bottom: 30px;
}

.session-header {
    margin-bottom: 15px;
}

.session-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    font-family: 'Albert Sans', sans-serif;
    padding: 0;
}

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

/* Horizontal layout for context session */
.session-card {
    flex: 1;
    min-width: 50px;
    min-height: 30px;
    padding: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.session-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background-color: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    font-family: 'Albert Sans', sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    /* min-width: 130px; */
}

.session-card:hover {
    background-color: #f8f9fa;
    border-color: rgb(0, 106, 170);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

.session-card.active {
    background-color: rgb(0, 106, 170);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.session-card.active:hover {
    background-color: rgb(18, 39, 70);
    border: none;
    color: white;
}

/* Disabled navigation card styles */
.session-card.disabled {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.session-card.disabled:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    transform: none;
    box-shadow: none;
    text-decoration: none;
}

.session-card.disabled .card-subtitle {
    color: #adb5bd;
}

/* Completed navigation card styles */
.session-card.completed {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.session-card.completed:hover {
    background-color: #c3e6cb;
    border-color: #b1dfbb;
    color: #155724;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.session-card.completed .card-subtitle {
    color: #155724;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.card-subtitle {
    font-size: 12px;
    color: #6c757d;
    font-weight: 400;
    display: block;
}

.session-card.active .card-subtitle {
    color: rgba(255,255,255,0.8);
}

.session-card.completed .card-subtitle {
    color: gray;
}

/* Main content wrapper for pages with navigation */
.main-content-wrapper {
    margin-left: 15%;
    width: 85%;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
    min-width: 600px;
    overflow-x: auto;
}

/* Adjust page wrapper for navigation pages */
.page-wrapper {
    padding: 20px;
    box-sizing: border-box;
}

/* Ensure body doesn't overlap with navigation */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Navigation toggle button */
.nav-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    display: none;
}

.nav-toggle:hover {
    background-color: #0056b3;
}

/* Home page specific adjustments */
.home-page .main-content-wrapper {
    margin-left: 0;
    width: 100%;
}

.home-page .page-wrapper {
    padding: 0;
}

/* Hide navigation on home page */
.home-page .navigation-container {
    display: none;
}

.home-page .nav-toggle {
    display: none;
}

/* Responsive design */
@media (max-width: 1200px) {
    .navigation-container {
        width: 250px;
        min-width: 250px;
    }
    
    .main-content-wrapper {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

@media (max-width: 768px) {
    .navigation-container {
        width: 200px;
        min-width: 200px;
        height: 100vh;
        position: fixed;
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .navigation-container.expanded {
        transform: translateX(0);
    }
    
    .main-content-wrapper {
        margin-left: 0;
        width: 100%;
        min-width: 600px;
    }
    
    .page-wrapper {
        padding: 15px;
        padding-left: 60px;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .session-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .session-card {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .navigation-container {
        width: 180px;
        min-width: 180px;
    }
    
    .main-content-wrapper {
        min-width: 600px;
    }
    
    .page-wrapper {
        padding: 10px;
        padding-left: 60px;
    }
}



/* Loading */

/* Loading Overlay Styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 8px;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

#loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.9);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.loading-spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #0c5486;
  border-radius: 50%;
  width: 60px; height: 60px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}
.loading-message {
  font-size: 1.5rem;
  color: #0c5486;
  font-weight: bold;
}

.loading-text {
    margin-top: 20px;
    font-family: 'Albert Sans', sans-serif;
    font-size: 16px;
    color: #666;
    text-align: center;
}

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

/* Loading container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Form container positioning for loading overlay */
.form-container {
    position: relative;
} 

/* Extract button states */
.extract-button.extracted {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    cursor: not-allowed;
}

.extract-button.error {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    cursor: not-allowed;
}

/* Disabled extract button styles */
.extract-button:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.5;
}

.extract-button:disabled:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Enabled extract button styles */
/* .extract-button:not(:disabled):not(.warning):not(.ready) {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    cursor: pointer;
    opacity: 1;
}

.extract-button:not(:disabled):not(.warning):not(.ready):hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
} */

/* Form section states */
/* .form-container.ready .section-title.required {
    color: #28a745;
}

.form-container.ready .section-title.required::after {
    color: #28a745;
} */

.form-container:not(.ready) .section-title.required {
    color: #495057;
}

.form-container:not(.ready) .section-title.required::after {
    color: #dc3545;
}

/* Warning states for form containers */
.form-container.warning {
    border: 2px solid #dc3545;
    border-radius: 8px;
    background-color: #fff5f5;
}

.form-container.warning .section-title.required {
    color: #dc3545;
}

.form-container.warning .section-title.required::after {
    color: #dc3545;
}

/* Extract button warning state */
.extract-button.warning {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    cursor: pointer;
    opacity: 1;
    position: relative;
}

.extract-button.warning:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    transform: none;
    box-shadow: none;
}

.extract-button.warning::after {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
}

/* Extract button ready state */
.extract-button.ready {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    cursor: pointer;
    opacity: 1;
    position: relative;
}

.extract-button.ready:hover {
    background-color: #218838;
    border-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.extract-button.ready::after {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
}

/* Required section indicators */
.section-title.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

.section-title.required {
    color: #495057;
}

.subsection-title.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

.subsection-title.required {
    color: #333333;
}

/* Disabled navigation button styles */
.nav-button:disabled,
.nav-button[style*="pointer-events: none"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-button:disabled:hover,
.nav-button[style*="pointer-events: none"]:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
    transform: none;
    box-shadow: none;
}

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

.warning-modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.warning-modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff3cd;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.warning-modal-header h3 {
    margin: 0;
    color: #856404;
    font-size: 20px;
    font-weight: 600;
}

.warning-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #856404;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.warning-modal-close:hover {
    background-color: rgba(133, 100, 4, 0.1);
}

.warning-modal-body {
    padding: 20px 25px;
}

.warning-modal-body p {
    margin: 0 0 15px 0;
    color: #495057;
    line-height: 1.5;
}

.warning-modal-body ul {
    margin: 0;
    padding-left: 20px;
    color: #856404;
}

.warning-modal-body li {
    margin-bottom: 5px;
    font-weight: 500;
}

.warning-modal-footer {
    padding: 15px 25px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.warning-modal-cancel {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.warning-modal-cancel:hover {
    background-color: #5a6268;
}

.warning-modal-proceed {
    padding: 10px 20px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.warning-modal-proceed:hover {
    background-color: #c82333;
} 


