@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');
@import url('/css/loader.css');

:root {
    --bg-color: #050505;
    --card-bg: #0f1014;
    --card-border: rgba(255, 255, 255, 0.05);
    --card-hover-border: rgba(99, 102, 241, 0.3);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #52525b;

    --accent-color: #6366f1;
    --accent-hover: #4f46e5;

    --success: #22c55e;
    --danger: #ef4444;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-logo {
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.nav-logo span {
    color: var(--accent-color);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

/* --- Layout --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8rem 1.5rem 4rem;
}

/* --- Hero --- */
.hero {
    text-align: left;
    margin-bottom: 6rem;
    position: relative;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
}

.hero-title {
    font-size: 140px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom, #fff, #888);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 500px;
}

/* --- Cards --- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
}

.card:hover {
    border-color: var(--card-hover-border);
}

.card-title-sm {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title-sm::before {
    content: '';
    width: 20px;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
}

.card-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Discord Card Specifics */
.discord-card {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(145deg, var(--card-bg), #13141a);
}

.discord-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--card-border);
}

.discord-user {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    border: 1px solid var(--card-border);
    transition: all 0.2s;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

/* --- Dashboard --- */
.dashboard-layout {
    display: flex;
    gap: 2rem;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.sidebar-nav button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar-nav button:hover,
.sidebar-nav button.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-nav button.active {
    background: var(--accent-color);
}

.content-area {
    flex-grow: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    min-height: 500px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Table / Lists */
.config-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.config-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.config-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

select {
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    min-width: 150px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 80px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.module-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.module-card:hover {
    border-color: var(--accent-color);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.btn-settings {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-settings:hover {
    background: var(--accent-color);
    color: white;
    transform: rotate(45deg);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    /* hidden by default */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #13141a;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    text-align: right;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 12px;
}

.modal-tabs button {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.modal-tabs button.active {
    background: var(--accent-color);
    color: white;
}

/* Role Tags */
.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 50px;
}

.role-tag {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-tag button {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    display: flex;
    /* Fix icon alignment */
}

.role-tag button:hover {
    color: #fff;
}

/* Custom Select */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.custom-select-trigger:hover {
    border-color: var(--card-hover-border);
    color: var(--text-primary);
}

.custom-options {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #13141a;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.custom-options.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
    color: var(--text-secondary);
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 5px currentColor;
}

/* Confirmation Dialog */
.confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(19, 20, 26, 0.95);
    z-index: 10;
    /* Above modal body content */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    flex-direction: column;
    text-align: center;
    padding: 2rem;
}