/* ==========================================================================
   MAZINE / SOUTH ASIAN ENTERTAINMENT MAGAZINE — ADMIN CMS STYLESHEET
   Clean, modern, editorial dashboard designed for non-coders and editors.
   ========================================================================== */

:root {
    --admin-sidebar-bg: #111827;
    --admin-sidebar-hover: #1F2937;
    --admin-sidebar-active: #EDB532;
    --admin-primary: #111827;
    --admin-accent: #EDB532;
    --admin-red: #B91C1C;
    --admin-green: #059669;
    --admin-blue: #2563EB;
    --admin-bg: #F8FAFC;
    --admin-card-bg: #FFFFFF;
    --admin-border: #E2E8F0;
    --admin-text: #1E293B;
    --admin-text-muted: #64748B;
    --admin-font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --admin-font-heading: 'Playfair Display', Georgia, serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: var(--admin-font-sans);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   ADMIN SIDEBAR
   -------------------------------------------------------------------------- */
.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar-bg);
    color: #F3F4F6;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}
.admin-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-brand h2 {
    font-family: var(--admin-font-heading);
    font-size: 1.4rem;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}
.admin-brand span {
    font-size: 0.72rem;
    color: var(--admin-accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    display: block;
}

.admin-nav {
    padding: 16px 0;
    flex-grow: 1;
    list-style: none;
}
.admin-nav-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px 6px;
}
.admin-nav-item {
    margin: 2px 10px;
}
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}
.admin-nav-link i {
    width: 18px;
    font-size: 0.95rem;
    text-align: center;
}
.admin-nav-link:hover {
    background: var(--admin-sidebar-hover);
    color: #FFFFFF;
}
.admin-nav-link.active {
    background: var(--admin-accent);
    color: #111827;
    font-weight: 700;
}
.admin-nav-badge {
    margin-left: auto;
    background: var(--admin-red);
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}
.admin-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
.admin-sidebar-user-name {
    font-weight: 600;
    font-size: 0.84rem;
    color: #FFFFFF;
    line-height: 1.2;
}
.admin-sidebar-user-role {
    font-size: 0.72rem;
    color: var(--admin-accent);
    text-transform: capitalize;
}

/* --------------------------------------------------------------------------
   ADMIN MAIN CONTENT
   -------------------------------------------------------------------------- */
.admin-main-wrap {
    margin-left: 260px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.admin-top-header {
    background: #FFFFFF;
    border-bottom: 1px solid var(--admin-border);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
}
.admin-page-title-box h1 {
    font-family: var(--admin-font-heading);
    font-size: 1.5rem;
    color: var(--admin-primary);
}
.admin-top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.btn-admin-view-site {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F1F5F9;
    color: var(--admin-text);
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--admin-border);
    transition: background 0.2s;
}
.btn-admin-view-site:hover {
    background: #E2E8F0;
}

/* --------------------------------------------------------------------------
   BUTTON SYSTEM (.btn, .btn-primary, .btn-secondary, .btn-light, .btn-danger, .btn-sm)
   -------------------------------------------------------------------------- */
.btn,
.btn-admin-primary,
.btn-admin-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--admin-font-sans);
    line-height: 1.4;
}

.btn:hover,
.btn-admin-primary:hover,
.btn-admin-danger:hover {
    transform: translateY(-1px);
}

.btn-primary,
.btn-admin-primary {
    background-color: var(--admin-primary);
    color: #FFFFFF;
    border-color: var(--admin-primary);
}
.btn-primary:hover,
.btn-admin-primary:hover {
    background-color: #1E293B;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: #F1F5F9;
    color: var(--admin-text);
    border-color: #CBD5E1;
}
.btn-secondary:hover {
    background-color: #E2E8F0;
    color: #0F172A;
}

.btn-light {
    background-color: #FFFFFF;
    color: #475569;
    border-color: #CBD5E1;
}
.btn-light:hover {
    background-color: #F8FAFC;
    color: #1E293B;
    border-color: #94A3B8;
}

