/* ==========================================================================
   MAYA BASILA - Admin Dashboard Stylesheet
   Modern, Clean & Glassmorphic Administration Interface
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1a4329;
    --primary-hover: #12301d;
    --primary-light: #e8f4ed;
    --accent-color: #d97706;
    --accent-hover: #b45309;
    --accent-light: #fef3c7;
    --danger-color: #dc2626;
    --danger-light: #fee2e2;
    --success-color: #16a34a;
    --success-light: #dcfce7;
    --info-color: #0284c7;
    --info-light: #e0f2fe;
    
    --bg-main: #f4f7f5;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #1a4329;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    font-weight: 700;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent-color);
}

/* ==========================================================================
   Admin Layout
   ========================================================================== */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background: #11291b;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: var(--accent-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

.sidebar-title {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.15);
    color: #a7f3d0;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
}

.nav-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6ee7b7;
    margin: 1.25rem 0.75rem 0.5rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.nav-link i, .nav-link .nav-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, #b45309 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #94a3b8;
}

.logout-btn {
    color: #f87171;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(220, 38, 38, 0.15);
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.25);
    color: #fca5a5;
}

/* Main Content Area */
.admin-main {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navbar */
.admin-topbar {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-heading {
    font-size: 1.35rem;
    margin: 0;
    color: var(--primary-color);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-view-site {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid rgba(26, 67, 41, 0.15);
}

.btn-view-site:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Content Container */
.admin-content {
    padding: 2rem;
    flex: 1;
}

/* ==========================================================================
   Alerts & Flash Messages
   ========================================================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background-color: var(--success-light);
    color: #14532d;
    border: 1px solid #bbf7d0;
}

.alert-error, .alert-danger {
    background-color: var(--danger-light);
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: var(--info-light);
    color: #075985;
    border: 1px solid #bae6fd;
}

/* ==========================================================================
   Cards & Grid Layouts
   ========================================================================== */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-icon-green { background: var(--primary-light); color: var(--primary-color); }
.stat-icon-amber { background: var(--accent-light); color: var(--accent-color); }
.stat-icon-blue { background: var(--info-light); color: var(--info-color); }
.stat-icon-red { background: var(--danger-light); color: var(--danger-color); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Sequences Grid */
.sequences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.sequence-admin-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}

.sequence-admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.sequence-card-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(26,67,41,0.08) 0%, rgba(217,119,6,0.05) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.seq-num-badge {
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
}

.sequence-card-body {
    padding: 1.25rem;
    flex: 1;
}

.sequence-card-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.sequence-card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.sequence-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.meta-pill {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sequence-card-actions {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(26, 67, 41, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(26, 67, 41, 0.35);
}

.btn-accent {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   Form Controls & Inputs
   ========================================================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    font-size: 0.95rem;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 67, 41, 0.15);
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

/* Custom Autoplay Toggle Switch */
.switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: 34px;
    transition: .3s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-input:checked + .switch-slider {
    background-color: var(--accent-color);
}

.switch-input:checked + .switch-slider:before {
    transform: translateX(20px);
}

.switch-label-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Section Builder Dynamic Cards */
.dynamic-item-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    border-left: 4px solid var(--primary-color);
}

.dynamic-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
}

.dynamic-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Video Sub-card */
.video-subcard {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* Sticky Action Bar for Saving */
.sticky-save-bar {
    position: sticky;
    bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-xl);
    padding: 1rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    z-index: 80;
}

/* Media Gallery Grid */
.media-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.media-admin-card {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.media-thumbnail-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-admin-card:hover .media-thumbnail-wrapper img {
    transform: scale(1.05);
}

.media-details {
    padding: 0.75rem;
    font-size: 0.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.media-filename {
    font-weight: 600;
    color: var(--text-main);
    word-break: break-all;
    margin-bottom: 0.5rem;
}

/* Drag & Drop Upload Zone */
.upload-dropzone {
    border: 2px dashed #94a3b8;
    background: #f8fafc;
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

/* Login Page Styles */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #11291b 0%, #1a4329 50%, #0d2015 100%);
    padding: 1.5rem;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    text-align: left;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 56px;
    height: 56px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
}

/* ==========================================================================
   Textarea Editor Toolbar & Helpers
   ========================================================================== */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: 0.4rem 0.6rem;
    flex-wrap: wrap;
}

.editor-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.editor-tool-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
    user-select: none;
}

.editor-tool-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.editor-tool-btn.btn-insert-image {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    padding: 0.3rem 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(26, 67, 41, 0.2);
}

.editor-tool-btn.btn-insert-image:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 67, 41, 0.3);
}

.editor-tool-help-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.form-group:has(.editor-toolbar) textarea.form-control {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* ==========================================================================
   Image Inserter Custom Modal
   ========================================================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease-out;
}

.custom-modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafcfb;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.custom-modal-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 0.4rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

.modal-tab-btn {
    padding: 0.6rem 1.25rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-tab-btn:hover {
    color: var(--primary-color);
}

.modal-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: #ffffff;
    border-radius: 6px 6px 0 0;
}

.custom-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.modal-gallery-item {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.modal-gallery-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.modal-gallery-item.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 67, 41, 0.2);
}

.modal-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    overflow: hidden;
}

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

.modal-selected-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--primary-color);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.modal-gallery-item.selected .modal-selected-badge {
    display: flex;
}

.modal-img-name {
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.modal-upload-box {
    border: 2px dashed #94a3b8;
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-upload-box:hover, .modal-upload-box.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.modal-options-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.align-choice-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.align-choice-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.align-choice-label input[type="radio"] {
    display: none;
}

.align-choice-label:hover {
    border-color: var(--primary-color);
    background: #ffffff;
}

.align-choice-label.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    font-weight: 600;
}

.custom-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #fafcfb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

