* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    color: #e4e4e7;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
}

#login-container, #servers-container, #server-container, #admin-login-container, #admin-panel {
    background: rgba(24, 24, 27, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(63, 63, 70, 0.4);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 420px;
    max-width: 900px;
    position: relative;
}

#login-container::before, #servers-container::before, #server-container::before, 
#admin-login-container::before, #admin-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.1) 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    padding: 1px;
    z-index: -1;
}

h2 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 2.25rem;
    font-weight: 700;
    color: #fafafa;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #fafafa 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #f4f4f5;
    margin-bottom: 16px;
}

input {
    width: 100%;
    padding: 16px 20px;
    margin: 12px 0;
    border: 1px solid rgba(63, 63, 70, 0.6);
    border-radius: 12px;
    background: rgba(39, 39, 42, 0.8);
    color: #fafafa;
    font-size: 16px;
    font-weight: 400;
    backdrop-filter: blur(5px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input::placeholder {
    color: #a1a1aa;
}

input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 
        0 0 0 3px rgba(139, 92, 246, 0.1),
        0 4px 14px rgba(139, 92, 246, 0.15);
    background: rgba(39, 39, 42, 0.95);
}

button {
    width: 100%;
    padding: 16px 24px;
    margin: 12px 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fafafa;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 14px rgba(139, 92, 246, 0.25),
        0 0 0 1px rgba(139, 92, 246, 0.1);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(139, 92, 246, 0.4),
        0 0 0 1px rgba(139, 92, 246, 0.2);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(-1px);
}

.error-message {
    color: #f87171;
    text-align: center;
    margin: 12px 0;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    display: none; /* Hide by default */
}

.error-message.show {
    display: block; /* Show when error class is added */
}

.admin-link {
    text-align: center;
    margin-top: 24px;
}

.admin-link a {
    color: #a1a1aa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.admin-link a:hover {
    color: #8b5cf6;
}

.server-item {
    background: rgba(39, 39, 42, 0.6);
    border: 1px solid rgba(63, 63, 70, 0.4);
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.server-item:hover {
    background: rgba(39, 39, 42, 0.8);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.server-item h3 {
    margin: 0;
    color: #fafafa;
    font-size: 1.25rem;
    font-weight: 600;
}

.server-item .status {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-item .status.stopped {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.server-item .manage-btn {
    width: auto !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    font-size: 14px !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25) !important;
    border-radius: 8px !important;
}

.server-item .manage-btn:hover {
    background: linear-gradient(135deg, #5856eb 0%, #7c3aed 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

.server-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.server-actions button {
    margin: 0;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

#server-content {
    background: rgba(9, 9, 11, 0.8);
    border: 1px solid rgba(39, 39, 42, 0.8);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    backdrop-filter: blur(10px);
}

#server-content::-webkit-scrollbar {
    width: 8px;
}

#server-content::-webkit-scrollbar-track {
    background: rgba(39, 39, 42, 0.3);
    border-radius: 4px;
}

#server-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.6);
    border-radius: 4px;
}

#server-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.8);
}

#console-input {
    margin-bottom: 16px;
}

#console-output {
    background: rgba(9, 9, 11, 0.9);
    border: 1px solid rgba(39, 39, 42, 0.6);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    max-height: 300px;
    overflow-y: auto;
    color: #e4e4e7;
}

.user-list {
    margin: 24px 0;
}

.user-item {
    background: rgba(39, 39, 42, 0.6);
    border: 1px solid rgba(63, 63, 70, 0.4);
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-item:hover {
    background: rgba(39, 39, 42, 0.8);
    border-color: rgba(139, 92, 246, 0.3);
}

.user-info {
    flex: 1;
}

.user-info strong {
    display: block;
    color: #fafafa;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.user-info small {
    color: #a1a1aa;
    font-size: 0.875rem;
    line-height: 1.4;
}

.back-button, .logout-button {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    margin-top: 24px;
}

.back-button:hover, .logout-button:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.create-form {
    background: rgba(39, 39, 42, 0.4);
    border: 1px solid rgba(63, 63, 70, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
}

.create-form h3 {
    margin-bottom: 20px;
    color: #fafafa;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row input {
    margin: 0;
}

#admin-panel {
    display: none;
}

.user-welcome {
    text-align: center;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: #e4e4e7;
    font-weight: 500;
}

/* Checkbox Styles */
.checkbox-group {
    margin: 16px 0;
}

.checkbox-group label {
    font-size: 1rem;
    font-weight: 600;
    color: #f4f4f5;
    margin-bottom: 12px;
    display: block;
}

.checkbox-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding: 16px;
    background: rgba(39, 39, 42, 0.3);
    border: 1px solid rgba(63, 63, 70, 0.4);
    border-radius: 12px;
}

.checkbox-container::-webkit-scrollbar {
    width: 6px;
}

.checkbox-container::-webkit-scrollbar-track {
    background: rgba(39, 39, 42, 0.3);
    border-radius: 3px;
}

.checkbox-container::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.6);
    border-radius: 3px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.checkbox-item:hover {
    background: rgba(63, 63, 70, 0.3);
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    height: 18px;
    margin: 0 12px 0 0;
    padding: 0;
    appearance: none;
    background: rgba(39, 39, 42, 0.8);
    border: 2px solid rgba(139, 92, 246, 0.6);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-item input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.checkbox-item span {
    font-size: 14px;
    color: #e4e4e7;
    font-weight: 500;
    user-select: none;
}

.select-all-container {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
}

.select-all-container .checkbox-item {
    padding: 0;
}

.select-all-container .checkbox-item span {
    font-weight: 600;
    color: #8b5cf6;
}

.loading {
    text-align: center;
    color: #a1a1aa;
    font-style: italic;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #login-container, #servers-container, #server-container, #admin-login-container, #admin-panel {
        min-width: 320px;
        margin: 20px;
        padding: 32px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .server-actions {
        grid-template-columns: 1fr;
    }
    
    .checkbox-container {
        grid-template-columns: 1fr;
    }
    
    h2 {
        font-size: 1.875rem;
    }
}

@media (max-width: 480px) {
    #login-container, #servers-container, #server-container, #admin-login-container, #admin-panel {
        padding: 24px;
        margin: 10px;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }
}

/* Custom scrollbar for webkit browsers */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.6) rgba(39, 39, 42, 0.3);
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.server-item, .user-item, .create-form {
    animation: fadeIn 0.3s ease-out;
}

/* Focus styles for accessibility */
button:focus-visible, input:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}