@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap");

:root {
    --bg: #050b0f;
    --bg2: #07151b;
    --panel: #0a1a21;
    --panel2: #0d222b;

    --primary: #065971;
    --primary2: #08738f;

    --gold: #ffd66b;
    --gold2: #f0bd45;

    --text: #f4f8fa;
    --muted: #8297a0;

    --border: rgba(255,255,255,.07);

    --danger: #e05252;

    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(6,89,113,.18),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "Cairo",
        Arial,
        sans-serif;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.app {
    min-height: 100vh;

    display: flex;
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
    width: 270px;

    position: fixed;

    right: 0;
    top: 0;
    bottom: 0;

    padding: 24px 16px;

    background:
        linear-gradient(
            180deg,
            rgba(10,28,35,.98),
            rgba(5,13,18,.98)
        );

    border-left:
        1px solid var(--border);

    z-index: 20;

    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 4px 8px 25px;
}

.brand-logo,
.hero-logo {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 14px;

    color: #07151b;

    font-weight: 900;

    background:
        linear-gradient(
            135deg,
            var(--gold),
            var(--gold2)
        );

    box-shadow:
        0 10px 35px
        rgba(255,214,107,.12);
}

.brand strong {
    display: block;

    font-size: 17px;
}

.brand small {
    display: block;

    color: var(--muted);

    font-size: 11px;
}

.user-card {
    padding: 12px;

    border:
        1px solid var(--border);

    background:
        rgba(255,255,255,.025);

    border-radius: 15px;

    display: flex;

    gap: 10px;

    align-items: center;

    margin-bottom: 22px;
}

.user-card img {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    object-fit: cover;
}

.user-card strong {
    display: block;

    font-size: 13px;
}

.user-card small {
    color: var(--muted);

    font-size: 10px;
}

.sidebar-title {
    color: #526a73;

    font-size: 11px;

    font-weight: 700;

    padding:
        0 10px 8px;
}

.nav-item {
    border: 0;

    background: transparent;

    color: #8fa3aa;

    width: 100%;

    text-align: right;

    padding: 12px 14px;

    border-radius: 12px;

    margin-bottom: 5px;

    transition:
        .2s ease;

    display: flex;

    align-items: center;

    gap: 12px;

    font-size: 13px;
}

.nav-item span {
    width: 23px;

    height: 23px;

    display: grid;

    place-items: center;

    border-radius: 7px;

    background:
        rgba(255,255,255,.035);
}

.nav-item:hover {
    color: white;

    background:
        rgba(6,89,113,.14);

    transform:
        translateX(-2px);
}

.nav-item.active {
    color: white;

    background:
        linear-gradient(
            90deg,
            rgba(6,89,113,.35),
            rgba(6,89,113,.08)
        );

    box-shadow:
        inset -3px 0
        var(--gold);
}

.nav-item.active span {
    color: var(--gold);

    background:
        rgba(255,214,107,.08);
}

.sidebar-bottom {
    margin-top: auto;
}

.logout {
    display: block;

    text-align: center;

    color: #87999f;

    text-decoration: none;

    border:
        1px solid var(--border);

    padding: 10px;

    border-radius: 12px;

    transition: .2s;
}

.logout:hover {
    color: white;

    border-color:
        rgba(255,214,107,.25);
}


/* =====================================================
   MAIN
===================================================== */

.main {
    width: calc(100% - 270px);

    margin-right: 270px;

    padding: 34px 42px 70px;

    min-width: 0;
}

.topbar {
    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    gap: 25px;

    margin-bottom: 30px;
}

.eyebrow {
    color: var(--gold);

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 2px;
}

.topbar h1 {
    margin: 3px 0 0;

    font-size: 30px;
}

.topbar p {
    color: var(--muted);

    margin: 2px 0 0;

    font-size: 12px;
}

.server-select-wrapper {
    min-width: 230px;
}

.server-select-wrapper label {
    display: block;

    color: var(--muted);

    font-size: 11px;

    margin-bottom: 6px;
}

select,
input,
textarea {
    width: 100%;

    border:
        1px solid var(--border);

    background:
        #091920;

    color: white;

    outline: none;

    border-radius: 12px;

    padding: 12px 13px;

    transition: .2s;

    font-size: 12px;
}

select:focus,
input:focus,
textarea:focus {
    border-color:
        rgba(6,115,143,.7);

    box-shadow:
        0 0 0 3px
        rgba(6,89,113,.12);
}

textarea {
    min-height: 110px;

    resize: vertical;
}


/* =====================================================
   PANELS
===================================================== */

.panel {
    display: none;

    animation:
        fadeIn .3s ease;
}

.active-panel {
    display: block;
}

@keyframes fadeIn {

    from {
        opacity: 0;
        transform:
            translateY(8px);
    }

    to {
        opacity: 1;
        transform:
            translateY(0);
    }

}


/* =====================================================
   HERO
===================================================== */

.hero {
    min-height: 220px;

    padding: 35px;

    border-radius:
        24px;

    border:
        1px solid var(--border);

    background:
        radial-gradient(
            circle at 10% 30%,
            rgba(6,89,113,.4),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #0a2029,
            #071218
        );

    display: flex;

    align-items: center;

    justify-content: space-between;

    overflow: hidden;

    position: relative;
}

.hero::after {
    content: "";

    position: absolute;

    width: 250px;
    height: 250px;

    left: -100px;
    top: -120px;

    border-radius: 50%;

    background:
        rgba(255,214,107,.035);

    filter:
        blur(2px);
}

.badge {
    display: inline-block;

    color: var(--gold);

    background:
        rgba(255,214,107,.07);

    border:
        1px solid
        rgba(255,214,107,.12);

    border-radius: 999px;

    padding: 4px 10px;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 1px;
}

.hero h2 {
    margin: 13px 0 4px;

    font-size: 29px;
}

.hero p {
    color: var(--muted);

    margin: 0;

    max-width: 550px;

    font-size: 13px;
}

.hero-logo {
    width: 110px;
    height: 110px;

    border-radius: 30px;

    font-size: 30px;

    opacity: .9;
}


/* =====================================================
   STATS
===================================================== */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;

    margin-top: 16px;
}

