/*--------------------Classrooms Page Building----------------------*/

#csuk-classroom-content, 
#csuk-classroom-builder {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.edit-mode {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 🔹 Base Classroom Row */
.csuk-classroom-row {
    display: block; /* To allow a drag handle + row-inner block layout */
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease-in-out;
    width: 100%;
}

/* 🔹 Row Flex Container Inside */
.csuk-row-inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

/* 🔹 Edit Mode Styles */
.edit-mode .csuk-classroom-row {
    border: 1px dashed #bbb;
    background: #fcfcfc;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.edit-mode .csuk-classroom-column {
    border: 1px dashed #ddd;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    transition: background 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.edit-mode .csuk-classroom-column:hover {
    background: #f5f5f5;
    border-color: #aaa;
}

/* 🔹 Column Widths */
.csuk-classroom-column[data-width="100%"] {
    flex: 0 0 100%;
    max-width: 100%;
}
.csuk-classroom-column[data-width="66.66%"] {
    flex: 0 0 calc(66.66% - 5px) !important;
    max-width: calc(66.66% - 5px) !important;
}
.csuk-classroom-column[data-width="50%"] {
    flex: 0 0 calc(50% - 5px) !important;
    max-width: calc(50% - 5px) !important;
}
.csuk-classroom-column[data-width="33.33%"] {
    flex: 0 0 calc(33.33% - 7px) !important;
    max-width: calc(33.33% - 7px) !important;
}


/* 🔹 Column Base Style */
.csuk-classroom-column {
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    padding: 8px;
}

/* 🔹 Drag Handles */
.csuk-drag-handle {
    text-align: center;
    cursor: grab;
    font-size: 16px;
    color: #555;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #ccc;
}

.csuk-column-drag-handle {
    cursor: grab;
    font-size: 14px;
    padding: 2px 6px;
    background-color: #ddd;
    border-radius: 4px;
    margin-bottom: 6px;
    display: inline-block;
}

/* 🔹 Only show drag handles in edit mode */
#classroom-builder:not(.edit-mode) .csuk-drag-handle,
#classroom-builder:not(.edit-mode) .csuk-column-drag-handle {
    display: none;
}


/* =========================
   ROW DELETE BUTTON (Top Right of Row)
   ========================= */
.csuk-row-delete-btn {
	position: absolute;
	top: 5px;
	right: 5px;
	background: #f44336;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	padding: 4px 8px;
	z-index: 10;
}

/* =========================
   COLUMN CONTAINER
   ========================= */
.csuk-classroom-column {
	position: relative; /* Required for positioning buttons inside */
}

/* =========================
   COLUMN ACTIONS WRAPPER
   ========================= */
.csuk-column-actions {
	position: absolute;
	top: 5px;
	right: 5px;
	display: flex;
	gap: 5px;
	z-index: 10;
}

/* =========================
   COLUMN ACTION BUTTONS
   ========================= */
.csuk-column-actions button {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	font-size: 14px;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

/* Reset Button */
.csuk-column-reset-btn {
	background: #bbb;
	color: #fff;
}

.csuk-column-reset-btn:hover {
	background: #999;
}

/* Delete Button */
.csuk-delete-column-btn {
	background: red;
	color: white;
	font-weight: bold;
}

.csuk-delete-column-btn:hover {
	background: darkred;
}


.csuk-theory-page-wrapper {
    font-family: 'Segoe UI', sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.csuk-theory-title {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.csuk-section-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.csuk-post-selector label {
    font-weight: bold;
    margin-right: 10px;
}

#theory-post-select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.csuk-tab-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.csuk-tab-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #f0f0f0;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.csuk-tab-button.active {
    background-color: #5c6bc0;
    color: #fff;
}





#classroom-builder #toolbar {
    align-items: center;
}

#toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

#toolbar button {
    background-color: #5c6bc0;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

#toolbar button:hover {
    background-color: #3f51b5;
}

#add-row {
    margin: 20px 0;
    display: block;
}

#content-area {
    border: 2px dashed #ccc;
    min-height: 150px;
    padding: 20px;
    border-radius: 10px;
    background-color: #fafafa;
}

#assignment-form {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

#assignment-form label {
    font-weight: bold;
}

#assignment-form input,
#assignment-form textarea {
    margin-top: 5px;
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.csuk-button {
    cursor: pointer;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: #0073aa;
    color: white;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s ease-in-out;
}

