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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    background-color: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(to bottom, #2d2d44, #1a1a2e);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3d3d5c;
}

.header .title {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 1px 1px 2px #000;
}

.toolbar {
    display: flex;
    gap: 8px;
}

.toolbar button {
    background: linear-gradient(to bottom, #3d3d5c, #2d2d44);
    border: 1px solid #4d4d6d;
    color: #e0e0e0;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 11px;
    border-radius: 3px;
}

.toolbar button:hover {
    background: linear-gradient(to bottom, #4d4d6d, #3d3d5c);
}

.toolbar button:active {
    background: linear-gradient(to bottom, #2d2d44, #3d3d5c);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Panels */
.panel {
    background-color: #16213e;
    border: 1px solid #3d3d5c;
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: linear-gradient(to bottom, #2d2d44, #1f1f35);
    padding: 6px 10px;
    font-weight: bold;
    font-size: 11px;
    color: #a0a0c0;
    border-bottom: 1px solid #3d3d5c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-content {
    flex: 1;
    overflow: auto;
    background-color: #0f0f23;
}

/* Server List Panel */
.server-list-panel {
    width: 50%;
    min-width: 400px;
    resize: horizontal;
    overflow: hidden;
}

/* Right Side Panels */
.right-panels {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.server-info-panel {
    height: 180px;
}

.players-panel {
    flex: 1;
    min-height: 150px;
}

.cvars-panel {
    height: 200px;
    resize: vertical;
    overflow: hidden;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

thead {
    background: linear-gradient(to bottom, #2d2d44, #1f1f35);
    position: sticky;
    top: 0;
}

th {
    text-align: left;
    padding: 6px 8px;
    color: #a0a0c0;
    font-weight: bold;
    border-bottom: 1px solid #3d3d5c;
    border-right: 1px solid #2d2d44;
}

th:last-child {
    border-right: none;
}

td {
    padding: 4px 8px;
    border-bottom: 1px solid #1f1f35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

tbody tr:hover {
    background-color: #1f2f4f;
}

tbody tr.selected {
    background-color: #2a4a7a;
}

tbody tr.offline {
    color: #666;
}

tbody tr.offline td {
    color: #666;
}

/* Server Info Panel Content */
#server-info {
    padding: 10px;
}

.info-placeholder {
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 20px;
}

.server-info-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 4px 10px;
}

.server-info-grid .label {
    color: #888;
}

.server-info-grid .value {
    color: #e0e0e0;
}

/* RCON Panel */
.rcon-panel {
    height: 180px;
    resize: vertical;
    overflow: hidden;
}

.rcon-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rcon-controls > button {
    padding: 3px 10px;
    background: linear-gradient(to bottom, #3d3d5c, #2d2d44);
    border: 1px solid #4d4d6d;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 10px;
}

.rcon-controls > button:hover {
    background: linear-gradient(to bottom, #4d4d6d, #3d3d5c);
}

.rcon-controls > button.active {
    background: linear-gradient(to bottom, #4a6b4a, #2d442d);
    border-color: #5a8a5a;
    color: #90ee90;
}

.rcon-password-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcon-password-input label {
    font-weight: normal;
    color: #888;
}

.rcon-password-input input {
    width: 120px;
    padding: 3px 6px;
    background-color: #0f0f23;
    border: 1px solid #3d3d5c;
    color: #e0e0e0;
    font-size: 11px;
}

.rcon-password-input button {
    padding: 3px 10px;
    background: linear-gradient(to bottom, #3d3d5c, #2d2d44);
    border: 1px solid #4d4d6d;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 10px;
}

.rcon-output {
    height: calc(100% - 30px);
    overflow-y: auto;
    padding: 8px;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.rcon-input-area {
    display: flex;
    padding: 4px;
    background-color: #1a1a2e;
    border-top: 1px solid #3d3d5c;
}

.rcon-input-area input {
    flex: 1;
    padding: 6px 8px;
    background-color: #0f0f23;
    border: 1px solid #3d3d5c;
    color: #e0e0e0;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 11px;
}

.rcon-input-area input:focus {
    outline: none;
    border-color: #5d5d7d;
}

.rcon-input-area button {
    padding: 6px 16px;
    background: linear-gradient(to bottom, #3d3d5c, #2d2d44);
    border: 1px solid #4d4d6d;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 11px;
    margin-left: 4px;
}

.rcon-input-area button:hover {
    background: linear-gradient(to bottom, #4d4d6d, #3d3d5c);
}

/* Status Bar */
.status-bar {
    background: linear-gradient(to bottom, #2d2d44, #1a1a2e);
    padding: 4px 10px;
    font-size: 11px;
    color: #888;
    border-top: 1px solid #3d3d5c;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.status-bar .status-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.status-bar .status-center a {
    color: #666;
    text-decoration: none;
}

.status-bar .status-center a:hover {
    color: #888;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #1a1a2e;
    border: 1px solid #3d3d5c;
    border-radius: 4px;
    width: 400px;
    max-width: 90%;
}

.modal-header {
    background: linear-gradient(to bottom, #2d2d44, #1f1f35);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3d3d5c;
    font-weight: bold;
    color: #a0a0c0;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    color: #ff6b6b;
}

.modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #a0a0c0;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    background-color: #0f0f23;
    border: 1px solid #3d3d5c;
    color: #e0e0e0;
    font-size: 12px;
    border-radius: 3px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #5d5d7d;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #3d3d5c;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer button {
    padding: 8px 20px;
    background: linear-gradient(to bottom, #3d3d5c, #2d2d44);
    border: 1px solid #4d4d6d;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 12px;
    border-radius: 3px;
}

.modal-footer button:hover {
    background: linear-gradient(to bottom, #4d4d6d, #3d3d5c);
}

#btn-save-server {
    background: linear-gradient(to bottom, #4a7c59, #3a5c49);
    border-color: #5a8c69;
}

#btn-save-server:hover {
    background: linear-gradient(to bottom, #5a8c69, #4a7c59);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background-color: #1a1a2e;
    border: 1px solid #3d3d5c;
    border-radius: 3px;
    padding: 4px 0;
    z-index: 1001;
    min-width: 150px;
    display: none;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    padding: 6px 15px;
    cursor: pointer;
    font-size: 11px;
}

.context-menu-item:hover {
    background-color: #2a4a7a;
}

.context-menu-separator {
    height: 1px;
    background-color: #3d3d5c;
    margin: 4px 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0f0f23;
}

::-webkit-scrollbar-thumb {
    background: #3d3d5c;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4d4d6d;
}

/* Player colors */
.player-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* RCON output colors */
.rcon-error {
    color: #ff6b6b;
}

.rcon-success {
    color: #6bff6b;
}

.rcon-info {
    color: #6b9fff;
}

.rcon-log {
    color: #b0b0b0;
    font-style: italic;
}

/* Server status indicators */
.status-online {
    color: #4ade80;
}

.status-offline {
    color: #f87171;
}

.status-unknown {
    color: #fbbf24;
}

/* Delete button in server row */
.btn-delete-server {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
}

.btn-delete-server:hover {
    color: #ff6b6b;
}