.stat-card {
    padding: 20px;

    background:
        rgba(255,255,255,.025);

    border:
        1px solid var(--border);

    border-radius: 17px;

    transition: .2s;
}

.stat-card:hover {
    transform:
        translateY(-3px);

    border-color:
        rgba(255,214,107,.14);
}

.stat-card span {
    display: block;

    color: var(--muted);

    font-size: 11px;
}

.stat-card strong {
    display: block;

    margin-top: 6px;

    font-size: 27px;
}


/* =====================================================
   QUICK
===================================================== */

.quick-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;

    margin-top: 16px;
}

.quick-card {
    border:
        1px solid var(--border);

    background:
        #09171d;

    color: white;

    text-align: right;

    border-radius: 17px;

    padding: 20px;

    transition: .2s;
}

.quick-card:hover {
    transform:
        translateY(-4px);

    border-color:
        rgba(6,115,143,.4);

    background:
        #0b2028;
}

.quick-card span {
    display: grid;

    place-items: center;

    width: 40px;
    height: 40px;

    background:
        rgba(255,214,107,.07);

    color: var(--gold);

    border-radius: 12px;

    margin-bottom: 14px;
}

.quick-card strong,
.quick-card small {
    display: block;
}

.quick-card strong {
    font-size: 14px;
}

.quick-card small {
    color: var(--muted);

    margin-top: 4px;

    font-size: 10px;
}


/* =====================================================
   SECTION
===================================================== */

.section-head {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.section-head h2 {
    margin:
        8px 0 2px;

    font-size: 24px;
}

.section-head p {
    color: var(--muted);

    font-size: 12px;

    margin: 0;
}


/* =====================================================
   CARDS
===================================================== */

.card {
    background:
        rgba(255,255,255,.025);

    border:
        1px solid var(--border);

    border-radius: 18px;

    padding: 22px;

    box-shadow:
        0 15px 45px
        rgba(0,0,0,.08);
}

.card h3 {
    margin:
        0 0 18px;

    font-size: 15px;
}

.two-column {
    display: grid;

    grid-template-columns:
        minmax(0, .85fr)
        minmax(0, 1.15fr);

    gap: 16px;
}

.card label {
    display: block;

    color: #a9bbc0;

    font-size: 11px;

    margin:
        13px 0 7px;
}

.hint {
    color: #61777f;

    font-size: 10px;

    margin-top: 7px;

    line-height: 1.7;
}

.gold-btn,
.outline-btn,
.danger-btn {
    border: 0;

    border-radius: 11px;

    padding: 11px 16px;

    font-size: 12px;

    font-weight: 700;

    transition: .2s;
}

.gold-btn {
    color: #071217;

    background:
        linear-gradient(
            135deg,
            var(--gold),
            var(--gold2)
        );

    margin-top: 18px;

    box-shadow:
        0 8px 25px
        rgba(255,214,107,.08);
}

.gold-btn:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 12px 30px
        rgba(255,214,107,.15);
}

