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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #FFFFFF;
}

/* Navigation */
nav {
    background: linear-gradient(90deg, rgba(134, 74, 238, 1) 0%, rgba(0, 163, 130, 1) 89%);
    padding: 0rem 1rem;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-left,
.nav-center,
.save-button-container {
    display: flex;
    align-items: center;
}

.nav-center {
    gap: 1rem;
    margin-left: auto;
}

.nav-left a,
nav a {
    color: white;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

.nav-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.5em;
    color: #FFFFFF;
    text-decoration: none;
}

.nav-link:hover {
    text-decoration: underline;
}

/* Project name ellipsis in navigation */
.nav-left a:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    display: inline-block;
}

/* Chapter title ellipsis in navigation */
.nav-left a:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    display: inline-block;
}

/* User Management button - prevent wrapping */
nav a[href*="admin.list_users"] {
    white-space: nowrap;
}

.separator {
    color: #666;
    margin: 0 0.5rem;
}

.nav-button {
    color: white;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    border: 1px solid #666;
    height: 2rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.nav-button:not(.disabled):hover {
    background-color: #555;
    border-color: #888;
    text-decoration: none;
}

.nav-button.disabled {
    color: #888;
    border-color: #555;
    cursor: not-allowed;
}

/* Container */
.container {
    margin: 0.2rem auto;
    padding: 0 1rem;
}

/* Headings */
h1 {
    color: #003A8E;
}

h2 {
    margin-bottom: 1rem;
    color: #444;
}

/* Upload section */
.upload-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-input {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Project and Chapter grids moved to page-specific styles */

/* PowerPoint controls row moved to pages/powerpoint.css */

/* PowerPoint preview and slide styles moved to pages/powerpoint.css */

/* Project cards moved to pages/index.css */

/* Project card hover moved to pages/index.css */

/* Chapter content */
.chapter-content {
    display: flex;
    flex-direction: column;
}

.chapters-section {
    padding-bottom: 2rem;
}

.chapters-section h2 {
    color: #003A8E;
    margin-bottom: 1rem;
}

/* content-wrapper moved to core layout */

/* content-section (chapter) moved to pages/chapter.css */

.content-section h2 {
    margin-bottom: 1rem;
    color: #003A8E;
}

.voice-over-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.voice-over-text {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
    white-space: pre-wrap;
}

.voice-over-section h2 {
    color: #003A8E;
    margin-bottom: 1rem;
}

.section-project {
    max-height: 80vh;
}

/* Images section */
/* Images section moved to pages/chapter.css */

/* Feedback section */
/* Feedback card moved to pages/chapter.css */
.feedback-buttons-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: Arial, Helvetica, sans-serif;
}

/* Buttons */
button {
    background-color: #B0CEFA;
    color: #003A8E;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover {
    background-color: #003A8E;
    color: white;
}

/* Standard height for submit buttons */
.submit-button-std-height {
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive design */
/* Responsive rules for chapter moved to pages/chapter.css */

/* content-iframe responsive moved to pages/chapter.css */

/* images header moved */

/* upload button moved */

.plus-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Dialog styles */
.dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Ensure Upload dialog stacks above other modals like Images modal */
#upload-dialog {
    z-index: 1100;
}

.dialog-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.dialog-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.upload-area.dragover {
    border-color: #B0CEFA;
    background: rgba(0, 123, 255, 0.05);
}

.upload-text {
    color: #666;
}

.upload-text p {
    margin: 0.5rem 0;
}

.file-types {
    font-size: 0.9rem;
    color: #999;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.dialog-buttons button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dialog-buttons button[type="button"] {
    background: #f8f9fa;
    color: #333;
}

.dialog-buttons button[type="submit"] {
    background-color: #003A8E;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    font-size: 20px;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dialog-buttons button:hover {
    opacity: 0.9;
}

.dialog-buttons button[type="submit"]:hover {
    background-color: #002a66;
    opacity: 1;
}

.active-project-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.active-project-section h2 {
    color: #003A8E;
    font-family: 'Poppins', sans-serif;
    font-weight: bold; 
    font-size: 32px;
}

.active-project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.active-project-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: #2c3e50;
}

