/* ==========================================================================
   PORTFOLIO ADMIN & ENTITY MANAGER STYLES
   Futuristic Glassmorphic Theme with Neon Cyan/Teal Accents
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Admin Action Button (In Footer Only, Stealth Ghost Mode)
   -------------------------------------------------------------------------- */
.admin-fab-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-fab-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    opacity: 0.18;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    outline: none;
}

.admin-fab-btn i {
    font-size: 1.05rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Stealth reveal on hover or focus */
.admin-fab-btn:hover,
.admin-fab-btn:focus-visible {
    opacity: 1;
    background: rgba(15, 23, 42, 0.95);
    border-color: #00ffd2;
    color: #00ffd2;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 255, 210, 0.45);
    transform: translateY(-2px) scale(1.08);
}

.admin-fab-btn:active {
    transform: scale(0.95);
}

.admin-fab-btn.logged-in {
    opacity: 0.85;
    border-color: #00ffd2;
    color: #00ffd2;
    box-shadow: 0 0 15px rgba(0, 255, 210, 0.35);
}

.admin-fab-btn.logged-in::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 9px;
    height: 9px;
    background: #00ffd2;
    border-radius: 50%;
    border: 2px solid #020617;
    box-shadow: 0 0 8px #00ffd2;
}

.admin-fab-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #fff;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.admin-fab-btn:hover .admin-fab-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   2. Floating Admin Toolbar (Visible when logged in)
   -------------------------------------------------------------------------- */
.admin-toolbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 40px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9990;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.15);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    max-width: 95vw;
    overflow-x: auto;
}

.admin-toolbar.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.admin-toolbar-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #00ffd2;
    padding: 6px 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ffd2;
    box-shadow: 0 0 8px #00ffd2;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.admin-tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.admin-tool-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: #00f0ff;
    color: #00f0ff;
    transform: translateY(-2px);
}

.admin-tool-btn.primary {
    background: linear-gradient(135deg, #00f0ff, #00ffd2);
    color: #020617;
    font-weight: 600;
    border: none;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.admin-tool-btn.primary:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
    color: #020617;
}

.admin-tool-btn.active-mode {
    background: rgba(0, 255, 210, 0.2);
    border-color: #00ffd2;
    color: #00ffd2;
    box-shadow: 0 0 10px rgba(0, 255, 210, 0.3);
}

.admin-tool-btn.danger {
    color: #f87171;
}

.admin-tool-btn.danger:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: #f87171;
    color: #f87171;
}

/* --------------------------------------------------------------------------
   3. Modals (Login & Entity Manager)
   -------------------------------------------------------------------------- */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.admin-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.admin-modal-card {
    position: relative;
    background: #090d23;
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.15);
    z-index: 2;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 440px;
    width: 100%;
    padding: 36px 32px;
}

.admin-modal.open .admin-modal-card {
    transform: scale(1) translateY(0);
}

.admin-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.admin-modal-close:hover {
    color: #00f0ff;
    transform: scale(1.15);
}

/* Login Modal Specifics */
.admin-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.admin-icon-glow {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}

.admin-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 8px;
}

.admin-modal-header p {
    color: #94a3b8;
    font-size: 0.9rem;
}

.admin-login-form .admin-input-group {
    margin-bottom: 20px;
}

.admin-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding: 12px 44px 12px 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #f8fafc;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
}

.password-wrapper input:focus {
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
    background: rgba(15, 23, 42, 0.95);
}

.toggle-pwd-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.toggle-pwd-btn:hover {
    color: #00f0ff;
}

.admin-hint {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 6px;
}