.outline-btn {
    color: var(--gold);

    background:
        rgba(255,214,107,.04);

    border:
        1px solid
        rgba(255,214,107,.18);

    margin-top: 15px;
}

.outline-btn:hover {
    background:
        rgba(255,214,107,.08);
}

.danger-btn {
    color: #ff9c9c;

    background:
        rgba(224,82,82,.08);

    border:
        1px solid
        rgba(224,82,82,.13);
}

.form-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 14px;
}


/* =====================================================
   SWITCH
===================================================== */

.switch {
    display: inline-block;

    position: relative;

    width: 48px;
    height: 27px;

    flex-shrink: 0;
}

.switch input {
    display: none;
}

.switch span {
    position: absolute;

    inset: 0;

    border-radius: 99px;

    background:
        #172b32;

    cursor: pointer;

    transition: .25s;
}

.switch span::before {
    content: "";

    width: 19px;
    height: 19px;

    position: absolute;

    top: 4px;
    right: 5px;

    background:
        #75878d;

    border-radius: 50%;

    transition: .25s;
}

.switch input:checked + span {
    background:
        var(--primary);
}

.switch input:checked + span::before {
    right: 24px;

    background:
        var(--gold);
}

.switch.small {
    width: 42px;
    height: 23px;
}

.switch.small span::before {
    width: 15px;
    height: 15px;
}

.switch.small input:checked + span::before {
    right: 22px;
}


/* =====================================================
   UPLOAD
===================================================== */

.upload-box {
    border:
        1px dashed
        rgba(255,255,255,.12);

    min-height: 115px;

    border-radius: 14px;

    display: flex !important;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 4px;

    cursor: pointer;

    background:
        rgba(255,255,255,.015);
}

.upload-box:hover {
    border-color:
        rgba(255,214,107,.3);
}

.upload-box input {
    display: none;
}

.upload-box span {
    font-size: 24px;

    color: var(--gold);
}

.upload-box strong {
    font-size: 12px;
}

.upload-box small {
    color: var(--muted);

    font-size: 9px;
}


/* =====================================================
   WELCOME PREVIEW
===================================================== */

.welcome-preview {
    width: 100%;

    aspect-ratio:
        1200 / 675;

    position: relative;

    overflow: hidden;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #07151b,
            #065971
        );

    border:
        1px solid var(--border);

    user-select: none;
}

.preview-bg {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    opacity: .9;
}

.welcome-preview::after {
    content: "";

    position: absolute;

    inset: 0;

    background:
        rgba(0,0,0,.32);

    pointer-events: none;
}

.preview-avatar,
.preview-username,
.preview-message {
    position: absolute;

    transform:
        translate(-50%, -50%);

    z-index: 2;
}

.preview-avatar {
    width: 120px;
    height: 120px;

    border-radius: 50%;

    overflow: hidden;

    cursor: grab;

    touch-action: none;
}

.preview-avatar:active {
    cursor: grabbing;
}

.preview-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.preview-username {
    color: white;

    font-weight: 800;

    white-space: nowrap;

    cursor: grab;
}

.preview-message {
    color: #d8e4e7;

    white-space: nowrap;

    cursor: grab;
}

.designer-controls {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;

    margin-top: 16px;
}

.designer-controls label {
    margin-top: 0;
}

input[type="range"] {
    padding: 0;

    accent-color:
        var(--gold);

    background: transparent;

    border: 0;
}


/* =====================================================
   REPLIES
===================================================== */

.reply-list {
    display: grid;

    gap: 14px;
}

