/* ========================================================
   NASDEM LIVE CMS ADMIN EDITOR STYLES
   ======================================================== */

/* Body adjustments when admin mode is active */
body.admin-mode-active {
    padding-top: 56px !important;
    transition: padding-top 0.25s ease;
}

/* --------------------------------------------------------
   ADMIN TOP TOOLBAR
   -------------------------------------------------------- */
.admin-bar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: #001333;
    border-bottom: 2.5px solid #ffb700;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    display: flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    animation: adminSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes adminSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.admin-bar-inner {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-bar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: adminPulse 2s infinite;
}

@keyframes adminPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.admin-badge {
    background: #ffb700;
    color: #001333;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.8px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.admin-mode-text {
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 600;
}

.admin-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.admin-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.admin-btn-save {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.admin-btn-save:hover {
    background: #059669;
    transform: translateY(-1px);
}

.admin-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.admin-btn-primary {
    background: #ffb700;
    color: #001333;
}

.admin-btn-primary:hover {
    background: #f59e0b;
}

.admin-btn-light {
    background: #e2e8f0;
    color: #334155;
}

.admin-btn-light:hover {
    background: #cbd5e1;
}

.admin-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
}

/* --------------------------------------------------------
   EDITABLE ELEMENTS HIGHLIGHTS
   -------------------------------------------------------- */
body.admin-mode-active:not(.admin-preview-mode) [data-editable] {
    cursor: pointer;
    position: relative;
    transition: outline 0.15s ease, background-color 0.15s ease;
    border-radius: 4px;
}

body.admin-mode-active:not(.admin-preview-mode) [data-editable]:hover {
    outline: 2px dashed #ffb700 !important;
    outline-offset: 3px;
    background-color: rgba(255, 183, 0, 0.12) !important;
}

body.admin-mode-active:not(.admin-preview-mode) [data-editable]:focus {
    outline: 2.5px solid #ffb700 !important;
    outline-offset: 3px;
    background-color: rgba(255, 183, 0, 0.18) !important;
}

/* Image Editable Trigger */
body.admin-mode-active:not(.admin-preview-mode) .admin-img-editable-wrap {
    position: relative;
    display: block;
}

.admin-img-edit-trigger {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #001333;
    color: #ffb700;
    border: 1.5px solid #ffb700;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    z-index: 20;
    display: none;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.admin-img-edit-trigger:hover {
    background: #ffb700;
    color: #001333;
    transform: scale(1.05);
}

body.admin-mode-active:not(.admin-preview-mode) .admin-img-editable-wrap:hover .admin-img-edit-trigger {
    display: inline-flex;
}

/* Floating Slide Edit Button inside Hero Section */
.admin-slide-floating-btn {
    position: absolute;
    bottom: 30px;
    left: 40px;
    background: #001333;
    color: #ffb700;
    border: 2px solid #ffb700;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    z-index: 40;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

body.admin-mode-active:not(.admin-preview-mode) .admin-slide-floating-btn {
    display: inline-flex;
}

.admin-slide-floating-btn:hover {
    background: #ffb700;
    color: #001333;
}

/* News Section Admin Action Header */
.admin-news-add-btn-wrap {
    display: none;
    align-items: center;
    gap: 8px;
}

body.admin-mode-active:not(.admin-preview-mode) .admin-news-add-btn-wrap {
    display: inline-flex;
}

/* Delete news item button */
.admin-news-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    z-index: 15;
    transition: transform 0.15s ease;
}

.admin-news-delete-btn:hover {
    transform: scale(1.15);
    background: #dc2626;
}

body.admin-mode-active:not(.admin-preview-mode) .news-item:hover .admin-news-delete-btn {
    display: flex;
}

/* --------------------------------------------------------
   MODALS
   -------------------------------------------------------- */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.admin-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 19, 51, 0.85);
    backdrop-filter: blur(4px);
}

.admin-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 2;
    overflow: hidden;
    animation: adminModalIn 0.25s ease-out;
}

.admin-modal-lg {
    max-width: 780px;
}

@keyframes adminModalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.admin-modal-header {
    background: #001333;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #ffb700;
}

.admin-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
}

.admin-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

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

.admin-modal-body {
    padding: 20px;
    overflow-y: auto;
    color: #1e293b;
    font-size: 14px;
}

.admin-modal-footer {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.admin-modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease;
}

/* Forms & Tabs */
.admin-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
    gap: 6px;
}

.admin-tab {
    padding: 8px 14px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 700;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    margin-bottom: -2px;
}

.admin-tab.active {
    color: #001333;
    border-bottom-color: #ffb700;
}

.admin-tab-pane {
    display: none;
}

