/* Reset & base */
* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    margin: 0;
    background: #0f172a;
    color: #e5e7eb;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Header */
header {
    background: #020617;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e5e7eb;
}

.user-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}


header h1 {
    font-size: 18px;
    margin: 0;
    color: #e5e7eb;
}

header .button {
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
}

header .button:hover {
    background: #1d4ed8;
}


/* Containers */
.container {
    padding: 24px;
    max-width: 1100px;
    margin: auto;
}

/* Cards */
.card {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #e5e7eb;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #1e293b;
    background: #020617;
    color: #e5e7eb;
    font-size: 1em;
    margin-bottom: 10px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="checkbox"] {
    margin-right: 8px;
}

/* Buttons */
.button,
button,
.submit-btn {
    display: inline-block;
    padding: 10px 16px;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
}

.button:hover,
button:hover,
.submit-btn:hover {
    background: #1d4ed8;
}

/* Guild grid */
.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.guild-card h3 {
    margin-top: 0;
}

.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.guild-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    background: #020617;
    border: 1px solid #1e293b;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.guild-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.guild-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.guild-card h3 {
    margin: 8px 0;
    font-size: 1.1em;
    color: #e5e7eb;
}

.manage-btn {
    background: #22c55e; /* green */
}

.manage-btn:hover {
    background: #16a34a;
}

.invite-btn {
    background: #3b82f6; /* blue */
}

.invite-btn:hover {
    background: #2563eb;
}

.server-card {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    text-align: left;
}

.server-card h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #e5e7eb;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #1e293b;
    background: #020617;
    color: #e5e7eb;
    font-size: 1em;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.submit-btn {
    background: #22c55e; /* green for saving settings */
}

.submit-btn:hover {
    background: #16a34a;
}

.invite-btn {
    background: #3b82f6; /* blue for invite */
}

.invite-btn:hover {
    background: #2563eb;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: #1e293b;
    color: #e5e7eb;
    cursor: pointer;
    font-weight: bold;
}

.tab-button.active {
    background: #2563eb;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: #0f172a;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #020617;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    border-right: 1px solid #1e293b;
}

.sidebar-logo h1 {
    color: #e5e7eb;
    font-size: 1.5rem;
    margin-bottom: 40px;
    text-align: center;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-title {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-link {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-link:hover {
    color: #fff;
}

.sidebar-link.active {
    background: #2563eb;
    color: #fff;
}

.sidebar-user {
    margin-top: 40px;
    text-align: center;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #e5e7eb;
}

.user-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.logout-btn {
    display: block;
    padding: 8px 14px;
    background: #dc2626;
    color: white;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
}

.logout-btn:hover {
    background: #b91c1c;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: 40px 30px;
}

.dashboard-main h2 {
    color: #e5e7eb;
    font-size: 2rem;
    margin-bottom: 30px;
}

/* Guild cards grid */
.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.guild-card {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.guild-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.guild-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.guild-card h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #e5e7eb;
}

.guild-buttons a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 6px;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: background 0.2s;
}

.manage-btn {
    background: #22c55e;
}

.manage-btn:hover {
    background: #16a34a;
}

.invite-btn {
    background: #3b82f6;
}

.invite-btn:hover {
    background: #2563eb;
}

/* Responsive Sidebar */
@media (max-width: 900px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 20px;
        border-right: none;
        border-bottom: 1px solid #1e293b;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 12px;
    }

    .sidebar-user {
        margin-top: 0;
    }
}

/* Sidebar: full height, logo + nav at top, user at bottom */
.sidebar {
    width: 250px;
    background: #020617;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* pushes user info to bottom */
    padding: 20px;
    border-right: 1px solid #1e293b;
}

/* Navbar directly under logo */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px; /* space under logo */
}

/* Keep user info at bottom */
.sidebar-user {
    margin-top: auto; /* ensures bottom alignment */
    text-align: center;
}

/* Optional: make logo sticky at very top if you want */
.sidebar-logo h1 {
    color: #e5e7eb;
    font-size: 1.5rem;
    margin: 0;
    text-align: center;
}

.sidebar-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 20px 0 6px;
    padding-left: 6px;
}

.success-card {
    max-width: 500px;
    margin: 50px auto;
    text-align: center;
}

.success-card h2 {
    color: #22c55e;
}

.success-card p {
    margin: 20px 0;
}

.success-card a {
    display: inline-block;
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.success-card a:hover {
    background: #1d4ed8;
}

.roblox-avatar {
    border-radius: 50%;
    margin-bottom: 20px;
    width: 100px;
    height: 100px;
}

.role-binds-table {
    width: 800px;
    border-collapse: collapse; /* removes double borders */
}

.role-binds-table th,
.role-binds-table td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
    border: none; /* remove visible lines */
}

/* Optional: subtle horizontal lines only */
.role-binds-table tr + tr td {
    border-top: 1px solid #eee;
}

/* Make inputs/selects take full column width */
.role-binds-table td input,
.role-binds-table td select {
    width: 100%;
    box-sizing: border-box;
}

.role-binds-table th {
    font-weight: bold;
}

.roles-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 480px; /* keep it narrow */
}

.role-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #2b2d31;
    border-radius: 6px;
    border: 1px solid #3a3c40;
    user-select: none;
    cursor: pointer;
}

.role-color {
    width: 4px;
    height: 20px;
    border-radius: 2px;
}

.role-name {
    flex: 1;
    font-size: 15px;
    color: #ececec;
}

.role-badge {
    font-size: 11px;
    padding: 2px 6px;
    background: #444;
    border-radius: 4px;
    color: #bbb;
}

.role-managed {
    opacity: 0.6;
    cursor: not-allowed;
}

.role-item.selected {
    background-color: #3d3f45;
    user-select: none;
    cursor: pointer;
}

.role-page-container {
    display: flex;
    gap: 12px;
}

.role-list-pane {
    width: 280px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-right: 1px solid #3a3c40;
    padding-right: 8px;
}

.role-config-pane {
    flex: 1;
    padding: 18px;
    min-height: 400px;
    margin-top: 60px;
}

.role-config-pane .placeholder {
    color: #777;
    font-size: 15px;
}

.role-badge.linked {
    background: #43b581; /* green like “Linked” */
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.role-unmanageable {
    opacity: 0.6;
    cursor: not-allowed;
}
.role-badge.warning {
    background-color: #f04747;
    color: white;
    margin-left: 4px;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
}