.reply-card {
    border:
        1px solid var(--border);

    background:
        rgba(255,255,255,.025);

    border-radius: 17px;

    padding: 20px;
}

.reply-top {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 10px;
}

.reply-card textarea {
    min-height: 80px;
}


/* =====================================================
   RULES
===================================================== */

.rules-list {
    display: grid;

    gap: 12px;

    margin-top: 18px;
}

.rule-card {
    display: grid;

    grid-template-columns:
        35px 1fr auto;

    gap: 12px;

    align-items: start;

    border:
        1px solid var(--border);

    background:
        #09181e;

    border-radius: 15px;

    padding: 13px;
}

.rule-number {
    width: 31px;
    height: 31px;

    display: grid;

    place-items: center;

    color: var(--gold);

    background:
        rgba(255,214,107,.07);

    border-radius: 9px;

    font-weight: 800;
}

.rule-fields {
    display: grid;

    gap: 8px;
}

.rule-fields textarea {
    min-height: 70px;
}


/* =====================================================
   AUTO ROLE
===================================================== */

.custom-picker {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(180px, 1fr)
        );

    gap: 9px;

    max-height: 350px;

    overflow-y: auto;

    padding: 4px;
}

.role-option {
    border:
        1px solid var(--border);

    background:
        #09181e;

    color: #b7c5c9;

    border-radius: 12px;

    padding: 11px;

    display: flex;

    align-items: center;

    gap: 9px;

    text-align: right;

    transition: .2s;
}

.role-option:hover {
    border-color:
        rgba(255,214,107,.18);

    transform:
        translateY(-1px);
}

.role-option.selected {
    border-color:
        rgba(255,214,107,.35);

    background:
        rgba(6,89,113,.24);

    color: white;
}

.role-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background:
        var(--primary2);
}

.role-check {
    margin-right: auto;

    opacity: 0;

    color: var(--gold);

    font-weight: 900;
}

.role-option.selected .role-check {
    opacity: 1;
}

.selected-tags {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 14px;
}

.role-tag {
    display: flex;

    align-items: center;

    gap: 5px;

    background:
        rgba(6,89,113,.18);

    border:
        1px solid
        rgba(6,115,143,.3);

    color: #cfe1e5;

    border-radius: 999px;

    padding:
        5px 9px;

    font-size: 10px;
}

.role-tag button {
    border: 0;

    background: transparent;

    color: #789198;

    font-size: 15px;
}


/* =====================================================
   EMBED PREVIEW
===================================================== */

.embed-preview-card {
    display: flex;

    flex-direction: column;

    justify-content: center;
}

.fake-embed {
    border-right:
        3px solid var(--primary);

    background:
        #0d1d23;

    border-radius: 9px;

    padding: 18px;

    min-height: 180px;

    box-shadow:
        0 15px 35px
        rgba(0,0,0,.2);
}

.fake-title {
    font-size: 16px;

    font-weight: 800;

    margin-bottom: 10px;
}

.fake-description {
    color: #b7c8cd;

    white-space: pre-wrap;

    font-size: 12px;

    line-height: 1.7;
}

.fake-image {
    max-width: 100%;

    max-height: 230px;

    display: block;

    margin-top: 14px;

    border-radius: 9px;
}

.fake-embed small {
    display: block;

    color: #62767d;

    margin-top: 15px;
}


/* =====================================================
   COLOR
===================================================== */

.color-row {
    display: flex;

    gap: 10px;
}

.color-row input[type="color"] {
    width: 52px;

    padding: 4px;

    height: 43px;

    cursor: pointer;
}

