/* Supercharge Halftone Font */
@font-face {
    font-family: 'Supercharge Halftone';
    src: url('../fonts/SuperchargeHalftone.otf') format('opentype'),
         url('../fonts/SuperchargeHalftone.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #1a1d29;
    color: #e4e6eb;
    line-height: 1.6;
}

/* Layout with Sidebar */
.app-layout {
    min-height: 100vh;
    background-color: #1a1d29;
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: #252836;
    border-bottom: 1px solid #2d3142;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    padding-left: calc(260px + 2rem); /* Account for sidebar width */
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-brand {
    font-family: 'Supercharge Halftone', sans-serif;
    font-size: 2rem;
    color: #4a90e2;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar input {
    background-color: #1a1d29;
    border: 1px solid #2d3142;
    border-radius: 6px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    color: #e4e6eb;
    font-size: 0.9rem;
    width: 300px;
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-bar::before {
    content: '🔍';
    position: absolute;
    left: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-bar-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-bar-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #1a1d29;
    color: #e4e6eb;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.top-bar-icon:hover {
    background-color: #2d3142;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: #1a1d29;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.user-info:hover {
    background-color: #2d3142;
}

.user-info.active {
    background-color: #2d3142;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: #252836;
    border: 1px solid #2d3142;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    padding: 0.75rem 1rem;
    color: #e4e6eb;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
    border-bottom: 1px solid #2d3142;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background-color: #1a1d29;
}

.user-dropdown-item.logout {
    color: #e74c3c;
}

.user-dropdown-item.logout:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-email {
    font-size: 0.85rem;
    color: #e4e6eb;
    font-weight: 500;
}

.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notification-badge[data-count="0"]::after {
    display: none;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1d29 0%, #151821 100%);
    color: #e4e6eb;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 998; /* Below top-bar so top-bar can span full width */
    display: flex;
    flex-direction: column;
    border-right: 1px solid #2d3142;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #2d3142;
    display: none; /* Hide since we have top bar brand */
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a90e2;
    margin: 0;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-nav-section {
    margin-bottom: 1.5rem;
}

.sidebar-nav-section-title {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #7f8c8d;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: rgba(228, 230, 235, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-nav-item:hover {
    background-color: rgba(74, 144, 226, 0.1);
    color: #e4e6eb;
    border-left-color: rgba(74, 144, 226, 0.5);
}

/* Sidebar Server Items */
.sidebar-server-item {
    border-bottom: 1px solid rgba(45, 49, 66, 0.3);
}

.sidebar-server-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-server-header:hover {
    background-color: rgba(74, 144, 226, 0.1);
    border-left-color: rgba(74, 144, 226, 0.5);
}

.sidebar-server-name {
    flex: 1;
    color: rgba(228, 230, 235, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-server-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin: 0 0.5rem;
    font-weight: 600;
    text-transform: capitalize;
}

.sidebar-server-status.status-running {
    background-color: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.sidebar-server-status.status-stopped {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.sidebar-server-status.status-starting {
    background-color: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.sidebar-server-toggle {
    color: #7f8c8d;
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.sidebar-server-actions {
    padding: 0.5rem 1.25rem 0.75rem;
    background-color: rgba(26, 29, 41, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-action-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    text-align: center;
    border: none;
    background: transparent;
    color: #e4e6eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-action-btn:hover:not(:disabled):not(.btn-disabled) {
    background: rgba(74, 144, 226, 0.1);
    color: #4a90e2;
}

.sidebar-action-btn:disabled,
.sidebar-action-btn.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sidebar-action-btn.btn-delete:hover:not(:disabled) {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.sidebar-action-icon {
    font-size: 1rem;
    display: inline-block;
    width: 1.2rem;
    text-align: center;
}

.sidebar-nav-item.active {
    background-color: rgba(74, 144, 226, 0.15);
    color: #4a90e2;
    border-left-color: #4a90e2;
    font-weight: 500;
}

.sidebar-nav-item-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav-item-badge {
    margin-left: auto;
    background-color: #4a90e2;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
}


/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    background-color: #1a1d29;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Footer */
.main-footer {
    padding: 1.5rem 2rem;
    background-color: #1a1d29;
    border-top: 1px solid #2d3142;
    margin-left: 260px;
    width: calc(100% - 260px);
    margin-top: 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-copyright {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin: 0;
}

.footer-copyright a {
    color: #4a90e2;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-copyright a:hover {
    color: #357abd;
    text-decoration: underline;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2d3142;
}

.page-header h2 {
    font-size: 1.75rem;
    color: #e4e6eb;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #4a90e2;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-weight: 500;
    text-align: center;
    font-family: inherit;
}

a.btn {
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.btn:hover {
    background-color: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary {
    background-color: #4a90e2;
}

.btn-primary:hover {
    background-color: #357abd;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled,
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:disabled:hover,
.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-start {
    background-color: #27ae60;
}

.btn-start:hover {
    background-color: #229954;
}

.btn-stop {
    background-color: #e74c3c;
}

.btn-stop:hover {
    background-color: #c0392b;
}

.btn-more {
    background-color: #7f8c8d;
    color: #ffffff;
}

.btn-more:hover {
    background-color: #6c7a7b;
    box-shadow: 0 4px 12px rgba(127, 140, 141, 0.3);
}

.btn-restart {
    background-color: #f39c12;
}

.btn-restart:hover {
    background-color: #e67e22;
}

.btn-update {
    background-color: #3498db;
}

.btn-update:hover {
    background-color: #2980b9;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #1a1d29;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.login-brand {
    font-family: 'Supercharge Halftone', sans-serif;
    font-size: 4rem;
    color: #4a90e2;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

.login-box {
    background: #252836;
    padding: 3rem 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 2px solid #4a90e2;
    position: relative;
}

.login-title {
    color: #e4e6eb;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 0.5rem 0;
}

.login-subtitle {
    color: #7f8c8d;
    text-align: center;
    font-size: 0.95rem;
    margin: 0 0 2rem 0;
}

.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box .form-group label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.login-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #4a90e2;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #1a1d29;
    color: #e4e6eb;
    transition: all 0.2s;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.forgot-link {
    display: inline-block;
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #357abd;
    text-decoration: underline;
}

.login-info {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin: 1.5rem 0 0.5rem 0;
}

.learn-more-link {
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.learn-more-link:hover {
    color: #357abd;
    text-decoration: underline;
}

.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.create-account-link {
    color: #7f8c8d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.create-account-link:hover {
    color: #e4e6eb;
}

.back-link {
    color: #7f8c8d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: #e4e6eb;
}

.btn-next {
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
}

.btn-cancel {
    background-color: #2d3142;
    color: #e4e6eb;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-cancel:hover {
    background-color: #1a1d29;
}

/* Password Reset Modal */
.password-reset-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.password-reset-content {
    background: #252836;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 2px solid #4a90e2;
    max-width: 450px;
    width: 90%;
}

.password-reset-content h2 {
    color: #e4e6eb;
    font-size: 1.5rem;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

.password-reset-content p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.password-reset-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.login-note {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #7f8c8d;
}

/* Login Loading Overlay */
.login-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 29, 41, 0.85);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.login-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(74, 144, 226, 0.2);
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e4e6eb;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #2d3142;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #1a1d29;
    color: #e4e6eb;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #7f8c8d;
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.alert-error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border-color: rgba(39, 174, 96, 0.3);
}

/* Notification Toasts */
.notification-toast {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    word-wrap: break-word;
}

.notification-toast.alert-success {
    background-color: rgba(39, 174, 96, 0.95);
    color: #ffffff;
    border-color: rgba(39, 174, 96, 0.5);
}

.notification-toast.alert-error {
    background-color: rgba(231, 76, 60, 0.95);
    color: #ffffff;
    border-color: rgba(231, 76, 60, 0.5);
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #252836;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4a90e2;
}

.stat-card-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.stat-card-close:hover {
    background-color: #2d3142;
    color: #e4e6eb;
}

/* Server List */
.server-list {
    display: grid;
    gap: 1.5rem;
}

.server-card {
    background: #252836;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.server-card-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.server-card-header:hover {
    background-color: rgba(45, 49, 66, 0.3);
}

.expand-icon {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-left: 0.5rem;
    transition: transform 0.3s;
    display: inline-block;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.server-card-expanded {
    padding: 1.5rem;
    border-top: 1px solid #2d3142;
    background-color: #1a1d29;
}

.server-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.server-detail-section h4 {
    margin-bottom: 1rem;
    color: #e4e6eb;
    font-size: 1rem;
    font-weight: 600;
}

.interactions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.interaction-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #252836;
    border-radius: 6px;
    border-left: 3px solid #4a90e2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.interaction-item .interaction-action {
    font-weight: 500;
    color: #e4e6eb;
    text-transform: capitalize;
}

.interaction-item .interaction-time {
    font-size: 0.875rem;
    color: #7f8c8d;
}

.server-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    background: #252836;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #27ae60;
}

.stat-item .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    font-size: 0.875rem;
    color: #7f8c8d;
    font-weight: 500;
}

.stat-item .stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e4e6eb;
}

.stat-bar {
    width: 100%;
    height: 20px;
    background-color: #1a1d29;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.stat-bar-cpu {
    background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
}

.stat-bar-ram {
    background: linear-gradient(90deg, #27ae60 0%, #229954 100%);
}

.loading-text {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

@media (max-width: 768px) {
    .server-details-grid {
        grid-template-columns: 1fr;
    }
    
    .server-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.server-info h3,
.server-info h4 {
    margin-bottom: 0.5rem;
    color: #e4e6eb;
    font-weight: 600;
}

.server-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.server-name {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.server-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running {
    background-color: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.status-stopped {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.status-starting {
    background-color: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.status-stopping {
    background-color: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.status-error {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Oxide Badge */
.oxide-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.oxide-badge.oxide-enabled {
    background-color: #6f42c1;
    color: white;
}

.oxide-badge.oxide-disabled {
    background-color: rgba(111, 66, 193, 0.2);
    color: #9d7ae8;
    border: 1px solid rgba(111, 66, 193, 0.3);
}

/* Server Form */
.server-form {
    background: #252836;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
}

/* Console */
.console-container {
    background: #0f1117;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 1px solid #2d3142;
}

.console-output {
    height: 500px;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #d4d4d4;
    background-color: #0f1117;
}

.console-line {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.console-line.log-error {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

.console-line.log-warning {
    color: #ffa726;
    background-color: rgba(255, 167, 38, 0.1);
}

.console-line.log-rcon {
    color: #42a5f5;
    background-color: rgba(66, 165, 245, 0.1);
}

.console-line.error-message {
    color: #ff6b6b;
    font-weight: bold;
}

.console-input-container {
    border-top: 1px solid #2d3142;
    padding: 1rem;
    background-color: #1a1d29;
}

.console-input-container form {
    display: flex;
    gap: 0.5rem;
}

#console-input {
    flex: 1;
    padding: 0.75rem;
    background-color: #252836;
    color: #d4d4d4;
    border: 1px solid #2d3142;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

#console-input:focus {
    outline: none;
    border-color: #4a90e2;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: #252836;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 1px solid #2d3142;
}

.empty-state p {
    margin-bottom: 1rem;
    color: #7f8c8d;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .top-bar {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 0;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .server-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .server-actions {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 1rem;
    }
    
    .search-bar input {
        width: 200px;
    }
}

/* Update Modal Styles */
.update-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.update-modal-content {
    background: #252836;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #2d3142;
}

.update-modal-header {
    padding: 20px;
    border-bottom: 1px solid #2d3142;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-modal-header h3 {
    margin: 0;
    color: #e4e6eb;
}

.update-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 4px;
    transition: all 0.2s;
}

.update-modal-close:hover {
    color: #e4e6eb;
    background-color: #2d3142;
}

.update-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.update-status {
    margin-bottom: 20px;
}

.update-spinner {
    border: 3px solid #2d3142;
    border-top: 3px solid #4a90e2;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

.update-spinner.hidden {
    display: none;
}

.update-success-check {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(39, 174, 96, 0.2);
    border: 3px solid #27ae60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    vertical-align: middle;
}

.update-success-check::before {
    content: '✓';
    color: #27ae60;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.update-message {
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    font-weight: 500;
    color: #e4e6eb;
}

.update-status.error .update-message {
    color: #e74c3c;
}

.update-status.error .update-spinner {
    border-top-color: #e74c3c;
}

.update-log {
    background: #1a1d29;
    border: 1px solid #2d3142;
    border-radius: 6px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #d4d4d4;
}

.log-entry {
    margin-bottom: 5px;
    color: #7f8c8d;
}

.log-entry.log-error {
    color: #e74c3c;
    font-weight: bold;
}

.update-confirmation {
    margin-bottom: 20px;
}

.update-confirmation-message {
    color: #e4e6eb;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.update-confirmation-list {
    color: #d4d4d4;
    margin: 15px 0;
    padding-left: 25px;
    line-height: 1.8;
}

.update-confirmation-list li {
    margin-bottom: 8px;
}

.update-confirmation-warning {
    color: #f39c12;
    font-weight: 500;
    margin-top: 20px;
    padding: 12px;
    background-color: rgba(243, 156, 18, 0.1);
    border-left: 3px solid #f39c12;
    border-radius: 4px;
}

.update-modal-footer {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #2d3142;
    text-align: right;
}

.update-modal-footer .btn-primary {
    background-color: #27ae60;
    color: white;
    border: 1px solid #27ae60;
}

.update-modal-footer .btn-primary:hover {
    background-color: #229954;
    border-color: #229954;
}

/* Command Line Editor Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #252836;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #2d3142;
    overflow: hidden; /* Prevent content from overflowing modal */
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #2d3142;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #e4e6eb;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #7f8c8d;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: #e4e6eb;
    background-color: #2d3142;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* Allow flex item to shrink below content size */
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e4e6eb;
    font-weight: 500;
}

.modal-body textarea {
    width: 100%;
    padding: 0.75rem;
    background: #1a1d29;
    border: 1px solid #2d3142;
    border-radius: 6px;
    color: #e4e6eb;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 150px;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.modal-body small {
    display: block;
    margin-top: 0.5rem;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #2d3142;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.command-line-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.command-line-status.success {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.command-line-status.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* System Stats Section */
.system-stats-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.system-stats-section h3 {
    margin-bottom: 1.5rem;
    color: #e4e6eb;
}

.system-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.system-stat-card {
    background: #252836;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
}

.system-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.system-stat-header h4 {
    margin: 0;
    color: #e4e6eb;
    font-size: 1.1rem;
}

.system-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a90e2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 144, 226, 0.2);
    border-radius: 50%;
    border-top-color: #4a90e2;
    animation: spin 1s linear infinite;
}

.loading-spinner.hidden {
    display: none;
}

.stat-text {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.system-stat-info {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.system-stat-chart {
    height: 200px;
    position: relative;
}

.servers-preview-section {
    margin-top: 2rem;
    background: #252836;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
}

.servers-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2d3142;
}

.servers-preview-header h3 {
    margin: 0;
    color: #e4e6eb;
    font-size: 1.25rem;
    font-weight: 600;
}

.empty-servers-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #7f8c8d;
}

.empty-servers-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-servers-state p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #7f8c8d;
}

.dashboard-server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.dashboard-server-card {
    background: #1a1d29;
    border-radius: 8px;
    border: 1px solid #2d3142;
    padding: 1.25rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: #4a90e2;
}

.dashboard-server-card-header {
    margin-bottom: 0.5rem;
}

.dashboard-server-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.dashboard-server-title h4 {
    margin: 0;
    color: #e4e6eb;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.dashboard-server-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #252836;
    border-radius: 6px;
    border: 1px solid #2d3142;
}

.dashboard-server-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.detail-label {
    color: #7f8c8d;
    font-weight: 500;
}

.detail-value {
    color: #e4e6eb;
    font-weight: 500;
}

.dashboard-server-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #2d3142;
}

.dashboard-server-actions .btn {
    flex: 1;
}

@media (max-width: 768px) {
    .system-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .system-stat-chart {
        height: 150px;
    }
}

/* Server Settings Page */
.server-settings-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.server-settings-section {
    background: #252836;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
}

.server-settings-section h3 {
    color: #e4e6eb;
    font-size: 1.25rem;
    margin: 0 0 1.5rem 0;
    font-weight: 600;
}

.server-info-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.server-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #2d3142;
}

.server-info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #7f8c8d;
    font-weight: 500;
    min-width: 140px;
}

.info-value {
    color: #e4e6eb;
    margin-left: -0.25rem;
}

.server-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.server-settings-bottom {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.server-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.server-stats-vertical {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.server-stat-card {
    background: #1a1d29;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
}

.server-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.server-stat-header h4 {
    color: #e4e6eb;
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.server-stat-value {
    color: #4a90e2;
    font-size: 1.5rem;
    font-weight: 700;
}

.server-stat-info {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.server-stat-chart {
    height: 200px;
    position: relative;
}

/* Config Files Editor */
.config-files-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
}

.config-files-list h4 {
    color: #e4e6eb;
    font-size: 1rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.config-files-list-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-file-item {
    padding: 0.75rem;
    background: #1a1d29;
    border: 1px solid #2d3142;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: #e4e6eb;
    font-size: 0.9rem;
}

.config-file-item:hover {
    background: #252836;
    border-color: #4a90e2;
}

.config-file-item.active {
    background: #2d3142;
    border-color: #4a90e2;
    color: #4a90e2;
}

.config-file-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-file-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-file-editor-header h4 {
    color: #e4e6eb;
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.config-file-editor-actions {
    display: flex;
    gap: 0.5rem;
}

.config-file-editor-content {
    flex: 1;
}

.config-file-textarea {
    width: 100%;
    min-height: 400px;
    padding: 1rem;
    background: #1a1d29;
    border: 1px solid #2d3142;
    border-radius: 6px;
    color: #e4e6eb;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.config-file-textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.config-file-textarea:read-only {
    background: #1a1d29;
    cursor: not-allowed;
    opacity: 0.7;
}

/* CodeMirror styling */
.CodeMirror {
    height: auto;
    min-height: 400px;
    background: #1a1d29 !important;
    color: #e4e6eb;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.CodeMirror-scroll {
    min-height: 400px;
}

.CodeMirror-gutters {
    background: #252836 !important;
    border-right: 1px solid #2d3142;
}

.CodeMirror-linenumber {
    color: #7f8c8d;
}

.CodeMirror-cursor {
    border-left: 1px solid #e4e6eb;
}

.CodeMirror-focused {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.CodeMirror-readonly .CodeMirror-cursor {
    display: none;
}

.config-file-status {
    min-height: 1.5rem;
    font-size: 0.875rem;
}

.config-file-status.success {
    color: #27ae60;
}

.config-file-status.error {
    color: #e74c3c;
}

.config-file-status.info {
    color: #4a90e2;
}

@media (max-width: 768px) {
    .config-files-container {
        grid-template-columns: 1fr;
    }
    
    .server-settings-bottom {
        grid-template-columns: 1fr;
    }
    
    .server-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .server-stat-chart {
        height: 150px;
    }
    
    .server-controls-grid {
        grid-template-columns: 1fr;
    }
}

/* Widget Styles */
.widget {
    background: #252836;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
    position: relative;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e4e6eb;
}

.widget-close {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.widget-close:hover {
    background-color: #2d3142;
    color: #e4e6eb;
}

/* File Manager Styles */
.file-manager-container {
    background: #1a1d29;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.file-manager-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2d3142;
}

.file-manager-toolbar .btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.file-manager-path {
    margin-left: auto;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.file-manager-path span:last-child {
    color: #4a90e2;
    font-weight: 500;
}

.file-manager-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    min-height: 500px;
}

.file-manager-sidebar {
    background: #252836;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    max-height: 600px;
}

.file-manager-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-manager-item {
    padding: 10px;
    margin-bottom: 5px;
    background: #1a1d29;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-manager-item:hover {
    background: #2d3142;
}

.file-manager-item.active {
    background: #4a90e2;
    color: #fff;
}

.file-manager-item-icon {
    font-size: 1.2rem;
}

.file-manager-item-name {
    flex: 1;
    word-break: break-all;
}

.file-manager-item-size {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.file-manager-item.active .file-manager-item-size {
    color: rgba(255, 255, 255, 0.7);
}

.file-manager-editor {
    background: #252836;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.file-manager-editor-header {
    padding: 15px 20px;
    border-bottom: 1px solid #2d3142;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-manager-editor-header h4 {
    margin: 0;
    color: #e4e6eb;
    font-size: 1.1rem;
}

.file-manager-editor-actions {
    display: flex;
    gap: 10px;
}

.file-manager-editor-content {
    flex: 1;
    padding: 20px;
}

.file-manager-textarea {
    width: 100%;
    height: 500px;
    background: #1a1d29;
    color: #e4e6eb;
    border: 1px solid #2d3142;
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.file-manager-textarea:focus {
    outline: none;
    border-color: #4a90e2;
}

.file-manager-status {
    padding: 10px 20px;
    border-top: 1px solid #2d3142;
    min-height: 20px;
}

.file-manager-status.success {
    color: #2ecc71;
}

.file-manager-status.error {
    color: #e74c3c;
}

.file-manager-status.info {
    color: #3498db;
}

/* CodeMirror for file manager */
.file-manager-editor-content .CodeMirror {
    height: 500px;
    background: #1a1d29;
    color: #e4e6eb;
}

.file-manager-editor-content .CodeMirror-gutters {
    background: #252836;
    border-right: 1px solid #2d3142;
}

.file-manager-editor-content .CodeMirror-linenumber {
    color: #7f8c8d;
}

.file-manager-editor-content .CodeMirror-cursor {
    border-left: 2px solid #4a90e2;
}

.file-manager-editor-content .CodeMirror-focused {
    outline: none;
}

.file-manager-editor-content .CodeMirror-readonly .CodeMirror-cursor {
    display: none;
}

/* Server Seed Styles */


.server-hostname-control {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.server-hostname-input {
    width: 200px;
    padding: 8px 12px;
    background: #1a1d29;
    border: 1px solid #2d3142;
    border-radius: 4px;
    color: #e4e6eb;
    font-size: 0.9rem;
}

.server-hostname-input:focus {
    outline: none;
    border-color: #4a90e2;
}



.server-seed-control {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.server-seed-input {
    width: 200px;
    padding: 8px 12px;
    background: #1a1d29;
    border: 1px solid #2d3142;
    border-radius: 4px;
    color: #e4e6eb;
    font-size: 0.9rem;
}

.server-seed-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.server-seed-map-preview {
    padding: 10px;
    background: #1a1d29;
    border-radius: 4px;
    border: 1px solid #2d3142;
}

.server-seed-map-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Sub-Admin Management Styles */
.sub-admin-list {
    margin-top: 2rem;
}

.sub-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.sub-admin-card {
    background: #252836;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid #2d3142;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.sub-admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sub-admin-card-header {
    padding: 1.5rem;
}

.sub-admin-info h3 {
    margin-bottom: 0.75rem;
    color: #e4e6eb;
    font-weight: 600;
    font-size: 1.1rem;
}

.sub-admin-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.sub-admin-meta span {
    display: block;
}

.sub-admin-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid #2d3142;
    display: flex;
    gap: 0.5rem;
    background-color: rgba(26, 29, 41, 0.3);
}

#alert-container {
    margin-top: 1rem;
}

#alert-container .alert {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .sub-admin-grid {
        grid-template-columns: 1fr;
    }
    
    .sub-admin-actions {
        flex-direction: column;
    }
    
    .sub-admin-actions .btn {
        width: 100%;
    }
}

/* Permissions UI Styles */
.permissions-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: #1a1d29;
    border-radius: 6px;
    border: 1px solid #2d3142;
    max-height: 250px;
    overflow-y: auto;
}

.permission-item {
    display: flex;
    align-items: center;
}

.permission-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    width: 100%;
}

.permission-checkbox:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

.permission-checkbox-input {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.permission-label {
    color: #e4e6eb;
    font-size: 0.9rem;
    flex: 1;
}

.sub-admin-permissions {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #2d3142;
    background-color: rgba(26, 29, 41, 0.3);
}

.permissions-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #27ae60;
    color: #fff;
}

.permissions-badge.no-permissions {
    background: #7f8c8d;
}

.permissions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.permission-badge-item {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    background: rgba(74, 144, 226, 0.15);
    color: #4a90e2;
    border: 1px solid rgba(74, 144, 226, 0.3);
    word-break: break-word;
}

@media (max-width: 768px) {
    .permissions-container {
        grid-template-columns: 1fr;
    }
}