.view-project-btn {
    padding: 0.5rem 1rem;
    background-color: #B0CEFA;
    color: #003A8E;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 20px;
    padding: 0.3rem 1rem;
}

.view-project-btn:hover {
    background-color: #95bcf7;
}

/* Project page specific styles */
/* Project layout and save controls live in pages/project.css */

.delete-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: red;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
    padding: 0;
}

.delete-image:hover {
    background: orange;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

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

/* Project Actions */
/* Project action buttons moved to pages/project.css */

/* Project Cards */
/* Index page cards and progress moved to pages/index.css */

/* Disabled States */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

form:disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Chart modal moved to pages/chapter.css */

#chart-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

/* Style for the home link ('Dreamer') */
.home-link {
    display: flex;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    font-weight: bold; /* Poppins bold is usually 700 */
    font-size: 24px;
    color: #FFFFFF; /* Ensure it stays white */
    text-decoration: none; /* Remove default underline */
}

.home-link:hover {
    text-decoration: none; /* Keep underline removed on hover */
    opacity: 0.9; /* Optional: slight fade effect on hover */
}

/* === Styles moved from index.jinja === */

.form-group {
    margin-bottom: 1.5rem;
    position: relative; /* Needed for absolute positioning of popover */
}

/* Style the popover trigger '?' */
.popover-trigger {
    display: inline-block;
    margin-left: 5px;
    background-color: #003A8E; /* Updated trigger color */
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: help;
    font-weight: bold;
    vertical-align: middle; /* Align with text */
    transition: background-color 0.2s;
}

.popover-trigger:hover {
    background-color: #003A8E;
}

/* Style the popover content */
.popover-content {
    display: none; /* Hidden by default */
    position: absolute; /* Position relative to the modal content */
    background-color: #F5F5F5; /* Updated background color */
    color: #333; /* Updated text color for light background */
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 250px; /* Limit width */
    z-index: 1010; /* Ensure it's above other modal elements */
    top: 100%;
    left: 50%;
    border-color: #F5F5F5 transparent transparent transparent; /* Match background */
}

/* Optional: Add a small arrow/triangle to the popover */
.popover-content::after {
    /* Base styles for arrow (can be adjusted if positioning changes) */
    content: "";
    position: absolute;
    border-width: 6px;
    border-style: solid;
    /* Example: Arrow pointing down (when popover is above trigger) */
    top: 100%; 
    left: 50%;
    transform: translateX(-50%);
    border-color: #003A8E transparent transparent transparent; 
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    font-size: 32px;
    color: #003A8E;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
}

/* Add margin-top only when the error message is not empty */
.error-message:not(:empty) {
    margin-top: 0.5rem;
}

/* Loading Progress (New) */
.loading-progress {
    font-size: 14px;
    color: #666;
}

/* Loading Progress Bar (New - specific to overlay) */
.loading-progress .progress-bar {
    width: 300px;
    height: 20px;
    background-color: #f3f3f3;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

/* Loading Progress Fill (New - specific to overlay) */
.loading-progress .progress-fill {
    width: 0%;
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease-in-out;
}

/* Loading Progress Text (New - specific to overlay) */
.loading-progress .progress-text {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

/* Create Project Section (New) */
.create-project-section {
    display: flex;
    justify-content: flex-start; 
    margin: 2rem 0; 
}

/* Directory Selection Section (New) */
.directory-selection-section {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.directory-form {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.directory-label {
    font-weight: 500;
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.single-directory-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.directory-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    color: #333;
    min-width: 160px;
    transition: border-color 0.2s;
}

.directory-select:focus {
    outline: none;
    border-color: #B0CEFA;
}

.directory-name {
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
}

/* End Directory Selection Section */

/* Create Project Button (New) */
.create-project-btn {
    background-color: #003A8E;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: bold; 
    font-size: 24px; 
    padding: 0.5rem 2rem; 
    border: none;
    border-radius: 6px; 
    cursor: pointer;
    display: inline-flex; 
    align-items: center;
    gap: 0.75rem; 
    transition: background-color 0.2s ease;
}

.create-project-btn:hover {
    background-color: #002a66; 
}

/* Create Project Button Plus Icon (New) */
.create-project-btn .plus-icon {
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    width: 1.5em; 
    height: 1.5em; 
    border-radius: 50%; 
    border: 1px solid white; 
    font-weight: bold; 
    font-size: 1em; 
    line-height: 1;
}

/* Modal Styles (New/Specific) */
#create-project-modal .dialog-content {
    max-width: 700px;
    max-height: 95vh;
    overflow-y: auto;
}

/* Projects Section Header (New) */
.projects-section h2 {
    color: #003A8E;
    font-family: 'Poppins', sans-serif;
    font-weight: bold; 
    font-size: 32px;
}

#create-project-modal h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

#create-project-modal .file-input {
    margin-bottom: 0.5rem;
}

#create-project-modal .file-types {
    margin-bottom: 1.5rem;
}

/* Style for the Create Project modal title */
#create-project-modal .dialog-content h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    font-size: 32px;
    color: #003A8E;
}

/* Reduce margin specifically within the create project modal */
#create-project-modal .form-group {
    margin-bottom: 1rem;
}

