/* ===== ADMIN GEAR BUTTON ===== */
.admin-gear {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 20px rgba(102,126,234,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.admin-gear:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 25px rgba(102,126,234,0.6);
}
.admin-gear i {
    transition: transform 0.3s ease;
}

/* ===== ADMIN LOGIN MODAL ===== */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.admin-login-overlay.show {
    display: flex;
    opacity: 1;
}

.admin-login-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
    animation: adminSlideUp 0.3s ease;
}

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

.admin-login-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.admin-login-close:hover { background: #eee; color: #333; }

.admin-login-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.admin-login-icon i {
    font-size: 28px;
    color: white;
}

.admin-login-modal h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a2e;
}
.admin-login-modal p {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.admin-input-group {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s;
}
.admin-input-group:focus-within {
    border-color: #667eea;
}

.admin-input-group input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.admin-input-group button {
    width: 50px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: opacity 0.2s;
}
.admin-input-group button:hover { opacity: 0.9; }

.admin-login-error {
    color: #e53935;
    font-size: 13px;
    margin-top: 12px;
    display: none;
    animation: shake 0.4s ease;
}
.admin-login-error.show { display: block; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ===== ADMIN PANEL SIDEBAR ===== */
.admin-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: #fafbfc;
    z-index: 3001;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0,0,0,0.15);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-panel.open {
    right: 0;
}

.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.admin-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Panel Header */
.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    flex-shrink: 0;
}
.admin-panel-header h3 {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.admin-panel-close:hover { background: rgba(255,255,255,0.3); }

/* Tabs */
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 12px 8px;
    background: white;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.admin-tab {
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    white-space: nowrap;
}
.admin-tab i { font-size: 11px; }
.admin-tab:hover {
    border-color: #667eea;
    color: #667eea;
}
.admin-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

/* Panel Body */
.admin-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.admin-tab-content {
    display: none;
}
.admin-tab-content.active {
    display: block;
}

/* Sections */
.admin-section {
    background: white;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 14px;
    border: 1px solid #eee;
}

.admin-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.admin-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.admin-section-head h4 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.admin-hint {
    font-size: 12px;
    color: #999;
    margin-bottom: 14px;
}

/* Fields */
.admin-field {
    margin-bottom: 14px;
}
.admin-field:last-child { margin-bottom: 0; }

.admin-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.admin-field input[type="text"],
.admin-field input[type="email"],
.admin-field textarea,
.admin-field select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fafbfc;
}
.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.admin-field textarea {
    resize: vertical;
    min-height: 60px;
}

/* Color row */
.admin-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-color-row input[type="color"] {
    width: 40px;
    height: 36px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}
.admin-color-val {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #666;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 6px;
}

/* Range row */
.admin-range-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-range-row input[type="range"] {
    flex: 1;
    accent-color: #667eea;
}
.admin-range-val {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
    text-align: right;
}

/* Toggle List */
.admin-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #eee;
}

.admin-toggle-item span {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

/* Toggle Switch */
.admin-switch {
    position: relative;
    width: 42px;
    height: 24px;
}
.admin-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.admin-switch-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s;
}
.admin-switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}
.admin-switch input:checked + .admin-switch-slider {
    background: #667eea;
}
.admin-switch input:checked + .admin-switch-slider::before {
    transform: translateX(18px);
}

/* Add Button */
.admin-add-btn {
    padding: 6px 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}
.admin-add-btn:hover {
    background: #5a6fd6;
    transform: translateY(-1px);
}

/* Editable Card in Admin */
.admin-card {
    background: #fafbfc;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    position: relative;
}
.admin-card:last-child { margin-bottom: 0; }

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    cursor: pointer;
}
.admin-card-header span {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.admin-card-actions {
    display: flex;
    gap: 6px;
}

.admin-card-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.admin-card-toggle {
    background: #e8f4fd;
    color: #0066cc;
}
.admin-card-toggle:hover { background: #d0eafb; }

.admin-card-delete {
    background: #fce4e4;
    color: #e53935;
}
.admin-card-delete:hover { background: #f5c6c6; }

.admin-card-body {
    display: none;
}
.admin-card.expanded .admin-card-body {
    display: block;
}

.admin-card-body .admin-field {
    margin-bottom: 10px;
}

/* Hero Slide Editor */
.admin-slide-card {
    background: #f0f4ff;
    border: 1px solid #d4dfff;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.admin-slide-card h5 {
    font-size: 13px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-slide-card h5 i { font-size: 12px; }

/* Panel Footer */
.admin-panel-footer {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    background: white;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.admin-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    white-space: nowrap;
}

.admin-btn-save {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    flex: 2;
}
.admin-btn-save:hover { opacity: 0.9; transform: translateY(-1px); }

.admin-btn-reset {
    background: #fce4e4;
    color: #e53935;
}
.admin-btn-reset:hover { background: #f5c6c6; }

.admin-btn-export {
    background: #e8f4fd;
    color: #0066cc;
}
.admin-btn-export:hover { background: #d0eafb; }

.admin-btn-import {
    background: #e8f5e9;
    color: #2e7d32;
}
.admin-btn-import:hover { background: #c8e6c9; }

/* Toast notification */
.admin-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    background: #333;
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 5000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-toast.show {
    transform: translateX(0);
}
.admin-toast.success { background: #2e7d32; }
.admin-toast.error { background: #c62828; }
.admin-toast.info { background: #1565c0; }

/* Responsive */
@media (max-width: 480px) {
    .admin-panel {
        width: 100%;
        right: -100%;
    }
    .admin-gear {
        bottom: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .admin-login-modal {
        width: 90%;
        padding: 30px 24px;
    }
}