.admin-hint code {
    color: #00ffd2;
    background: rgba(0, 255, 210, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
}

.admin-error-msg {
    color: #f87171;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
    background: rgba(248, 113, 113, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.admin-error-msg.visible {
    display: block;
}

/* --------------------------------------------------------------------------
   4. Comprehensive Entity Manager Dashboard Modal
   -------------------------------------------------------------------------- */
.entity-manager-card {
    max-width: 1100px;
    width: 95vw;
    height: 88vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.em-header {
    padding: 20px 28px;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.em-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.em-title-wrap .em-icon {
    font-size: 1.4rem;
    color: #00f0ff;
}

.em-title-wrap h3 {
    font-size: 1.3rem;
    color: #f8fafc;
    margin: 0;
}

.em-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
}

.em-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar navigation tabs */
.em-sidebar {
    width: 240px;
    background: rgba(10, 15, 30, 0.6);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.em-tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.em-tab-btn i {
    font-size: 1rem;
    width: 20px;
    color: #64748b;
    transition: color 0.2s ease;
}

.em-tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
}

.em-tab-btn:hover i {
    color: #00f0ff;
}

.em-tab-btn.active {
    background: rgba(0, 240, 255, 0.12);
    color: #00f0ff;
    font-weight: 600;
    border: 1px solid rgba(0, 240, 255, 0.25);
}

.em-tab-btn.active i {
    color: #00ffd2;
}

/* Main Content Area */
.em-content-area {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.3);
}

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

.em-tab-pane.active {
    display: block;
    animation: fadeInPane 0.25s ease;
}

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

.em-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.em-pane-header h4 {
    font-size: 1.25rem;
    color: #f8fafc;
}

.em-pane-header p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Forms & Inputs inside Entity Manager */
.em-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.em-form-col-full {
    grid-column: span 2;
}

.em-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.em-field-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.em-input, .em-textarea, .em-select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.92rem;
    outline: none;
    font-family: inherit;
    transition: all 0.25s ease;
}

.em-input:focus, .em-textarea:focus, .em-select:focus {
    border-color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
    background: rgba(15, 23, 42, 0.9);
}

.em-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Image Upload Preview Box */
.em-image-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.em-image-thumb {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: #020617;
}

.em-file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.em-file-input-label:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: #00ffd2;
    color: #00ffd2;
}

/* Entity Lists (Education, Projects, Achievements, Skills, Services) */
.em-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.em-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.25s ease;
}

.em-item-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.em-item-info {
    flex: 1;
}

.em-item-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.em-item-sub {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 4px;
}

.em-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.em-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.em-action-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: #00f0ff;
    color: #00f0ff;
}

.em-action-btn.delete:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: #f87171;
    color: #f87171;
}

/* Skill Tags Cloud in Manager */
.em-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.em-tag-chip {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.em-tag-remove {
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.em-tag-remove:hover {
    color: #f87171;
}

.em-add-tag-box {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.em-add-tag-box input {
    flex: 1;
}

/* Save / Footer actions in Entity Manager */
.em-footer-save {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   5. Inline Visual Edit Mode Elements
   -------------------------------------------------------------------------- */
body.admin-inline-active [contenteditable="true"] {
    outline: 1px dashed rgba(0, 240, 255, 0.45) !important;
    outline-offset: 3px;
    cursor: text;
    transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

body.admin-inline-active [contenteditable="true"]:hover {
    outline: 1px dashed #00ffd2 !important;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

body.admin-inline-active [contenteditable="true"]:focus {
    outline: 2px solid #00f0ff !important;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.4);
    border-radius: 4px;
}

/* Preserve gradient text elements (e.g. Hero Name) during hover and editing */
body.admin-inline-active .hero-name,
body.admin-inline-active .hero-name:hover {
    background: linear-gradient(135deg, var(--text-primary) 30%, rgba(var(--accent-primary-rgb), 0.7) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

body.admin-inline-active .hero-name:focus {
    background: none !important;
    -webkit-text-fill-color: var(--text-primary, #f8fafc) !important;
    color: var(--text-primary, #f8fafc) !important;
}

/* Inline Edit Floating Alert Pill */
.inline-edit-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #00f0ff;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.35);
    color: #f8fafc;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9995;
    display: none;
    align-items: center;
    gap: 10px;
    animation: bounceDown 0.4s ease;
}

.inline-edit-indicator.active {
    display: flex;
}

@keyframes bounceDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   6. Toast Notifications
   -------------------------------------------------------------------------- */
.admin-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.admin-toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 12px;
    padding: 12px 20px;
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 240, 255, 0.2);
    pointer-events: auto;
    animation: toastSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.admin-toast.success {
    border-color: #00ffd2;
}

.admin-toast.success i {
    color: #00ffd2;
}

.admin-toast.error {
    border-color: #f87171;
}

.admin-toast.error i {
    color: #f87171;
}

.admin-toast.fade-out {
    opacity: 0;
    transform: translateX(30px);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --------------------------------------------------------------------------
   7. Mobile Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .admin-fab-container {
        bottom: 18px;
        right: 18px;
    }
    
    .admin-toolbar {
        bottom: 16px;
        width: 92%;
        padding: 6px 10px;
        justify-content: flex-start;
    }
    
    .admin-toolbar .tool-label {
        display: none;
    }
    
    .admin-tool-btn {
        padding: 8px 10px;
    }

    .entity-manager-card {
        height: 94vh;
        width: 98vw;
    }
    
    .em-body {
        flex-direction: column;
    }
    
    .em-sidebar {
        width: 100%;
        max-height: 120px;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px 12px;
    }
    
    .em-tab-btn {
        padding: 8px 12px;
        white-space: nowrap;
    }
    
    .em-form-grid {
        grid-template-columns: 1fr;
    }
    
    .em-form-col-full {
        grid-column: span 1;
    }
    
    .em-content-area {
        padding: 16px;
    }
}