.small-card {
    max-width: 550px;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (
    max-width: 1100px
) {

    .stats-grid,
    .quick-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .two-column {
        grid-template-columns:
            1fr;
    }

}


@media (
    max-width: 800px
) {

    .sidebar {
        width: 75px;

        padding:
            18px 10px;
    }

    .brand {
        justify-content:
            center;
    }

    .brand > div:not(.brand-logo),
    .user-card > div,
    .sidebar-title,
    .nav-item:not(.active) span + *,
    .logout {
        display: none;
    }

    .user-card {
        justify-content:
            center;
    }

    .nav-item {
        justify-content:
            center;

        padding: 12px;
    }

    .main {
        width:
            calc(100% - 75px);

        margin-right:
            75px;

        padding:
            25px 18px 50px;
    }

    .topbar {
        align-items:
            stretch;

        flex-direction:
            column;
    }

    .server-select-wrapper {
        width: 100%;
    }

}


@media (
    max-width: 600px
) {

    .stats-grid,
    .quick-grid,
    .designer-controls,
    .form-grid {
        grid-template-columns:
            1fr;
    }

    .hero {
        padding: 25px;

        min-height:
            190px;
    }

    .hero-logo {
        display: none;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .section-head {
        align-items:
            flex-start;
    }

    .rule-card {
        grid-template-columns:
            30px 1fr;
    }

    .rule-card .danger-btn {
        grid-column:
            2;
    }

}
/* =====================================================
   DIBBABOT CUSTOM SELECTORS
===================================================== */

.custom-select-wrap {
    position: relative;
    width: 100%;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    min-height: 44px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    border: 1px solid var(--border);
    background: #091920;

    color: white;

    border-radius: 12px;

    padding: 11px 13px;

    font-size: 12px;

    text-align: right;

    transition: .2s;
}

.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger {
    border-color: rgba(6,115,143,.7);

    box-shadow:
        0 0 0 3px
        rgba(6,89,113,.12);
}

.custom-select-label {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.custom-select-arrow {
    color: var(--gold);

    font-size: 15px;

    transition: .2s;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: absolute;

    top: calc(100% + 7px);

    right: 0;
    left: 0;

    z-index: 999;

    display: none;

    padding: 7px;

    background:
        #0a1a21;

    border:
        1px solid var(--border);

    border-radius: 14px;

    box-shadow:
        0 18px 45px
        rgba(0,0,0,.35);

    max-height: 280px;

    overflow-y: auto;
}

.custom-select.open .custom-select-menu {
    display: block;
}

.custom-select-option {
    width: 100%;

    border: 0;

    background: transparent;

    color: #b7c5c9;

    border-radius: 10px;

    padding: 10px 11px;

    display: flex;

    align-items: center;

    gap: 9px;

    text-align: right;

    font-size: 11px;

    transition: .15s;
}

.custom-select-option:hover {
    color: white;

    background:
        rgba(6,89,113,.18);
}

.custom-select-option.selected {
    color: white;

    background:
        rgba(6,89,113,.28);

    border:
        1px solid
        rgba(255,214,107,.12);
}

.custom-select-option .option-icon {
    width: 25px;
    height: 25px;

    display: grid;

    place-items: center;

    flex-shrink: 0;

    border-radius: 7px;

    background:
        rgba(255,255,255,.035);

    color: var(--gold);
}

.custom-select-option .option-check {
    margin-right: auto;

    color: var(--gold);

    opacity: 0;
}

.custom-select-option.selected .option-check {
    opacity: 1;
}

.custom-select-empty {
    color: var(--muted);

    text-align: center;

    padding: 15px 8px;

    font-size: 11px;
}


/* =====================================================
   PICKER SCROLLBAR
===================================================== */

.custom-select-menu::-webkit-scrollbar,
.custom-picker::-webkit-scrollbar {
    width: 5px;
}

.custom-select-menu::-webkit-scrollbar-track,
.custom-picker::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-menu::-webkit-scrollbar-thumb,
.custom-picker::-webkit-scrollbar-thumb {
    background: rgba(255,214,107,.18);

    border-radius: 20px;
}


/* =====================================================
   REPLY PICKERS
===================================================== */

.reply-card .custom-select-wrap {
    margin-top: 7px;
}


/* =====================================================
   WELCOME PREVIEW
   الصورة = Avatar + Username فقط
===================================================== */

.preview-message {
    display: none !important;
}


/* =====================================================
   HIDDEN NATIVE SELECTS
===================================================== */

select[hidden] {
    display: none !important;
}


/* =====================================================
   AUTO ROLE - TWO PICKERS
===================================================== */

.auto-role-columns {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 16px;
}

.auto-role-box {
    min-width: 0;
}

.auto-role-box h4 {
    margin: 0 0 12px;

    font-size: 13px;

    color: white;
}

.auto-role-box h4 span {
    color: var(--gold);
}

@media (max-width: 800px) {

    .auto-role-columns {
        grid-template-columns: 1fr;
    }

}