/* =======================
   GLOBAL STYLES
======================= */

body {
    background: #ffffff;
    font-family: 'Cabin', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
font-weight: 400;
}

b, strong {
font-weight: 700 !important;
}

/* Typography */
label {
    font-size: 12px; /* Same as Bootstrap's small text */
    text-transform: uppercase;
    color: #6c757d;
    width: 100%;
}

.ck-content {
    font-size: 1rem;
    text-transform: none;
    color: #212529; /* Bootstrap text color */
    line-height: 1.5;
}

.nav-link {
    padding-top: 10px;
    padding-bottom: 6px;
}

/* Footer */
footer {
    font-size: 0.875em;
    color: #6c757d;
    text-align: center;
}

/* =======================
   LOGIN PAGE STYLES
======================= */

body.login-page {
    background: rgba(0, 0, 0, 0.5);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.branding {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #333;
    letter-spacing: 1px;
}

.branding strong {
    color: #007bff;
}

.login-container {
    background: white;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.8s ease forwards;
}

.login-title {
    margin-bottom: 1.5rem;
    font-weight: bold;
    text-align: center;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* =======================
   MEDIA SORTING STYLES
======================= */

.media-placeholder {
    background: #eee;
    border: 2px dashed #ccc;
    min-height: 50px;
    margin-bottom: 1em;
}

.media-handle {
    cursor: move;
}

.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    background: #f0f0f0;
}

.sortable-drag {
    opacity: 0.8;
}

/* =======================
   SESSION WARNING POPUP
======================= */

#session-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.session-warning-overlay {
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9998;
}

.session-warning-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2em;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    z-index: 9999;
}

.session-warning-buttons {
    margin-top: 1.5em;
    display: flex;
    justify-content: center;
    gap: 1em;
}

/* =======================
   INDEX STYLING
======================= */

.card {
    border: none;
    border-radius: 12px;
    background: #f8ff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.card-body ul {
    padding-left: 0;
    list-style: none;
}

.card-body ul li {
    margin-bottom: 0.5em;
}

.card-body ul li a {
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
    margin-left: 0;
    transition: all 0.4s ease;
}

.card-body ul li a:hover {
    color: #333;
    font-weight: 700;
    margin-left: 6px;
}

ul.fade-group li {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.fade-group li .full-link {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

ul.fade-group li .full-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-check:checked+.btn-outline-warning {
    color: #ffffff;
}

/* Apply Bootstrap styling to the editable area */
.ck-rounded-corners .ck.ck-editor__main > .ck-content.ck-editor__editable,
.ck.ck-editor__main > .ck-content.ck-editor__editable.ck-rounded-corners {
    min-height: 300px;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
    font-size: 1rem;
    font-family: inherit;
    color: #212529;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.075);
}

/* Focus styles too */
.ck-rounded-corners .ck.ck-editor__main > .ck-content.ck-editor__editable:focus,
.ck.ck-editor__main > .ck-content.ck-editor__editable.ck-rounded-corners:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content,
.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-rounded-corners {
    background: #f8f9fa; /* Bootstrap light gray */
    border: 0px solid #ced4da;
    border-radius: 0.375rem; /* Rounded top only */
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0 0.5rem 0;
}

.ck.ck-toolbar .ck.ck-button {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #212529;
}

.ck.ck-toolbar {
    background: transparent;
}

.ck.ck-toolbar .ck.ck-button.ck-on {
    background-color: #0d6efd; /* Bootstrap primary */
    color: #fff;
}

/* Wrap the entire CKEditor like a Bootstrap form-control */
.ck.ck-editor {
    margin-bottom: 1rem;
}

.fade-in {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in.show {
    opacity: 1;
    transform: translateY(0);
}

img.preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}