/* Formulaires admin : widgets, champs, slug, upload media, toggle. */

    .admin-editor-layout { max-width: 1200px; margin: 0 auto; }
    /* Default Title Input - fully rounded */
    .admin-title-input { width: 100%; font-size: 1.75rem; padding: 1rem 1.5rem; border: 1px solid var(--border); border-radius: calc(16px * var(--radius-scale)); background: var(--card-bg); color: var(--text-main); font-weight: 700; transition: border-color 0.2s; margin-bottom: 2rem; }
    .admin-title-input:focus { outline: none; border-color: var(--primary); z-index: 2; position: relative; }

    /* Adaptive Fusing: Only if followed by slug container */
    .admin-title-input:has(+ .admin-slug-container) {
        border-radius: calc(16px * var(--radius-scale)) calc(16px * var(--radius-scale)) 0 0;
        margin-bottom: 0;
    }

    .admin-title-input:has(+ .admin-slug-container):focus {
        box-shadow: none;
    }
    .admin-grid-columns { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; }
    @media (max-width: 1024px) {
        .admin-grid-columns { grid-template-columns: 1fr; }
    }
    .admin-widget { background: var(--card-bg); border: 1px solid var(--border); border-radius: calc(16px * var(--radius-scale)); margin-bottom: 2rem; overflow: hidden; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); }
    .admin-widget-header { padding: 1rem 1.5rem; font-weight: 700; border-bottom: 1px solid var(--border); background: var(--bg-main); color: var(--text-main); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
    .admin-widget-body { padding: 1.5rem; }
    .admin-help-text { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.4; }
    .admin-select, .admin-input { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: calc(10px * var(--radius-scale)); background: var(--bg-main); color: var(--text-main); font-size: 0.95rem; }
    .admin-select, .admin-select *, select, option { cursor: pointer; }
    .admin-label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
    .admin-checkbox-label { display: flex; align-items: flex-start; gap: 12px; font-size: 0.9rem; cursor: pointer; margin-bottom: 1rem; color: var(--text-main); }
    .admin-checkbox-label input { margin-top: 3px; accent-color: var(--primary); cursor: pointer; }
    .publish-preset-row { display: flex; gap: 8px; margin-bottom: 1.25rem; }
    .publish-preset-row .admin-select { flex: 1; }
    .admin-meta-list { margin-bottom: 1.5rem; }
    .admin-meta-item { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }
    .admin-meta-item i { color: var(--primary); width: 16px; }
    .admin-meta-item strong { color: var(--text-main); }
    .admin-meta-item a { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.85rem; margin-left: auto; cursor: pointer; }
    .admin-widget-footer { padding: 1.25rem 1.5rem; background: var(--bg-main); display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; }
    .publish-duplicate-form { margin-right: auto; }
    .admin-btn-publish { background: var(--primary); color: white; border: none; padding: 0.7rem 1.8rem; border-radius: calc(10px * var(--radius-scale)); font-weight: 700; cursor: pointer; box-shadow: none !important; transition: background 0.2s ease; }
    .admin-btn-publish:hover { background: var(--primary-dark); }
    .thumbnail-upload { min-height: 200px; border: 2px dashed var(--border); border-radius: calc(12px * var(--radius-scale)); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; background: var(--bg-main); text-align: center; gap: 8px; overflow: hidden; padding: 10px; }
    .thumbnail-upload:hover { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.05); color: var(--primary); }
    .thumbnail-upload img { max-width: 100%; max-height: 500px; object-fit: contain; }
    .admin-edit-panel { background: var(--bg-main); border: 1px solid var(--border); border-radius: calc(10px * var(--radius-scale)); padding: 1rem; margin-top: 0.5rem; display: none; }
    .btn { padding: 0.6rem 1rem; border-radius: calc(8px * var(--radius-scale)); font-size: 0.85rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--bg-main); color: var(--text-main); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
    .admin-items-list { background: var(--bg-main); border: 1px solid var(--border); border-radius: calc(10px * var(--radius-scale)); padding: 1rem; max-height: 200px; overflow-y: auto; }
    .btn-delete-small { background: transparent; border: none; color: var(--danger); opacity: 0.5; cursor: pointer; transition: opacity 0.2s; padding: 4px; }
    .btn-delete-small:hover { opacity: 1; }
    
    /* Media Cards for content pages */
    .medias-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
    .media-card { position: relative; border-radius: calc(10px * var(--radius-scale)); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1/1.4; background: var(--card-bg); cursor: move; display: flex; flex-direction: column; }
    .media-card img { width: 100%; height: auto; flex: 1; min-height: 0; object-fit: cover; }
    .media-card .card-footer { padding: 0.5rem; background: var(--bg-main); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
    .media-card .remove-btn { position: absolute; top: 5px; right: 5px; background: rgba(var(--danger-rgb), 0.9); color: white; border: none; border-radius: calc(50% * var(--radius-scale)); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.7rem; z-index: 2; }
    .media-card-select-checkbox { position: absolute; top: 5px; left: 5px; z-index: 2; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); border-radius: calc(5px * var(--radius-scale)); cursor: pointer; }
    .media-card-select-checkbox input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
    .media-card-selected { outline: 3px solid var(--primary); outline-offset: -3px; }

    /* Barre d'action groupee : selectionner plusieurs pages puis appliquer
       un tier a toutes en un coup, au lieu de changer le select une par une. */
    .bulk-tier-bar { display: none; align-items: center; gap: 10px; margin-top: 1rem; padding: 0.75rem 1rem; background: rgba(var(--primary-rgb), 0.06); border: 1px solid var(--primary); border-radius: calc(10px * var(--radius-scale)); flex-wrap: wrap; }
    .bulk-tier-count { font-size: 0.85rem; font-weight: 600; color: var(--primary); margin-right: auto; }
    .bulk-tier-select { width: auto; min-width: 180px; }
    .medias-empty { min-height: 200px; border: 2px dashed var(--border); border-radius: calc(12px * var(--radius-scale)); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; background: var(--bg-main); text-align: center; gap: 8px; overflow: hidden; padding: 2rem; transition: all 0.2s; }
    .medias-empty:hover { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.05); color: var(--primary); }
    .premium-toggle { cursor: pointer; width: 32px; height: 32px; border-radius: calc(6px * var(--radius-scale)); display: flex; align-items: center; justify-content: center; background: var(--bg-main); border: 1px solid var(--border); color: var(--text-muted); transition: all 0.2s; }
    .premium-toggle.active { background: rgba(var(--warning-rgb), 0.1); color: var(--warning); border-color: var(--warning); }

    /* Video Upload Specific */
    .video-upload { min-height: 120px; border: 2px dashed var(--border); border-radius: calc(12px * var(--radius-scale)); display: flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; background: var(--bg-main); text-align: center; gap: 15px; overflow: hidden; padding: 2rem; transition: all 0.2s; }
    .video-upload:hover { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.05); color: var(--primary); }
    .video-upload video { max-width: 100%; max-height: 300px; border-radius: calc(8px * var(--radius-scale)); }
    .video-upload i { font-size: 2.5rem; opacity: 0.5; }

    /* Slug Widget Styles - Premium Redesign */
    .admin-slug-container { 
        margin-top: -1px; 
        margin-bottom: 2.5rem; 
        padding: 0.6rem 1.5rem 1rem; 
        display: flex; 
        align-items: center; 
        gap: 12px; 
        background: var(--card-bg); 
        border: 1px solid var(--border); 
        border-top: none; 
        border-radius: 0 0 calc(16px * var(--radius-scale)) calc(16px * var(--radius-scale));
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        position: relative;
        z-index: 1;
    }
    .admin-slug-url-wrapper {
        display: flex;
        align-items: center;
        background: rgba(0, 0, 0, 0.05);
        padding: 0.5rem 1rem;
        border-radius: calc(10px * var(--radius-scale));
        border: 1px solid transparent;
        flex: 1;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        font-size: 0.8rem;
        transition: all 0.2s;
    }
    .admin-slug-url-wrapper:focus-within {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
    }
    .admin-slug-base {
        color: var(--text-muted);
        user-select: none;
        white-space: nowrap;
    }
    .admin-slug-input {
        background: transparent;
        border: none;
        color: var(--primary);
        font-weight: 600;
        padding: 0;
        margin-left: 2px;
        width: 100%;
        outline: none;
    }
    .admin-slug-btn-copy {
        background: var(--bg-main);
        border: 1px solid var(--border);
        width: 34px;
        height: 34px;
        border-radius: calc(8px * var(--radius-scale));
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text-muted);
        transition: all 0.2s;
    }
    .admin-slug-btn-copy:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    /* Toggle Switch CSS */
    .switch { position: relative; display: inline-block; width: 44px; height: 24px; }
    .switch input { opacity: 0; width: 0; height: 0; }
    .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; }
    .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; }
    input:checked + .slider { background-color: var(--primary); }
    input:focus + .slider { box-shadow: 0 0 1px var(--primary); }
    input:checked + .slider:before { transform: translateX(20px); }
    .slider.round { border-radius: calc(24px * var(--radius-scale)); }
    .slider.round:before { border-radius: calc(50% * var(--radius-scale)); }