.admin-tab-pane.active {
    display: block;
}

.admin-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.admin-dropzone:hover, .admin-dropzone.dragover {
    border-color: #ffb700;
    background: #fffdf5;
}

.admin-dropzone svg {
    width: 36px;
    height: 36px;
    color: #ffb700;
    margin-bottom: 8px;
}

.admin-dropzone p {
    margin: 0 0 4px 0;
    color: #0f172a;
}

.admin-dropzone span {
    font-size: 12px;
    color: #64748b;
}

.admin-upload-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
}

.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
}

.admin-gallery-card {
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.admin-gallery-card:hover, .admin-gallery-card.selected {
    border-color: #ffb700;
    box-shadow: 0 0 0 2px #ffb700;
}

.admin-gallery-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.admin-gallery-card span {
    font-size: 11px;
    font-weight: 700;
    padding: 5px;
    color: #1e293b;
    text-align: center;
    background: #f8fafc;
}

.admin-preview-box {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-preview-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.admin-preview-img-wrap {
    width: 80px;
    height: 50px;
    border-radius: 6px;
    background: #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
}

.admin-preview-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-preview-img-wrap span {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    padding: 2px;
}

.admin-form-group {
    margin-bottom: 14px;
}

.admin-form-row {
    display: flex;
    gap: 12px;
}

.admin-form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.admin-form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s ease;
    color: #000000 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
}

.admin-form-control::placeholder {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

select.admin-form-control {
    color: #000000 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
}

select.admin-form-control option {
    color: #000000 !important;
    background-color: #ffffff !important;
}

.admin-form-control:focus {
    outline: none;
    border-color: #ffb700;
    box-shadow: 0 0 0 3px rgba(255, 183, 0, 0.2);
    color: #000000 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
}

/* Slide Tabs */
.admin-slide-tabs-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.admin-slide-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.admin-slide-tab-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
}

.admin-slide-tab-btn.active {
    background: #001333;
    color: #ffb700;
    border-color: #001333;
}

/* --------------------------------------------------------
   TOAST NOTIFICATION
   -------------------------------------------------------- */
.admin-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #001333;
    color: #ffffff;
    border-left: 4px solid #ffb700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100002;
    min-width: 320px;
    max-width: 440px;
    animation: adminToastIn 0.3s ease-out;
}

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

.admin-toast-icon {
    font-size: 22px;
}

.admin-toast-content {
    flex: 1;
}

.admin-toast-content strong {
    display: block;
    font-size: 14px;
    color: #ffb700;
    margin-bottom: 2px;
}

.admin-toast-content p {
    margin: 0;
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.4;
}

.admin-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.admin-toast-close:hover {
    color: #ffffff;
}

/* ========================================================
   BERITA & ADMIN MODALS FORM INPUT TEXT COLOR FIX
   ======================================================== */
#editArticleModal input,
#editArticleModal select,
#editArticleModal textarea,
#createArticleModal input,
#createArticleModal select,
#createArticleModal textarea,
#createTpsModal input,
#createTpsModal select,
#createTpsModal textarea,
#editTpsModal input,
#editTpsModal select,
#editTpsModal textarea,
#uploadC1PdfModal input,
#uploadC1PdfModal select,
#uploadC1PdfModal textarea,
#createCalegModal input,
#createCalegModal select,
#createCalegModal textarea,
#editCalegModal input,
#editCalegModal select,
#editCalegModal textarea,
.admin-modal input,
.admin-modal select,
.admin-modal textarea {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    background-color: #ffffff !important;
}

#editArticleModal select option,
#createArticleModal select option,
#createTpsModal select option,
#editTpsModal select option,
#uploadC1PdfModal select option,
#createCalegModal select option,
#editCalegModal select option,
.admin-modal select option,
select option {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    background-color: #ffffff !important;
}

#editArticleModal input::placeholder,
#editArticleModal textarea::placeholder,
#createArticleModal input::placeholder,
#createArticleModal textarea::placeholder,
#createTpsModal input::placeholder,
#createTpsModal textarea::placeholder,
#editTpsModal input::placeholder,
#editTpsModal textarea::placeholder,
#uploadC1PdfModal input::placeholder,
#uploadC1PdfModal textarea::placeholder,
#createCalegModal input::placeholder,
#createCalegModal textarea::placeholder,
#editCalegModal input::placeholder,
#editCalegModal textarea::placeholder,
.admin-modal input::placeholder,
.admin-modal textarea::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

#createTpsModal label,
#editTpsModal label,
#uploadC1PdfModal label,
#createCalegModal label,
#editCalegModal label {
    color: #0f172a !important;
    font-weight: 700 !important;
}



