/* /library-manager.css - Styles for the new Manager Console */

/* --- Root & Loading States --- */
#manager-console-root {
    padding-top: 80px; /* Space for site header */
    color: #fff;
}

.loading-spinner-scribe {
    /* Assuming this class exists elsewhere, if not, define a loader */
    min-height: 100px;
}

/* --- Console Main Layout --- */
.manager-console-wrapper {
    display: flex;
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    min-height: calc(100vh - 80px); /* Full height minus header */
}

/* --- Console Sidebar --- */
.console-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: rgba(15, 17, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    align-self: flex-start; /* Sticks to top */
}

.console-sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.console-title {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
}

.console-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.console-nav-link {
    padding: 12px 15px;
    text-decoration: none;
    color: #a9b3c1;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.console-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.console-nav-link.active {
    background-color: #4a90e2;
    color: #fff;
}

/* --- Console Main Content --- */
.console-main-content {
    flex-grow: 1;
    background: rgba(15, 17, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 30px;
}

.console-view-container.hidden {
    display: none;
}

.console-view-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.console-view-header h1 {
    margin: 0;
    font-size: 2rem;
}

.console-section h3 {
    font-size: 1.25rem;
    margin: 0 0 10px 0;
}

.console-section p {
    color: #a9b3c1;
    margin: 0 0 20px 0;
    max-width: 800px;
}

.console-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

/* --- Shared Button Styles --- */
.action-btn-primary {
    padding: 10px 25px;
    background: linear-gradient(45deg, #4a90e2, #5aa1f2);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
.action-btn-primary:disabled {
    background: #4a5568;
    cursor: not-allowed;
    opacity: 0.7;
}
.action-btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

/* --- NEW: Site Settings Media Grid --- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.media-card {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: #0c0d12;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-card img,
.media-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-card-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
    opacity: 1;
    transition: opacity 0.2s;
}

.media-card:hover .media-card-overlay {
    opacity: 0;
}

.media-card .delete-media-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: scale(0.8);
    z-index: 10;
}

.media-card:hover .delete-media-btn {
    opacity: 1;
    transform: scale(1);
}

.media-card .delete-media-btn:hover {
    background-color: #ef4444;
}

.media-card .media-type-icon {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: rgba(0,0,0,0.6);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 5;
}

/* ====================================================================
--- SCOPED: Library Layout Manager Styles (Your Original CSS) ---
====================================================================
*/

/* We scope all your original styles inside the #view-library-layout container */
#view-library-layout .manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

#view-library-layout .manager-header h1 {
    margin: 0;
    font-size: 2rem;
}

#view-library-layout .manager-workspace {
    display: grid;
    grid-template-columns: 280px 1fr; /* Sidebar | Preview Area */
    gap: 30px;
    min-height: 60vh; /* Ensure it has some height */
}

#view-library-layout .manager-sidebar {
    background: rgba(15, 17, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
}

#view-library-layout .manager-sidebar h3 {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

#view-library-layout .add-block-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#view-library-layout .add-block-btn {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #ccc;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

#view-library-layout .add-block-btn:hover {
    background-color: rgba(74, 144, 226, 0.1);
    border-color: #4a90e2;
    color: #fff;
}

#view-library-layout .layout-preview-area {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    min-height: 400px; /* Ensure drop zone has height */
}

#view-library-layout .layout-block-preview {
    background: #1a1c29;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: grab; /* Indicate draggable */
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
#view-library-layout .layout-block-preview:active {
    cursor: grabbing;
}

#view-library-layout .block-header {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced gap */
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Add separator */
    padding-bottom: 10px;
}

#view-library-layout .drag-handle {
    font-size: 1.2rem;
    color: #6b7280;
    cursor: grab;
    padding: 0 5px;
}
#view-library-layout .drag-handle:active {
    cursor: grabbing;
}

#view-library-layout .block-type-label {
    background-color: #4a5568;
    color: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem; /* Smaller */
    font-weight: bold;
    text-transform: uppercase;
    flex-shrink: 0;
}

#view-library-layout .block-title {
    flex-grow: 1;
    font-weight: 500;
    color: #eee;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.9rem; /* Smaller */
}

#view-library-layout .block-content-preview {
    font-size: 0.85rem;
    color: #9ca3af; /* Lighter grey */
    padding-top: 5px;
}
#view-library-layout .block-content-preview strong {
    color: #e2e8f0;
    font-weight: 500;
}

#view-library-layout .block-actions button {
    background: none;
    border: 1px solid #4a5568;
    color: #a9b3c1;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 5px;
}
#view-library-layout .block-actions button:hover {
    background-color: #4a5568;
    color: #fff;
}
#view-library-layout .block-actions button[data-action="delete-block"]:hover {
    background-color: #ef4444;
    border-color: #ef4444;
}

/* --- Drag & Drop Styles --- */
#view-library-layout .layout-block-preview.dragging {
    opacity: 0.5;
    background: #2a2d3a;
}

#view-library-layout .placeholder {
    height: 60px; /* Example height, adjust */
    background: rgba(74, 144, 226, 0.1);
    border: 2px dashed #4a90e2;
    border-radius: 6px;
    margin: 15px 0; /* Match block margin */
}

/* --- Modal Styles (Global) --- */
.scheduler-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(9, 10, 15, 0.7); backdrop-filter: blur(8px);
    z-index: 5000; display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.scheduler-modal-overlay.is-visible { display: flex; opacity: 1; }

.scheduler-modal-content {
    background: #0f111a; border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px; padding: 30px; width: 100%; max-width: 500px;
    transform: scale(0.95); transition: transform 0.3s ease;
}
.scheduler-modal-overlay.is-visible .scheduler-modal-content { transform: scale(1); }

.scheduler-modal-content h3 { margin: 0 0 20px 0; }
.scheduler-modal-content .form-field { margin-bottom: 18px; }
.scheduler-modal-content label { display: block; margin-bottom: 6px; color: #ccc; font-size: 0.9rem; font-weight: 500; }
.scheduler-modal-content input[type="text"],
.scheduler-modal-content input[type="number"],
.scheduler-modal-content select {
    width: 100%; padding: 10px; background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; color: #fff;
    font-size: 0.9rem;
}
    .scheduler-modal-content small,
    .scheduler-modal-content .info-text {
        font-size: 0.8rem; color: #8b949e; margin-top: 5px; display: block;
    }

.scheduler-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.scheduler-actions button { padding: 10px 20px; border-radius: 5px; font-weight: bold; cursor: pointer; border: none; }
.schedule-cancel-btn { background-color: #4a5568; color: #fff; }
.schedule-confirm-btn { background-color: #4a90e2; color: #fff; }

.error-message { color: #fca5a5; text-align: center; padding: 20px; }