.btn-danger,
.btn-admin-danger {
    background-color: var(--admin-red);
    color: #FFFFFF;
    border-color: var(--admin-red);
}
.btn-danger:hover,
.btn-admin-danger:hover {
    background-color: #991B1B;
    color: #FFFFFF;
}

.btn-success {
    background-color: var(--admin-green);
    color: #FFFFFF;
    border-color: var(--admin-green);
}
.btn-success:hover {
    background-color: #047857;
}

.btn-sm {
    padding: 5px 11px;
    font-size: 0.78rem;
    border-radius: 4px;
}
.btn-lg {
    padding: 12px 24px;
    font-size: 0.95rem;
}

.admin-body-content {
    padding: 28px;
    flex-grow: 1;
}

/* --------------------------------------------------------------------------
   PAGE HEADER & GRID LAYOUTS
   -------------------------------------------------------------------------- */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-page-header .header-left h1 {
    font-family: var(--admin-font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--admin-primary);
    margin-bottom: 4px;
}
.admin-page-header .header-left .subtitle {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
}
.admin-page-header .header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-grid-2cols {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 1024px) {
    .admin-grid-2cols {
        grid-template-columns: 1fr;
    }
}

.admin-grid-3cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}
@media (max-width: 1024px) {
    .admin-grid-3cols {
        grid-template-columns: 1fr;
    }
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--admin-border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}
.tab-item {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748B;
    text-decoration: none;
    background: #FFFFFF;
    border: 1px solid var(--admin-border);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.tab-item:hover {
    background: #F1F5F9;
    color: #0F172A;
}
.tab-item.active {
    background: var(--admin-primary);
    color: #FFFFFF;
    border-color: var(--admin-primary);
}
.tab-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: #F1F5F9;
    color: #475569;
}
.tab-item.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   METRIC STATS CARDS
   -------------------------------------------------------------------------- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: #FFFFFF;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.stat-icon-blue { background: #EFF6FF; color: #2563EB; }
