/* ================================================
   CRAFTNIX DIGITAL - ADMIN CSS (PREMIUM)
   ================================================ */

:root {
    --admin-bg: #0a0a1a;
    --admin-card: rgba(255, 255, 255, 0.04);
    --admin-border: rgba(255, 255, 255, 0.08);
    --admin-purple: #7b3fe4;
    --admin-orange: #ff8c2f;
}

body.admin-body {
    background: var(--admin-bg);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* ---- LAYOUT ---- */
.admin-wrapper {
    display: flex;
    min-height: calc(100vh - 72px);
}

.admin-sidebar {
    width: 280px;
    background: rgba(18, 18, 42, 0.9);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--admin-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    z-index: 100;
}

.sidebar-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666688;
    margin-bottom: 1rem;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: #9090b0;
    text-decoration: none !important;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(123, 63, 228, 0.1);
    color: #ffffff;
    transform: translateX(5px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(123, 63, 228, 0.2), rgba(255, 140, 47, 0.1));
    color: #ffffff;
    border: 1px solid rgba(123, 63, 228, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ---- MAIN CONTENT ---- */
.admin-main {
    flex: 1;
    padding: 2.5rem;
    max-width: 1400px;
}

.admin-section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.admin-section.visible {
    display: block;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #9090b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* ---- CARDS GRID ---- */
.admin-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.admin-card:hover {
    transform: translateY(-8px);
    border-color: rgba(123, 63, 228, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.admin-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--admin-border);
}

.admin-card-body {
    padding: 1.5rem;
    flex: 1;
}

.admin-card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.status-pill {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pill.active { background: rgba(76, 175, 80, 0.1); color: #4caf50; border: 1px solid rgba(76, 175, 80, 0.3); }
.status-pill.inactive { background: rgba(244, 67, 54, 0.1); color: #f44336; border: 1px solid rgba(244, 67, 54, 0.3); }

.category-pill {
    background: rgba(123, 63, 228, 0.1);
    color: var(--admin-purple);
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 700;
}

.admin-card-body h4 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.admin-card-actions {
    padding: 1.25rem;
    display: flex;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--admin-border);
}

.btn-admin-edit, .btn-admin-delete, .btn-admin-toggle {
    padding: 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--admin-border);
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
}

.btn-admin-edit:hover { background: var(--admin-purple); border-color: var(--admin-purple); }
.btn-admin-toggle:hover { background: var(--admin-orange); border-color: var(--admin-orange); }
.btn-admin-delete:hover { background: #f44336; border-color: #f44336; }

/* ---- LEADS TABLE ---- */
.leads-section {
    border-radius: 20px;
    overflow: hidden;
}

.table {
    margin: 0;
    color: #ffffff;
    background: transparent;
}

.table th {
    background: rgba(255, 255, 255, 0.03);
    color: #9090b0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.25rem;
    border: none;
}

.table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* ---- MODALS ---- */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: #12122a;
    border: 1px solid var(--admin-border);
    width: 100%;
    max-width: 600px;
    padding: 2.5rem;
    border-radius: 24px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
}

.modal-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(123, 63, 228, 0.1);
    border: 1px solid rgba(123, 63, 228, 0.3);
    border-radius: 50px;
    color: var(--admin-purple);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.admin-modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--admin-border);
    color: #9090b0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f44336;
    color: #fff;
    border-color: #f44336;
}

/* ---- FORM ELEMENTS ---- */
.admin-form-group {
    margin-bottom: 1.5rem;
}

.form-label-admin {
    display: block;
    font-size: 0.8rem;
    color: #9090b0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    color: #ffffff;
    font-family: inherit;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--admin-purple);
    background: rgba(123, 63, 228, 0.05);
    box-shadow: 0 0 20px rgba(123, 63, 228, 0.2);
}

.form-check-admin {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    cursor: pointer;
}

.form-check-admin input {
    width: 20px;
    height: 20px;
    accent-color: var(--admin-purple);
}

.image-preview-box {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--admin-border);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 200px;
}

.btn-admin-save {
    width: 100%;
    padding: 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--admin-purple), var(--admin-orange));
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 8px 25px rgba(123, 63, 228, 0.3);
}

.btn-admin-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(123, 63, 228, 0.5);
}

/* ---- LOGIN PAGE ---- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(180deg, #080814, #0d0d21);
}

.login-card {
    max-width: 420px;
    width: 100%;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.login-header h2 {
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 0.4rem;
}

.login-header p {
    color: #c0c0d8;
    margin-bottom: 1.6rem;
}

.error-message {
    display: none;
    color: #ff8c8c;
    background: rgba(255, 72, 72, 0.08);
    border: 1px solid rgba(255, 72, 72, 0.18);
    border-radius: 14px;
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 0.95rem 1rem;
}

/* ---- RESPONSIVE ---- */
/* ---- RESPONSIVE ---- */
.admin-mobile-toggle {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
}

.admin-mobile-toggle:hover {
    background: var(--admin-purple);
    border-color: var(--admin-purple);
}

.admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.admin-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--admin-border);
    color: #9090b0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-close-btn:hover {
    background: #f44336;
    color: #fff;
}

@media (max-width: 1024px) {
    .admin-sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        width: 280px;
       z-index: 9999;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .admin-sidebar.active {
        left: 0;
    }

    .admin-main {
        padding: 1.5rem;
    }

    .admin-wrapper {
        display: block;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .admin-grid-list {
        grid-template-columns: 1fr;
    }

    .custom-modal {
        padding: 1.5rem;
    }

    .admin-modal-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .navbar-brand .brand-name {
        font-size: 0.9rem;
    }
    .navbar-brand .brand-suffix {
        font-size: 0.6rem;
    }
    
    .btn-admin-save {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
}
