@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary: #3a46f5;
    --primary-gradient: linear-gradient(71.3deg, #3e59f5 0%, #5d60f3 100%);
    --blue: #7289da;
    --red: #ed4245;
    --background: #121212;
    --card-bg: #1e1e1e;
    --header-bg: #202225;
    --text-primary: #ffffff;
    --text-secondary: #b9bbbe;
    --border-color: #40444b;
}

/* ========== Grundlegende Stile ========== */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--text-primary);
    font-weight: 400;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== Header & Navigation ========== */
header {
    background-color: var(--header-bg);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

header h1 {
    margin: 0;
    font-weight: 700;
    font-size: 1.8rem;
}

header h1 a {
    color: var(--text-primary);
    text-decoration: none;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* ========== User Dropdown ========== */
.user-dropdown {
    position: relative;
    margin-left: auto;
    height: 100%;
    display: flex;
    align-items: center;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.user-toggle:hover {
    background-color: rgba(114, 137, 218, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 200px;
    z-index: 100;
    display: none;
    padding: 8px 0;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(114, 137, 218, 0.1);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 8px 0;
}

.dropdown-item.logout {
    color: var(--red);
}

/* ========== Login/Logout Buttons ========== */
.btn-login, .btn-logout {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    height: 100%;
}

.btn-login {
    background: var(--primary-gradient);
    color: white;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(58, 70, 245, 0.4);
}

/* ========== Icons ========== */
.icon-home::before { content: "🏠"; margin-right: 5px; }
.icon-dashboard::before { content: "📊"; margin-right: 5px; }
.icon-logout::before { content: "🚪"; margin-right: 5px; }
.icon-discord::before { content: "🔗"; margin-right: 5px; }
.icon-settings::before { content: "⚙️"; margin-right: 5px; }
.icon-add::before { content: "➕"; margin-right: 5px; }
.icon-commands::before { content: "📝"; margin-right: 5px; }
.icon-refresh::before { content: "♾️"; }

/* ========== Welcome Page ========== */
.welcome-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 2rem;
    justify-content: center;
}

.feature-card {
    flex: 1;
    min-width: 250px;
    padding: 1.5rem;
    background: var(--header-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ========== Dashboard Styles ========== */
.dashboard-container, .commands-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 3rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

h1, h2 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.server-controls {
    display: flex;
    justify-content: flex-start;
    margin: 0.5rem 0 1.5rem 0;
}

.btn-refresh {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 15px 10px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(153, 93, 243, 0.3);
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(153, 93, 243, 0.4);
}

.icon-refresh {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 5px;
    background: url('../img/refresh-icon.svg') no-repeat center;
    filter: brightness(0) invert(1);
}

/* ========== Server List ========== */
.server-list {
    background: var(--header-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.server-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.server-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--blue);
}

.server-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.default-icon {
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.server-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.1rem;
}

/* ========== Action Buttons ========== */
.btn-invite, .btn-manage {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.btn-invite {
    background: linear-gradient(135deg, #57F287 0%, #43B581 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(67, 181, 129, 0.3);
}

.btn-invite:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(67, 181, 129, 0.4);
    background: linear-gradient(135deg, #57F287 0%, #3AA371 100%);
}

.btn-manage {
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(88, 101, 242, 0.3);
}

.btn-manage:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
    background: linear-gradient(135deg, #5865F2 0%, #3B45A5 100%);
}

.server-actions {
    display: flex;
    gap: 10px;
}

/* ========== Commands Page ========== */
.command-card {
    background: var(--header-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.command-title {
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.command-desc {
    color: var(--text-secondary);
    line-height: 1.5;
}

.command-usage {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    margin-top: 10px;
    display: inline-block;
}

/* ========== Form Elements ========== */
input[type="text"], 
input[type="password"],
select,
textarea {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 6px;
    width: 100%;
    max-width: 400px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(114, 137, 218, 0.3);
    outline: none;
}

button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(153, 93, 243, 0.4);
}

/* ========== Footer ========== */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .user-dropdown {
        width: 100%;
        margin-left: 0;
    }
    
    .dropdown-menu {
        width: 100%;
        position: static;
    }

    .server-card, .feature-card {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .server-info {
        flex-direction: column;
    }
    
    .btn-invite, .btn-manage {
        width: 100%;
    }

    .features {
        flex-direction: column;
    }
    
    .feature-card {
        min-width: 100%;
    }
}

/* ========== Utility Classes ========== */
.no-servers {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
}

/* ========== Footer ========== */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .user-dropdown {
        width: 100%;
        margin-left: 0;
    }
    
    .dropdown-menu {
        width: 100%;
        position: static;
    }

    .server-card {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .server-info {
        flex-direction: column;
        text-align: center;
    }
    
    .server-actions {
        width: 100%;
        justify-content: center;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
    }
    
    .admin-table th:not(:last-child)::after,
    .admin-table td:not(:last-child)::after {
        display: none;
    }
}

/* ========== Form Elements ========== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 6px;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(114, 137, 218, 0.3);
    outline: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    margin-top: 1rem;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0.5rem 0 0;
}

/* ========== Admin Panel Styles ========== */
.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.admin-sections {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.admin-section {
    background: var(--header-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.admin-section h2 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th, 
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.admin-table th {
    background: rgba(0, 0, 0, 0.1);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

/* Column separators */
.admin-table th:not(:last-child)::after,
.admin-table td:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: var(--border-color);
}

/* ========== Alerts ========== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.error {
    background-color: rgba(237, 66, 69, 0.1);
    border-left: 4px solid var(--red);
    color: var(--red);
}

.alert.success {
    background-color: rgba(59, 165, 92, 0.1);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.server-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

.server-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.server-stats {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-item i {
    color: var(--primary-color);
}

/* ===== Ticket System Dropdown Fix ===== */
.user-dropdown {
    position: relative;
    margin-left: auto;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #1e1e1e; /* Dunkler Hintergrund */
    border: 1px solid #40444b;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 200px;
    z-index: 1000; /* Höherer z-index */
    display: none;
    padding: 8px 0;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    color: #ffffff !important; /* Weiße Schrift */
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: rgba(114, 137, 218, 0.2) !important;
    color: #ffffff !important;
}

.dropdown-divider {
    height: 1px;
    background-color: #40444b;
    margin: 8px 0;
}

.dropdown-item.logout {
    color: #ed4245 !important;
}

.dropdown-item.logout:hover {
    background-color: rgba(237, 66, 69, 0.1) !important;
}