/* Admin button styles - add at the top for highest priority */
#adminButton {
    display: block !important;
    visibility: visible !important;
    background-color: var(--error-color) !important;
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 2px;
    opacity: 1 !important;
}

#adminButton a {
    color: white !important;
    font-weight: bold !important;
    text-decoration: none !important;
    opacity: 1 !important;
}

/* Reset default styles */
body {
    background-color: var(--background);
    color: var(--text-primary);
}

:root {
    --sidebar-width: 250px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 2px;
    padding: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.stat-card h3 {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.stat-card div {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-top: 0.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-badge.running {
    background: #e7f4e4;
    color: #2d862d;
}

.status-badge.stopped {
    background: #fee7e7;
    color: #d63939;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.server-actions {
    display: flex;
    gap: 0.5rem;
}

#bulkAction {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-right: 0.5rem;
}

.dashboard-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Base layout */
.dashboard-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1rem;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-links .active a {
    background: var(--primary-color);
}

.content {
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--background);
    position: relative;
    padding: 20px;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 2px;
    padding: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin-right: 1rem;
    border-radius: 8px;
}

.stat-info {
    flex: 1;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.server-list {
    background: var(--card-bg);
    border-radius: 2px;
    display: grid;
    gap: 1rem;
}

.server-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.server-item.running {
    border-left: 4px solid var(--success-color);
}

.server-item.stopped {
    border-left: 4px solid var(--warning-color);
}

.server-item.error {
    border-left: 4px solid var(--danger-color);
}

.server-actions {
    display: flex;
    gap: 0.5rem;
}

.server-stats {
    display: flex;
    gap: 1rem;
    color: var(--secondary-color);
}

.log-container {
    background: #1e1e1e;
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    height: 200px;
    overflow-y: auto;
    font-family: monospace;
}

#adminButton {
    display: block !important;
    visibility: visible !important;
    background-color: var(--error-color) !important;
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 2px;
    opacity: 1 !important;
}

#adminButton a {
    color: white !important;
    font-weight: bold;
}

#adminButton:hover {
    background-color: #f4511e;
}

#adminButton[style*="display: block"] {
    display: block !important;
}

/* Dashboard grid layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 8px;
    padding: 16px;
    width: 100%;
    height: calc(100vh - 60px); /* Adjust for header height */
    background: var(--background);
}

/* Grafana-style visualization cards */
.visualization-card {
    background: var(--card-bg);
    border-radius: 2px;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.visualization-card .header {
    padding: 8px 10px;
    background: var(--panel-header-bg);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Grafana-style stat panels */
.stat-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    padding: 16px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 2px;
    padding: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 500;
    color: var(--stat-value-color);
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--stat-label-color);
}

.stat-card .sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    opacity: 0.3;
}

/* Grafana-style buttons */
.btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    color: var(--text-primary);
    padding: 5px 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Grafana-style charts */
.chart-container {
    padding: 10px;
    height: 300px;
    flex: 1;
    min-height: 0;
}

/* Time range selector */
.time-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.time-controls select {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 13px;
}

/* Server list styling */
.server-list {
    background: var(--card-bg);
    border-radius: 2px;
}

.server-item {
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
}

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

/* Server metrics */
.server-metrics {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.server-metrics span {
    display: flex;
    align-items: center;
}

.server-metrics span::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-running { background-color: var(--success-color); }
.status-stopped { background-color: var(--error-color); }
.status-warning { background-color: var(--warning-color); }

/* Activity log */
.activity-log {
    background: var(--card-bg);
    border-radius: 4px;
    margin-top: 16px;
}

.log-container {
    height: 300px;
    overflow-y: auto;
    padding: 12px;
    font-family: monospace;
    font-size: 12px;
    background: var(--background);
    border-radius: 0 0 4px 4px;
}

/* New styles for added elements */
.server-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.server-filters input,
.server-filters select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.server-metrics {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.server-controls {
    display: flex;
    gap: 0.5rem;
}

.server-controls .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

.suspend-btn, .resume-btn {
    background-color: var(--warning-color);
}

.console-btn {
    background-color: var(--info-color);
}

.settings-btn {
    background-color: var(--secondary-color);
}

.refresh-btn {
    background-color: var(--success-color);
    margin-left: 0.5rem;
}

/* Grid layout */
.grid-stack-item {
    min-width: 300px;
}

.grid-stack-item-content {
    inset: 4px;
    background: var(--card-bg);
    border-radius: 3px;
    box-shadow: var(--shadow);
    overflow-y: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--panel-header-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 1;
}

.panel-controls {
    display: none;
    gap: 4px;
}

.dashboard-editing .panel-controls {
    display: flex;
}

.panel-edit, .panel-remove {
    padding: 2px 6px;
    font-size: 12px;
}

.panel-remove {
    color: var(--error-color);
}

.edit-dashboard-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    margin-right: 8px;
}

.edit-dashboard-btn.active {
    background: var(--warning-color);
}

/* Drag handle styling */
.grid-stack-item.ui-draggable-dragging {
    cursor: move;
}

.grid-stack > .grid-stack-item > .grid-stack-item-content {
    overflow-y: auto;
}

/* Content layout adjustments */
.content {
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    padding: 16px;
}

/* Grid stack item adjustments */
.grid-stack-item-content {
    overflow: hidden !important;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.grid-stack-item-content::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.grid-stack-item-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom scrollbar for main content */
.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: var(--background);
}

.content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Dropdown menu styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 160px;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: var(--text-primary);
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-item:focus {
    outline: none;
    background-color: var(--primary-color);
    color: white;
}
