/* ============================================
   MAISON CAPITAL - Admin Panel
   ============================================ */

.admin-trigger {
    position: relative;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.3s;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.2);
    padding: 4px;
    user-select: none;
}
.admin-trigger:hover { opacity: 0.6; }

/* Login Overlay */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(10,10,20,0.95);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
}
.admin-login-overlay.active { display: flex; }

.admin-login-box {
    background: #141420;
    border: 1px solid rgba(201,169,110,0.2);
    padding: 48px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.admin-login-box h2 {
    font-family: 'Playfair Display', serif;
    color: #c9a96e;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.admin-login-box p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 32px;
}

.admin-login-box input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}
.admin-login-box input:focus { border-color: #c9a96e; outline: none; }
.admin-login-box input::placeholder { color: rgba(255,255,255,0.3); }

.admin-login-box .admin-login-btn {
    width: 100%;
    padding: 14px;
    background: #c9a96e;
    color: #0a0a14;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.3s;
}
.admin-login-box .admin-login-btn:hover { background: #d4b87a; }

.admin-login-error {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 12px;
    display: none;
}

.admin-login-close {
    position: absolute;
    top: 24px;
    right: 24px;
    color: rgba(255,255,255,0.5);
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s;
}
.admin-login-close:hover { color: #c9a96e; }

/* Admin Panel */
.admin-panel {
    position: fixed;
    inset: 0;
    z-index: 19000;
    display: none;
}
.admin-panel.active { display: flex; }

.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: #0d0d1a;
    border-right: 1px solid rgba(201,169,110,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-sidebar-header h3 {
    font-family: 'Playfair Display', serif;
    color: #c9a96e;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
}

.admin-sidebar-header span {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.admin-nav {
    flex: 1;
    padding: 16px 0;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
}
.admin-nav-item:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.03); }
.admin-nav-item.active { color: #c9a96e; background: rgba(201,169,110,0.08); border-right: 2px solid #c9a96e; }
.admin-nav-item i { width: 20px; text-align: center; font-size: 0.9rem; }

.admin-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.admin-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.4);
    font-size: 0.78rem;
    cursor: pointer;
    border: none;
    background: none;
    font-family: 'Montserrat', sans-serif;
    transition: color 0.3s;
    padding: 8px 0;
}
.admin-logout:hover { color: #e74c3c; }

/* Main Content */
.admin-main {
    flex: 1;
    background: #111122;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(13,13,26,0.8);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.admin-topbar h2 {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 1.3rem;
}

.admin-topbar-actions {
    display: flex;
    gap: 12px;
}

.admin-content {
    flex: 1;
    padding: 32px;
}

/* Sections */
.admin-section { display: none; }
.admin-section.active { display: block; }

/* Cards */
.admin-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-card-header h3 {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 1.1rem;
}

/* Form Elements */
.adm-form-group {
    margin-bottom: 18px;
}

.adm-form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.adm-input, .adm-textarea, .adm-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s;
}
.adm-input:focus, .adm-textarea:focus, .adm-select:focus {
    border-color: #c9a96e;
    outline: none;
}
.adm-input::placeholder, .adm-textarea::placeholder { color: rgba(255,255,255,0.25); }
.adm-textarea { resize: vertical; min-height: 100px; }
.adm-select { cursor: pointer; appearance: none; }
.adm-select option { background: #111122; color: #fff; }

.adm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Buttons */
.adm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
}

.adm-btn-primary { background: #c9a96e; color: #0a0a14; }
.adm-btn-primary:hover { background: #d4b87a; box-shadow: 0 4px 20px rgba(201,169,110,0.3); }

.adm-btn-secondary { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.1); }
.adm-btn-secondary:hover { border-color: rgba(255,255,255,0.3); color: #fff; }

.adm-btn-danger { background: rgba(231,76,60,0.15); color: #e74c3c; border: 1px solid rgba(231,76,60,0.2); }
.adm-btn-danger:hover { background: rgba(231,76,60,0.25); }

.adm-btn-sm { padding: 6px 14px; font-size: 0.7rem; }

/* Item List */
.adm-item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.adm-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    transition: border-color 0.3s;
}
.adm-item:hover { border-color: rgba(201,169,110,0.2); }

.adm-item-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}

.adm-item-info { flex: 1; min-width: 0; }
.adm-item-info h4 { color: #fff; font-size: 0.9rem; margin-bottom: 2px; font-family: 'Playfair Display', serif; }
.adm-item-info p { color: rgba(255,255,255,0.4); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.adm-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Image Upload */
.adm-img-upload {
    position: relative;
    width: 100%;
    height: 180px;
    border: 2px dashed rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.3s;
    overflow: hidden;
}
.adm-img-upload:hover { border-color: rgba(201,169,110,0.4); }
.adm-img-upload i { font-size: 2rem; color: rgba(255,255,255,0.2); }
.adm-img-upload span { font-size: 0.78rem; color: rgba(255,255,255,0.4); }
.adm-img-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.adm-img-upload img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery Grid */
.adm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.adm-gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.adm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adm-gallery-item .adm-gallery-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(231,76,60,0.9);
    color: #fff;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.adm-gallery-item:hover .adm-gallery-remove { opacity: 1; }

/* Dashboard Stats */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.admin-stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 24px;
    text-align: center;
}

.admin-stat-card i {
    font-size: 1.5rem;
    color: #c9a96e;
    margin-bottom: 12px;
}

.admin-stat-card .stat-num {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.admin-stat-card .stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 6px;
}

/* Toast */
.adm-toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 30000;
    padding: 14px 24px;
    background: #1a1a2e;
    border: 1px solid rgba(201,169,110,0.3);
    color: #fff;
    font-size: 0.85rem;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}
.adm-toast.show { transform: translateY(0); opacity: 1; }
.adm-toast.success { border-color: #2ecc71; }
.adm-toast.success i { color: #2ecc71; }
.adm-toast.error { border-color: #e74c3c; }
.adm-toast.error i { color: #e74c3c; }

/* Form Modal for editing */
.adm-form-modal {
    position: fixed;
    inset: 0;
    z-index: 25000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10,10,20,0.9);
    backdrop-filter: blur(10px);
}
.adm-form-modal.active { display: flex; }

.adm-form-modal-content {
    background: #141420;
    border: 1px solid rgba(201,169,110,0.15);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
}

.adm-form-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.adm-form-modal-header h3 {
    font-family: 'Playfair Display', serif;
    color: #c9a96e;
    font-size: 1.2rem;
}

.adm-form-modal-close {
    color: rgba(255,255,255,0.4);
    font-size: 1.2rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s;
}
.adm-form-modal-close:hover { color: #c9a96e; }

.adm-form-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* URL input helper */
.adm-url-helper {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar { width: 220px; min-width: 220px; }
    .admin-content { padding: 20px; }
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .adm-form-row { grid-template-columns: 1fr; }
    .admin-topbar { padding: 12px 20px; }
}

@media (max-width: 600px) {
    .admin-panel { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 60px;
        overflow: hidden;
        flex-direction: row;
        align-items: center;
    }
    .admin-sidebar.expanded { max-height: 100vh; flex-direction: column; }
    .admin-sidebar-header { padding: 16px; }
    .admin-stats-grid { grid-template-columns: 1fr 1fr; }
}
