* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #7289da;
    --secondary-color: #2c2f33;
    --background: #36393f;
    --surface: #2c2f33;
    --text: #dcddde;
    --success: #43b581;
    --error: #f04747;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text);
}

/* Login Page */
.login-page {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7289da 0%, #36393f 100%);
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.login-card {
    background-color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
}

.login-subtitle {
    color: rgba(220, 221, 222, 0.7);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.btn-discord {
    background-color: #5865F2;
    color: white;
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-discord:hover {
    background-color: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.4);
}

.login-info {
    text-align: left;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.login-info h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
}

.login-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-info li {
    margin-bottom: 0.75rem;
    color: rgba(220, 221, 222, 0.8);
    font-size: 0.9rem;
}

.container {
    display: flex;
    height: 100vh;
}

.navbar {
    width: 250px;
    background-color: var(--secondary-color);
    padding: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.nav-brand {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(114, 137, 218, 0.2);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.page-header p {
    color: rgba(220, 221, 222, 0.7);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.card p {
    color: rgba(220, 221, 222, 0.7);
    font-size: 14px;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: bold;
}

.status-badge.online {
    background-color: var(--success);
    color: white;
}

.status-badge.offline {
    background-color: var(--error);
    color: white;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.quick-stats h2 {
    margin-bottom: 20px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.module-card {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.module-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(114, 137, 218, 0.3);
}

.module-card h4 {
    margin-bottom: 10px;
}

.module-card p {
    color: rgba(220, 221, 222, 0.7);
    margin-bottom: 15px;
    font-size: 14px;
}

.module-card .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.module-card.loading {
    background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.1) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    height: 100px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #5b6fa8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(114, 137, 218, 0.4);
}

/* Page Navigation */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Modules Section */
.modules-section {
    margin-top: 2rem;
}

.modules-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.module-item {
    background-color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.module-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(114, 137, 218, 0.3);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.module-title {
    font-size: 1.3rem;
    font-weight: bold;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.module-description {
    color: rgba(220, 221, 222, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.module-config-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: bold;
}

.module-config-btn:hover {
    background-color: #5b6fa8;
    transform: translateY(-2px);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.settings-card {
    background-color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2rem;
}

.settings-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.settings-card h3 {
    margin-bottom: 1rem;
}

.setting-hint {
    color: rgba(220, 221, 222, 0.6);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.connection-info {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.connection-info p {
    color: rgba(220, 221, 222, 0.8);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.connection-status {
    font-family: monospace;
    color: var(--primary-color);
    font-weight: bold;
    word-break: break-all;
}

/* Profile Card */
.profile-card {
    background-color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
}

.profile-card h3 {
    margin-bottom: 1.5rem;
}

.profile-card p {
    margin-bottom: 1rem;
    color: rgba(220, 221, 222, 0.8);
}

.profile-card strong {
    color: var(--primary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--error);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Configuration Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text);
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(114, 137, 218, 0.2);
}

.btn-secondary {
    background-color: #4a4d51;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a5d61;
    transform: translateY(-2px);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background-color: var(--success);
    color: white;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Navbar Footer - Theme Toggle */
.nav-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
}

.theme-toggle:hover {
    background-color: rgba(114, 137, 218, 0.2);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Developer Panel */
.dev-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.dev-card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(114, 137, 218, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.dev-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 25px rgba(114, 137, 218, 0.2);
    transform: translateY(-5px);
}

.dev-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.dev-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dev-actions .btn {
    width: 100%;
}

.logs-container {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #43b581;
}

.logs-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-left: 2px solid var(--primary-color);
    padding-left: 0.5rem;
}

.logs-empty {
    color: rgba(220, 221, 222, 0.5);
    font-style: italic;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.stat-item span:first-child {
    color: var(--text);
    font-weight: bold;
}

.stat-item span:last-child {
    color: var(--primary-color);
    font-family: monospace;
}

.env-vars {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 1rem;
}

.env-vars p {
    margin-bottom: 0.75rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: rgba(220, 221, 222, 0.8);
}

.env-vars span {
    color: var(--success);
    font-weight: bold;
}

.debug-console {
    width: 100%;
    height: 200px;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1rem;
    color: #43b581;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.debug-console::-webkit-scrollbar {
    width: 8px;
}

.debug-console::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.debug-console::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Enhanced Design Elements */
.card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(114, 137, 218, 0.03) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(114, 137, 218, 0.15);
}

.module-item {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(114, 137, 218, 0.03) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.settings-card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(114, 137, 218, 0.03) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.profile-card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(114, 137, 218, 0.03) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Dark/Light Theme Support */
:root.light-theme {
    --primary-color: #5b6fa8;
    --secondary-color: #f0f0f0;
    --background: #ffffff;
    --surface: #e8e8e8;
    --text: #1a1a1a;
    --success: #2a9d2a;
    --error: #d32f2f;
}

:root.light-theme body {
    background-color: var(--background);
}

:root.light-theme .navbar {
    background-color: var(--secondary-color);
    border-right-color: #ddd;
}

:root.light-theme .nav-link {
    color: var(--text);
}

:root.light-theme .nav-link:hover {
    background-color: rgba(91, 111, 168, 0.15);
}

:root.light-theme .main-content {
    background-color: #f5f5f5;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .navbar {
        width: 100%;
        padding: 15px;
        gap: 15px;
        flex-direction: row;
        justify-content: space-between;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        gap: 5px;
        overflow-x: auto;
        flex: 1;
    }

    .nav-footer {
        border: none;
        padding: 0;
        margin: 0;
    }

    .main-content {
        padding: 20px;
    }

    .modules-list {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .dev-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }
}
