/* Admin Dashboard Styles */

.admin-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.dashboard-header h1 {
    font-size: 2rem;
    margin: 0;
}

.admin-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.admin-role {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
}

/* Tabs */
.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #2c2f33;
    padding-bottom: 0;
}

.dashboard-tabs .tab {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #b9bbbe;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    position: relative;
    top: 2px;
}

.dashboard-tabs .tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-tabs .tab.active {
    color: #5865F2;
    border-bottom-color: #5865F2;
}

/* Dashboard Content */
.dashboard-content {
    background: #2c2f33;
    border-radius: 12px;
    padding: 2rem;
    min-height: 500px;
}

/* Settings Tab */
.settings-tab {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-category {
    background: #23272a;
    border-radius: 8px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.category-icon {
    font-size: 1.5rem;
}

.category-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.125rem;
}

.expand-icon {
    color: #b9bbbe;
    transition: transform 0.3s;
}

.category-content {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid #40444b;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #40444b;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-info label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.setting-description {
    font-size: 0.875rem;
    color: #b9bbbe;
    margin: 0;
}

.setting-control {
    display: flex;
    align-items: center;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #40444b;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #5865F2;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Input Fields */
.number-input,
.text-input {
    padding: 0.5rem 0.75rem;
    background: #40444b;
    border: 1px solid #202225;
    border-radius: 6px;
    color: #fff;
    font-size: 0.875rem;
    width: 200px;
}

.number-input:focus,
.text-input:focus {
    outline: none;
    border-color: #5865F2;
}

/* Guilds Tab */
.guilds-tab {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.guilds-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #23272a;
    border: 1px solid #40444b;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #5865F2;
}

.refresh-btn {
    padding: 0.75rem 1.5rem;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #4752c4;
}

/* Table Styles */
.guilds-table,
.audit-log-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #23272a;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #b9bbbe;
    font-size: 0.875rem;
    text-transform: uppercase;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #40444b;
}

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

td code {
    background: #23272a;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.feature-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.5rem;
    background: #5865F2;
    border-radius: 4px;
    font-size: 0.75rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #3ba55c;
    color: white;
}

.status-badge.inactive {
    background: #ed4245;
    color: white;
}

/* Monitoring Tab */
.monitoring-tab {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.monitoring-tab h2 {
    margin: 0;
    font-size: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Audit Log Tab */
.audit-log-tab {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

details {
    cursor: pointer;
}

summary {
    color: #5865F2;
    font-size: 0.875rem;
    user-select: none;
}

details pre {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #23272a;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.75rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #4752c4;
}

.pagination button:disabled {
    background: #40444b;
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination span {
    color: #b9bbbe;
    font-weight: 500;
}

/* Loading States */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    color: #b9bbbe;
    font-size: 1.125rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #b9bbbe;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.notification-info {
    background: #5865F2;
}

.notification-success {
    background: #3ba55c;
}

.notification-error {
    background: #ed4245;
}

.notification.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Admin Link in Nav */
.admin-link {
    color: #faa61a !important;
    font-weight: 600;
}

.admin-link:hover {
    color: #f57600 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-dashboard {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .dashboard-tabs {
        flex-wrap: wrap;
    }

    .dashboard-tabs .tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .guilds-controls {
        flex-direction: column;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

/* Feature Group Styles */
.feature-group {
    background: #23272a;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.feature-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.expand-icon-small {
    color: #b9bbbe;
    font-size: 0.875rem;
    transition: transform 0.3s;
}

.feature-name {
    flex: 1;
    font-weight: 500;
    font-size: 1rem;
    color: #fff;
}

.feature-configs {
    padding: 0 1.25rem 1rem 1.25rem;
    margin-left: 2rem;
    border-left: 3px solid #40444b;
    background: rgba(0, 0, 0, 0.2);
}

.configs-label {
    font-size: 0.875rem;
    color: #b9bbbe;
    font-weight: 500;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feature-configs .setting-item {
    padding: 0.75rem 0;
    margin-left: 0.5rem;
}

.feature-configs .setting-item:first-of-type {
    padding-top: 0;
}

/* Toggle in feature header */
.feature-header .toggle-switch {
    margin-left: auto;
}

/* Config fields container */
.config-fields-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.75rem;
}

/* Config field layout */
.config-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.config-field-info {
    flex: 1;
    min-width: 0;
}

.config-label {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.config-description {
    font-size: 0.85rem;
    color: #b9bbbe;
    margin: 0;
    line-height: 1.4;
}

.config-field-control {
    flex-shrink: 0;
    min-width: 200px;
}

/* Input styles */
.config-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #2c2f33;
    border: 1px solid #40444b;
    border-radius: 4px;
    color: #dcddde;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.config-input:focus {
    outline: none;
    border-color: #5865f2;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.config-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Number input */
.config-number-input {
    text-align: right;
    -moz-appearance: textfield;
}

.config-number-input::-webkit-outer-spin-button,
.config-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Textarea */
.config-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.5;
}

/* Select dropdown */
.config-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23dcddde' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Multiselect */
.config-multiselect {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #2c2f33;
    border: 1px solid #40444b;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s ease;
}

.multiselect-option:hover {
    background: rgba(88, 101, 242, 0.1);
}

.multiselect-option input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.multiselect-option .option-label {
    color: #dcddde;
    font-size: 0.9rem;
    user-select: none;
}

/* Array input */
.config-array-input {
    font-family: 'Courier New', monospace;
}

/* Save Changes Bar */
.save-changes-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #5865f2, #4752c4);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.save-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.save-bar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.unsaved-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
}

.save-bar-text {
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
}

.save-bar-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-discard,
.btn-save {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-discard {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-discard:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
}

.btn-save {
    background: #fff;
    color: #5865f2;
}

.btn-save:hover:not(:disabled) {
    background: #f6f6f7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-discard:disabled,
.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
