@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --primary: #6c63ff;
    --primary-dark: #554ee8;
    --primary-light: #eeecff;

    --secondary: #8b83ff;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --sidebar-bg: #17172b;
    --sidebar-hover: #272743;

    --body-bg: #f6f7fb;
    --card-bg: #ffffff;

    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;

    --shadow:
        0 10px 30px rgba(0, 0, 0, 0.06);

    --radius: 16px;

    --sidebar-width: 260px;
}


/* ========================================
   RESET
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;

    background: var(--body-bg);

    color: var(--text-dark);

    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}


/* ========================================
   ADMIN LAYOUT
======================================== */

.admin-wrapper {
    min-height: 100vh;

    display: flex;
}


/* ========================================
   SIDEBAR
======================================== */

.sidebar {
    width: var(--sidebar-width);

    min-height: 100vh;

    background: var(--sidebar-bg);

    position: fixed;

    top: 0;
    left: 0;

    z-index: 1000;

    padding: 25px 18px;

    display: flex;
    flex-direction: column;

    transition: 0.3s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 5px 10px 30px;
}

.sidebar-logo img {
    width: 44px;
    height: 44px;

    border-radius: 12px;

    object-fit: cover;
}

.sidebar-logo h2 {
    color: #ffffff;

    font-size: 20px;
    font-weight: 800;
}

.sidebar-logo span {
    display: block;

    font-size: 11px;

    font-weight: 500;

    color: #9ca3af;

    margin-top: 2px;
}


/* ========================================
   NAVIGATION
======================================== */

.sidebar-nav {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.nav-link {
    width: 100%;

    padding: 13px 14px;

    border-radius: 12px;

    display: flex;
    align-items: center;

    gap: 12px;

    color: #b8b9ca;

    font-size: 14px;
    font-weight: 600;

    transition: 0.2s ease;
}

.nav-link i {
    font-size: 18px;

    width: 22px;

    text-align: center;
}

.nav-link:hover {
    background: var(--sidebar-hover);

    color: #ffffff;
}

.nav-link.active {
    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    color: #ffffff;
}


/* ========================================
   SIDEBAR BOTTOM
======================================== */

.sidebar-bottom {
    margin-top: auto;
}

.logout-btn {
    width: 100%;

    border: none;

    background: transparent;

    color: #ff9494;

    font-size: 14px;
    font-weight: 600;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 13px 14px;

    border-radius: 12px;

    transition: 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.12);
}


/* ========================================
   MAIN CONTENT
======================================== */

.main-content {
    width: calc(100% - var(--sidebar-width));

    margin-left: var(--sidebar-width);

    min-height: 100vh;

    padding: 30px;
}


/* ========================================
   HEADER
======================================== */

.admin-header {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 30px;
}

.header-left {
    display: flex;
    align-items: center;

    gap: 15px;
}

.header-title h1 {
    font-size: 28px;

    font-weight: 800;

    margin-bottom: 5px;
}

.header-title p {
    color: var(--text-light);

    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;

    gap: 15px;
}


/* ========================================
   MOBILE MENU BUTTON
======================================== */

.menu-toggle {
    width: 42px;
    height: 42px;

    border: none;

    background: #ffffff;

    border-radius: 10px;

    box-shadow: var(--shadow);

    display: none;

    align-items: center;
    justify-content: center;

    font-size: 20px;
}


/* ========================================
   PROFILE BOX
======================================== */

.admin-profile {
    display: flex;
    align-items: center;

    gap: 10px;

    background: #ffffff;

    padding: 8px 12px;

    border-radius: 12px;

    box-shadow: var(--shadow);
}

.admin-avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-light);

    color: var(--primary);

    font-weight: 800;
}

.admin-info strong {
    display: block;

    font-size: 13px;
}

.admin-info span {
    font-size: 11px;

    color: var(--text-light);
}


/* ========================================
   CARD
======================================== */

.card {
    background: var(--card-bg);

    border-radius: var(--radius);

    padding: 24px;

    box-shadow: var(--shadow);

    border: 1px solid rgba(229, 231, 235, 0.8);
}


/* ========================================
   PAGE TITLE
======================================== */

.page-top {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 15px;

    margin-bottom: 24px;
}

.page-top h2 {
    font-size: 24px;

    font-weight: 800;
}


/* ========================================
   BUTTONS
======================================== */

.btn {
    border: none;

    border-radius: 10px;

    padding: 11px 18px;

    font-size: 14px;
    font-weight: 600;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    transition: 0.2s ease;
}