.csuk-button:hover {
    background: #005f8b;
}

/* 🔹 Edit & Delete Buttons */
.csuk-edit-button,
.csuk-delete-button {
    margin-top: 5px;
    display: inline-block;
    background: #0073aa;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.csuk-edit-button:hover,
.csuk-delete-button:hover {
    background: #005f8b;
}

/* 🔹 Form Inputs */
.csuk-textarea, 
.csuk-input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
}

/* 🔹 Read-Only Mode */
.csuk-read-only {
    pointer-events: none;
    background: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
    color: #555;
}

/**************************** Classroom Dashboard ****************************/

#csuk-dashboard-container {
    display: flex;  /* ✅ Enables side-by-side layout */
    flex-direction: row;  /* ✅ Ensures horizontal alignment */
    height: 80vh;
    gap: 15px;
    margin-top: 10px;
}

#csuk-dashboard {
    max-width: 1800px;
    margin: auto;
}

/* 🔹 Classroom Bar - Narrower and Styled Like Tabs */
#csuk-classroom-tabs {
    display: flex;
    gap: 10px;
    background: #f8f8f8;
    border-radius: 8px;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
    align-items: center;
}

/* 🔹 Classroom Tabs (Look Like Navigation Tabs) */
.csuk-classroom-tab {
    background: white;
    padding: 10px 15px;
    text-align: center;
    border-radius: 8px 8px 0 0; /* ✅ Tabs Style */
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    position: relative;
    box-shadow: none;
    font-size: 14px;
    min-width: 120px; /* ✅ Ensure consistent width */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.csuk-classroom-tab:hover {
    background: #eaf6ff;
    border-color: #0073aa;
}

.csuk-classroom-tab.active {
    background: #0073aa;
    color: white;
    border-color: #005f8b;
}

/* 🔹 Classroom Title */
.csuk-classroom-title {
    font-size: 16px;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

/* 🔹 Edit Actions Hidden By Default */
.csuk-classroom-actions, .csuk-page-actions {
    display: none;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

/* 🔹 Override Theme Button Styles */
.csuk-classroom-actions button,
.csuk-page-actions button {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: transform 0.2s ease-in-out;
    color: #555 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 🔹 Hover Effect */
.csuk-classroom-actions button:hover,
.csuk-page-actions button:hover {
    transform: scale(1.2);
    color: #0073aa !important;
}

/* 🔹 Icons Styling */
.csuk-classroom-actions button img,
.csuk-page-actions button img {
    width: 16px !important;
    height: 16px !important;
}

/* 🔹 Show Edit Actions on Hover (Only in Edit Mode) */
.edit-mode .csuk-classroom-tab:hover .csuk-classroom-actions,
.edit-mode .csuk-page-tab:hover .csuk-page-actions {
    display: flex;
}

/* 🔹 Create Classroom & Create Page Buttons (Unified Styling) */
#csuk-create-classroom,
#csuk-create-classroom-page {
    background: #0073aa;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    display: inline-block;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    width: auto;
    height: auto;
}

/* 🔹 Hover Effect */
#csuk-create-classroom:hover,
#csuk-create-classroom-page:hover {
    background: #005f8b;
    box-shadow: 0 5px 10px rgba(0, 115, 170, 0.2);
}

/* 🔹 Ensure it Doesn't Become a Large Tile */
#csuk-create-classroom.nopreloader,
#csuk-create-classroom-page.nopreloader {
    grid-column: span 1; /* ✅ Prevents it from expanding like tiles */
    align-self: center;
    justify-self: center;
}

#csuk-create-classroom-page {
	margin-top: 20px;
}

/* 🔹 Narrower Page Sidebar */
#csuk-page-sidebar {
    width: 200px; /* ✅ Reduced width */
    padding: 10px;
    background: white;
    border-right: 2px solid #ddd;
    display: flex;
    flex-direction: column;
	margin-top: 0px;
}

