/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    max-width: 500px;
    width: 100%;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.logo {
    background: linear-gradient(135deg, #5865F2, #7289DA);
    color: white;
    text-align: center;
    padding: 40px 20px;
}

.logo h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.login-content {
    padding: 40px;
    text-align: center;
}

.login-content h2 {
    margin-bottom: 10px;
    color: #2c2f33;
}

.login-content p {
    color: #666;
    margin-bottom: 30px;
}

.discord-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #5865F2;
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.discord-login-btn:hover {
    background: #4752C4;
    transform: translateY(-2px);
}

.features {
    text-align: left;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.features h3 {
    margin-bottom: 15px;
    color: #2c2f33;
}

.features ul {
    list-style: none;
}

.features li {
    margin-bottom: 8px;
    color: #666;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    color: #5865F2;
    font-size: 1.5em;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.logout-btn {
    background: #ff4757;
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 20px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    color: #2c2f33;
    margin-bottom: 15px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    background: #5865F2;
    color: white;
}

.server-icon, .server-icon-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #7289DA;
    color: white;
    font-size: 0.8em;
}

.current-server {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    background: #f8f9fa;
}

.dashboard-header, .server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
}

.status-dot.online { background: #2ecc71; }
.status-dot.offline { background: #e74c3c; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 2.5em;
    background: linear-gradient(135deg, #5865F2, #7289DA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-content h3 {
    font-size: 2em;
    margin-bottom: 5px;
    color: #2c2f33;
}

.stat-content p {
    color: #666;
    font-size: 0.9em;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.card h3, .card h4 {
    margin-bottom: 20px;
    color: #2c2f33;
}

/* Buttons */
.action-btn, .save-btn, .toggle-btn {
    background: #5865F2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
}

.action-btn:hover, .save-btn:hover {
    background: #4752C4;
    transform: translateY(-2px);
}

.toggle-btn.active {
    background: #2ecc71;
}

.toggle-btn:not(.active) {
    background: #e74c3c;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-direction: column;
    padding: 20px;
    text-align: center;
}

/* Activity List */
.activity-list {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.activity-time {
    color: #666;
    font-size: 0.9em;
}

/* System Status */
.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.status-value.online {
    color: #2ecc71;
    font-weight: 600;
}

/* Server Header */
.server-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.server-icon-large, .server-icon-large-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    font-size: 1.5em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #7289DA;
    color: white;
}

/* Management Sections */
.management-section {
    display: none;
}

.management-section.active {
    display: block;
}

/* Commands Grid */
.commands-grid {
    display: grid;
    gap: 15px;
}

.command-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.command-desc {
    color: #666;
    font-size: 0.9em;
}

/* Settings */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

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

.setting-item input, .setting-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 200px;
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.rank {
    font-weight: 600;
    color: #5865F2;
    min-width: 40px;
}

/* Error Page */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-container {
    max-width: 400px;
    width: 100%;
    padding: 20px;
}

.error-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.error-card h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    background: #5865F2;
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 10px;
    margin-top: 20px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 15px;
    }

    .main-content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
}

/* Guild cards */
.guild-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guild-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.guild-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.guild-card.pending {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.guild-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guild-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.guild-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #5865F2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.guild-details h4 {
    margin: 0 0 4px 0;
    color: #333;
    font-size: 16px;
}

.guild-details p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.guild-actions .btn {
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: #5865F2;
    color: white;
}

.btn-primary:hover {
    background: #4752C4;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Guild Settings */
.guild-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.guild-header-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.guild-header-icon-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #5865F2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
}

.settings-tab.active {
    background: rgba(88, 101, 242, 0.1);
    color: #5865F2;
    border-left: 3px solid #5865F2;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5865F2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 12px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.command-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.command-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.command-item .checkbox-label {
    margin-bottom: 4px;
}

.command-item small {
    color: #666;
    font-size: 12px;
}