.btn-primary {
    background: var(--primary);

    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);
}

.btn-danger {
    background: #fee2e2;

    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);

    color: #ffffff;
}

.btn-outline {
    background: #ffffff;

    border: 1px solid var(--border);

    color: var(--text-dark);
}

.btn-outline:hover {
    border-color: var(--primary);

    color: var(--primary);
}


/* ========================================
   FORM COMMON
======================================== */

.form-group {
    width: 100%;

    margin-bottom: 20px;
}

.form-group label {
    display: block;

    font-size: 13px;

    font-weight: 700;

    margin-bottom: 8px;
}

.form-control {
    width: 100%;

    border: 1px solid var(--border);

    border-radius: 10px;

    background: #ffffff;

    padding: 12px 14px;

    outline: none;

    font-size: 14px;

    transition: 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(108, 99, 255, 0.12);
}

textarea.form-control {
    min-height: 150px;

    resize: vertical;
}


/* ========================================
   TABLE
======================================== */

.table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.admin-table {
    width: 100%;

    border-collapse: collapse;

    min-width: 760px;
}

.admin-table th {
    padding: 14px 15px;

    text-align: left;

    font-size: 12px;

    text-transform: uppercase;

    color: #6b7280;

    background: #fafafa;

    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 15px;

    border-bottom: 1px solid var(--border);

    font-size: 14px;
}

.admin-table tbody tr:hover {
    background: #fafaff;
}


/* ========================================
   BADGES
======================================== */

.badge {
    padding: 6px 10px;

    border-radius: 30px;

    font-size: 11px;

    font-weight: 700;

    display: inline-block;
}

.badge-published {
    background: #dcfce7;

    color: #15803d;
}

.badge-draft {
    background: #fef3c7;

    color: #b45309;
}


/* ========================================
   ALERTS
======================================== */

.alert {
    border-radius: 10px;

    padding: 12px 14px;

    margin-bottom: 18px;

    font-size: 13px;

    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background: #dcfce7;

    color: #166534;
}

.alert-error {
    background: #fee2e2;

    color: #b91c1c;
}


/* ========================================
   OVERLAY
======================================== */

.sidebar-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    z-index: 900;

    opacity: 0;

    visibility: hidden;

    transition: 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;

    visibility: visible;
}



#globalAlertContainer {
    position: fixed;

    top: 20px;
    right: 20px;

    width: min(400px, calc(100% - 40px));

    z-index: 9999;

    display: flex;
    flex-direction: column;

    gap: 10px;
}

.global-alert {
    background: #ffffff;

    border-radius: 12px;

    padding: 14px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.12);

    transform:
        translateX(120%);

    opacity: 0;

    transition:
        0.3s ease;

    border-left:
        4px solid var(--primary);
}

.global-alert.show {
    transform:
        translateX(0);

    opacity: 1;
}

.global-alert-content {
    display: flex;
    align-items: center;

    gap: 10px;

    font-size: 13px;

    font-weight: 600;
}

.global-alert-success {
    border-left-color:
        var(--success);
}

.global-alert-success i {
    color:
        var(--success);
}

.global-alert-error {
    border-left-color:
        var(--danger);
}

.global-alert-error i {
    color:
        var(--danger);
}

.global-alert-warning {
    border-left-color:
        var(--warning);
}

.global-alert-warning i {
    color:
        var(--warning);
}

.global-alert-info {
    border-left-color:
        var(--info);
}

.global-alert-info i {
    color:
        var(--info);
}

.global-alert-close {
    border: none;

    background: transparent;

    font-size: 16px;

    color: #9ca3af;
}



#globalLoader {
    position: fixed;

    inset: 0;

    background:
        rgba(255, 255, 255, 0.75);

    backdrop-filter:
        blur(4px);

    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;

    visibility: hidden;

    transition: 0.2s ease;
}

#globalLoader.active {
    opacity: 1;

    visibility: visible;
}

.loader-box {
    background: #ffffff;

    padding: 28px 35px;

    border-radius: 18px;

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.12);

    text-align: center;
}

.loader-spinner {
    width: 38px;
    height: 38px;

    margin:
        0 auto 14px;

    border-radius: 50%;

    border:
        4px solid #e5e7eb;

    border-top-color:
        var(--primary);

    animation:
        spin 0.8s linear infinite;
}

.loader-box p {
    font-size: 13px;

    font-weight: 600;

    color: var(--text-light);
}

@keyframes spin {

    from {
        transform:
            rotate(0deg);
    }

    to {
        transform:
            rotate(360deg);
    }

}