.stat-icon-green { background: #ECFDF5; color: #059669; }
.stat-icon-gold { background: #FEF3C7; color: #D97706; }
.stat-icon-red { background: #FEE2E2; color: #DC2626; }
.stat-icon-purple { background: #F5F3FF; color: #7C3AED; }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--admin-primary);
    line-height: 1.1;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--admin-text-muted);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   DATA TABLES & CARDS
   -------------------------------------------------------------------------- */
.admin-card {
    background: #FFFFFF;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 24px;
    overflow: hidden;
}
.admin-card > .card-header,
.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--admin-border);
    background: #FFFFFF;
}
.card-header h2,
.card-header h3,
.admin-card-header h2,
.admin-card-header h3,
.admin-card-title {
    font-family: var(--admin-font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--admin-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.admin-card > .card-body {
    padding: 22px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-table th {
    background: #F8FAFC;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #F1F5F9;
    color: var(--admin-text);
    vertical-align: middle;
}
.admin-table tr:hover td {
    background: #F8FAFC;
}

/* Badges */
.badge,
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}
.badge-primary { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.badge-success, .status-published, .status-active, .status-approved { background: #DEF7EC; color: #03543F; border: 1px solid #BCF0DA; }
.badge-secondary, .status-draft, .status-pending { background: #FEF08A; color: #713F12; border: 1px solid #FDE047; }
.badge-danger, .status-trash, .status-spam, .status-banned, .status-suspended { background: #FDE8E8; color: #9B1C1C; border: 1px solid #F8B4B4; }
.badge-info, .status-scheduled { background: #E0E7FF; color: #3730A3; border: 1px solid #C7D2FE; }

.table-actions,
.action-buttons-cell {
    display: flex;
    gap: 6px;
    align-items: center;
}
.btn-action,
.btn-table-action {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    text-decoration: none;
    border: 1px solid #CBD5E1;
    background: #F8FAFC;
    color: #475569;
    transition: all 0.15s;
    cursor: pointer;
}
.btn-action:hover,
.btn-table-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.btn-action.edit:hover {
    background: #EFF6FF;
    color: #2563EB;
    border-color: #93C5FD;
}
.btn-action.view:hover {
    background: #ECFDF5;
    color: #059669;
    border-color: #A7F3D0;
}
.btn-action.delete,
.btn-table-delete {
    color: #DC2626;
}
.btn-action.delete:hover,
.btn-table-delete:hover {
    background: #FEE2E2;
    color: #B91C1C;
    border-color: #FCA5A5;
}

/* --------------------------------------------------------------------------
   FORM CONTROLS & FIELDS
   -------------------------------------------------------------------------- */
.form-group,
.admin-form-group {
    margin-bottom: 18px;
}

.form-group label,
.admin-form-group label,
.admin-label,
label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-group label .required,
.admin-form-group label .required,
span.required {
    color: #DC2626;
    font-weight: 700;
}

.form-control,
.admin-input,
.admin-select,
.admin-textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    font-size: 0.88rem;
    background: #FFFFFF;
    color: #1E293B;
    font-family: var(--admin-font-sans);
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-control:focus,
.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(237, 181, 50, 0.25);
}

.form-control::placeholder,
.admin-input::placeholder {
    color: #94A3B8;
}

textarea.form-control,
textarea.admin-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) {
    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

.form-hint,
.admin-help-text {
    font-size: 0.75rem;
    color: #64748B;
    margin-top: 5px;
    display: block;
}

.image-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}
.image-input-group .form-control {
    flex-grow: 1;
}

.form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #F1F5F9;
    display: flex;
    gap: 10px;
    align-items: center;
}

.custom-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1E293B;
    user-select: none;
    font-weight: 500;
}
.custom-checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #111827;
    border-radius: 3px;
}

/* Visual Rich Text Toolbar */
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-bottom: none;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    padding: 8px 10px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 3px;
}

.toolbar-divider {
    width: 1px;
    height: 22px;
    background: #CBD5E1;
    margin: 0 4px;
}

.wysiwyg-btn {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    padding: 5px 9px;
    font-size: 0.82rem;
    cursor: pointer;
    font-weight: 600;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.wysiwyg-btn:hover {
    background: #E2E8F0;
    color: #0F172A;
    border-color: #94A3B8;
}

.wysiwyg-btn:active {
    background: var(--admin-accent);
    color: #111827;
}

.wysiwyg-select {
    padding: 5px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1E293B;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.wysiwyg-select:focus {
    border-color: var(--admin-accent);
}

.btn-wysiwyg-media {
    background: #EFF6FF;
    color: #1E40AF;
    border-color: #BFDBFE;
}

.btn-wysiwyg-media:hover {
    background: #DBEAFE;
    color: #1D4ED8;
}

.wysiwyg-editor-area {
    min-height: 380px;
    max-height: 800px;
    border: 1px solid #CBD5E1;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    padding: 20px;
    background: #FFFFFF;
    outline: none;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.75;
    overflow-y: auto;
    color: #1E293B;
}

.wysiwyg-editor-area:focus {
    border-color: #94A3B8;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.wysiwyg-editor-area p {
    margin-bottom: 1.25em;
}

.wysiwyg-editor-area h1, 
.wysiwyg-editor-area h2, 
.wysiwyg-editor-area h3, 
.wysiwyg-editor-area h4, 
.wysiwyg-editor-area h5, 
.wysiwyg-editor-area h6 {
    font-family: var(--admin-font-heading);
    margin-top: 1.4em;
    margin-bottom: 0.5em;
    color: #0F172A;
    line-height: 1.3;
}

.wysiwyg-editor-area blockquote {
    border-left: 4px solid var(--admin-accent);
    padding: 8px 18px;
    margin: 1.4em 0;
    font-style: italic;
    color: #475569;
    background: #F8FAFC;
}

.wysiwyg-editor-area figure.editorial-image {
    margin: 1.6em 0;
    display: inline-block;
    max-width: 100%;
}

.wysiwyg-editor-area figure.align-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.wysiwyg-editor-area figure.align-left {
    float: left;
    margin: 0 24px 18px 0;
    max-width: 48%;
}

.wysiwyg-editor-area figure.align-right {
    float: right;
    margin: 0 0 18px 24px;
    max-width: 48%;
}

.wysiwyg-editor-area figure.align-full {
    display: block;
    width: 100%;
    max-width: 100% !important;
}

.wysiwyg-editor-area figcaption {
    font-family: var(--admin-font-sans);
    font-size: 0.8rem;
    color: #64748B;
    margin-top: 6px;
    text-align: center;
    font-style: italic;
}

.wysiwyg-editor-area .article-video-embed {
    position: relative;
    margin: 1.6em 0;
    width: 100%;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.wysiwyg-editor-area .article-video-embed.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.wysiwyg-editor-area .article-video-embed.aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.wysiwyg-editor-area .article-video-embed iframe,
.wysiwyg-editor-area .article-video-embed video {
    width: 100%;
    height: 100%;
    display: block;
}

/* --------------------------------------------------------------------------
   ADMIN MODALS (IMAGE, VIDEO, MEDIA LIBRARY, LINK)
   -------------------------------------------------------------------------- */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.admin-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal-container {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.admin-modal-overlay.active .admin-modal-container {
    transform: translateY(0);
}

.admin-modal-sm { width: 440px; max-width: 95vw; }
.admin-modal-md { width: 620px; max-width: 95vw; }
.admin-modal-lg { width: 840px; max-width: 95vw; }

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--admin-border);
    background: #F8FAFC;
}

.admin-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--admin-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748B;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

.admin-modal-close:hover {
    color: #0F172A;
}

.admin-modal-body {
    padding: 22px;
    overflow-y: auto;
    flex-grow: 1;
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--admin-border);
    background: #F8FAFC;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--admin-border);
    margin-bottom: 16px;
}

.modal-tab-btn {
    background: none;
    border: none;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.modal-tab-btn:hover {
    color: #0F172A;
}

.modal-tab-btn.active {
    color: var(--admin-accent);
    border-bottom-color: var(--admin-accent);
    font-weight: 700;
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

.modal-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.modal-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    background: #F8FAFC;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
}

.modal-media-item-card {
    background: #FFFFFF;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-media-item-card:hover {
    border-color: var(--admin-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.modal-media-thumb-frame {
    aspect-ratio: 1 / 1;
    background: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-media-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-media-thumb-frame.video-frame,
.modal-media-thumb-frame.pdf-frame {
    font-size: 1.8rem;
    color: #64748B;
}

.modal-media-info {
    padding: 4px 6px;
    background: #FFFFFF;
}

.modal-media-name {
    font-size: 0.68rem;
    color: #334155;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-preview-frame {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #F1F5F9;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Segmented Control Radio Buttons */
.segmented-control {
    display: flex;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    padding: 3px;
    gap: 2px;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    cursor: pointer;
    margin: 0;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control span {
    display: block;
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    border-radius: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.segmented-control input[type="radio"]:checked + span {
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   MEDIA LIBRARY & PICKER
   -------------------------------------------------------------------------- */
.media-upload-dropzone {
    border: 2px dashed #CBD5E1;
    background: #F8FAFC;
    border-radius: 8px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
}
.media-upload-dropzone:hover, .media-upload-dropzone.dragover {
    border-color: var(--admin-accent);
    background: #FFFBEB;
}
.media-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.media-thumb-card {
    background: #FFFFFF;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1/1;
    transition: transform 0.2s, box-shadow 0.2s;
}
.media-thumb-card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.media-thumb-card.selected {
    border: 3px solid var(--admin-accent);
}
.media-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-thumb-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #FFF;
    font-size: 0.68rem;
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Alerts */
.admin-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #DEF7EC; color: #03543F; border: 1px solid #BCF0DA; }
.alert-danger { background: #FDE8E8; color: #9B1C1C; border: 1px solid #F8B4B4; }
.alert-warning { background: #FEF08A; color: #713F12; border: 1px solid #FDE047; }
.alert-info { background: #E1EFFE; color: #1E429F; border: 1px solid #BEE3F8; }
.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: inherit;
}