/* Form grid layout for create project modal */
#create-project-modal #create-project-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    column-gap: 1rem;
}

/* Elements within the create project form that should span all columns */
#create-project-modal #create-project-form .form-group:has(#project-name-input),
#create-project-modal #create-project-form > h4:has(span[data-popover-target="popover-upload"]),
#create-project-modal #create-project-form > .custom-file-upload,
#create-project-modal #create-project-form > p.file-types,
#create-project-modal #create-project-form > .dialog-buttons {
    grid-column: 1 / -1;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    min-width: 200px;
}

.form-group input[type="text"]:focus {
    border-color: #B0CEFA;
    outline: none;
}

/* Hide the default file input */
#file-input {
    display: none;
}

/* Style the custom file upload area */
.custom-file-upload {
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f9f9f9;
    margin-bottom: 0.5rem;
}

.custom-file-upload:hover {
    border-color: #B0CEFA;
    background-color: #f0f8ff;
}

.custom-file-upload .upload-icon {
    font-size: 2rem;
    color: #B0CEFA;
    margin-bottom: 0.5rem;
}

.custom-file-upload .upload-text {
    color: #555;
    font-weight: 500;
}

.custom-file-upload .file-name {
    margin-top: 0.5rem;
    font-style: italic;
    color: #333;
    font-size: 0.9rem;
    display: block;
    min-height: 1.2em;
}

#create-project-modal .file-types {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #777;
    text-align: center;
}

/* Style for the Create Project modal title */
#create-project-modal .dialog-content h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    font-size: 32px;
    color: #003A8E;
} 

.logo {
    width: 60px;
    height: 60px;
    margin-right: 10px;
}

.resizable-container {
    resize: vertical;    
    overflow: hidden;  
    border: 1px solid #003A8E; 
    min-height: 30rem;
    height: 100%;
    /* max-height: max-content; */
    border-radius: 8px;  
}
  
.resizable-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Feedback Actions Container */
.feedback-actions-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Style for icon buttons (Add Chart, More Actions) */
.icon-button {
    background-color: #B0CEFA;
    color: #003A8E;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: #003A8E;
    color: white;
}

.icon-button svg {
    width: 1em;
    height: 1em;
}

/* Feedback Actions Menu (Dropdown container) */
.feedback-actions-menu {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    bottom: 100%;
    right: 0;
    margin-bottom: 5px;
    padding: 0.5rem 0;
}

.dropdown-item {
    color: black;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #e9e9e9;
    color: black;
}

/* Hide associated forms within the dropdown visually, but keep them in DOM */
.dropdown-content form {
    display: none;
}

/* Utility class to align an element to the right of its flex parent */
.align-parent-right {
    margin-left: auto;
}

/* Style for the Add Chart button inside the modal */
#chart-modal .dialog-buttons #submit-chart-button {
    background-color: #003A8E;
    color: white;
}

/* Hover style for the Add Chart button inside the modal */
#chart-modal .dialog-buttons #submit-chart-button:hover:not(:disabled) {
    background-color: #002a66;
    opacity: 1;
}

/* Style for the Add Chart header inside the modal */
#chart-modal .dialog-content h3 {
    color: #003A8E; 
}