/* 🔹 Page Tabs - Look More Like Navigation */
#csuk-page-tabs {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 🔹 Page Tabs */
.csuk-page-tab {
    background: white;
    padding: 8px;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    position: relative;
    box-shadow: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.csuk-page-tab:hover {
    background: #eaf6ff;
    border-color: #0073aa;
}

.csuk-page-tab.active {
    background: #0073aa;
    color: white;
    border-color: #005f8b;
}

/* 🔹 Page Title */
.csuk-classroom-page-title {
    font-size: 14px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

/* 🔹 Ensure Edit Page Title Button Matches Other Page Action Buttons */
.csuk-edit-page-title {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: transform 0.2s ease-in-out;
    color: #555 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 🔹 Hover Effect */
.csuk-edit-page-title:hover {
    transform: scale(1.2);
    color: #0073aa !important;
}

/* 🔹 Edit Page Title Icon */
.csuk-edit-page-title img {
    width: 16px !important;
    height: 16px !important;
}



/* 🔹 Main Content Area */
#csuk-main-content {
    flex-grow: 1;
    background: white;
    overflow-y: auto;
}

/* 🔹 Modal Overlay (Dark Background) */
#csuk-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999; /* ✅ Ensure it appears below modal */
    display: none; /* ✅ Hidden by default */
}

/* 🔹 Modal Container */
#csuk-image-search-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* ✅ Perfectly centers the modal */
    width: 80%;
    max-width: 600px;
    height: auto;
    background: white;
    padding: 20px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000; /* ✅ Ensure it's on top */
    border-radius: 8px;
    display: none; /* ✅ Hidden by default */
}

/* 🔹 Modal Content */
.csuk-modal-content {
    position: relative;
}

/* 🔹 Close Button */
.csuk-close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #444;
    transition: color 0.3s ease;
}

.csuk-close-modal:hover {
    color: red;
}

/* 🔹 Image Search Frame */
#csuk-image-search-frame {
    width: 100%;
    height: 400px;
    border: none;
}

/* 🔹 Input Field for Pasting Image URL */
#csuk-image-url-input {
    width: 80%;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 🔹 Buttons */
#csuk-paste-image-url,
#csuk-insert-image {
    margin-top: 10px;
    padding: 8px 15px;
    background: #0073aa;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

#csuk-insert-image:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/*---------------------Adding Elements Icon Styling------------------*/

.csuk-element-selector {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    justify-content: center;
}

.csuk-element-selector button {
    background: #f2f2f2;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
}

.csuk-element-selector button:hover {
    background: #f3f3f3;
}

/*---------------Add Row----------*/


/* 🔹 Row Selection Menu Styling */
.csuk-row-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: absolute; /* ✅ Ensures it appears above content */
    top: 50px; /* ✅ Adjust this based on your layout */
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10000; /* ✅ Ensures it appears above other content */
}

/* 🔹 Ensure buttons inside row selection menu are visible */
.csuk-row-selection button {
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    background: #0073aa;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s ease-in-out;
}

.csuk-row-selection button:hover {
    background: #005f8b;
}



/*---------Text Generation and Ai---------*/

/* ✅ Text Mode Toggle */
.csuk-text-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.csuk-toggle-text {
    padding: 6px 12px;
    border: 1px solid #ccc;
    cursor: pointer;
    background: white;
    transition: 0.3s ease-in-out;
    border-radius: 5px;
}

.csuk-toggle-text.csuk-active {
    background: #0073aa;
    color: white;
    border-color: #005f8b;
}

/* ✅ Editable Text Box */
.csuk-text-editor {
    width: 100%;
    min-height: 100px;
    outline: none;
    overflow-y: auto;
}

.csuk-text-editor:empty:before {
    content: attr(placeholder);
    color: #aaa;
}

.csuk-textarea-code {
    display: none; /* ✅ Ensures the textarea is hidden by default */
    width: 100%;
    height: 100px;
    font-family: monospace;
}

/* ✅ AI Modal */
.csuk-ai-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background: white;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    z-index: 1000;
}

.csuk-ai-modal-content {
    text-align: center;
}

.csuk-ai-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #444;
}

.csuk-ai-close:hover {
    color: red;
}

#csuk-ai-prompt {
    width: 90%;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#csuk-ai-generate {
    margin-top: 10px;
    padding: 8px 12px;
    background: #0073aa;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

/*------------------- Drag & Drop Handles --------------------*/

/* Row drag handle (separate row, full width) */
.csuk-drag-handle {
    width: 100%;
    text-align: left;
    cursor: grab;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
}



/*-------------------Editor Tool Bar CSS----------------*/

.csuk-text-toolbar button {
	padding: 5px;
    border-radius: 0px;
    background: white;
    color: black;
    border: 1px solid black;
}



