/* Outages Last Resort - Main Stylesheet */

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

body {
    font-family: 'Roboto', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: #4C384D;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    width: 32px;
    height: 32px;
    margin-right: 15px;
    fill: #ED6B43;
}

.header h1 {
    font-weight: 400;
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-role {
    background: rgba(237, 107, 67, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(237, 107, 67, 0.2);
}

.logout-btn {
    background: #ED6B43;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.logout-btn:hover {
    background: #d85a36;
}

/* Login Page Styles */
.login-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 400px;
    max-width: 90vw;
}

.login-title {
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

.demo-accounts {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.demo-accounts h4 {
    margin-bottom: 10px;
    color: #333;
}

.demo-accounts ul {
    list-style: none;
    padding: 0;
}

.demo-accounts li {
    margin-bottom: 5px;
}

.version {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.page-title {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 30px;
    color: #333;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #ED6B43;
}

.form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.form-select:focus {
    outline: none;
    border-color: #ED6B43;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: #ED6B43;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;
}

.login-btn:hover {
    background: #d85a36;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.btn-primary {
    background: #ED6B43;
    color: white;
}

.btn-primary:hover {
    background: #d85a36;
}

.btn-secondary {
    background: #666;
    color: white;
}

.btn-secondary:hover {
    background: #555;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-refresh {
    background: #2196f3;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-refresh:hover {
    background: #1976d2;
}

.btn-restart {
    background: #ED6B43;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-restart:hover {
    background: #d85a36;
}

.btn-refresh-all {
    background: #4caf50;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
}

.btn-refresh-all:hover {
    background: #388e3c;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-cancel {
    background: #ccc;
    color: #333;
}

.btn-cancel:hover {
    background: #bbb;
}

.btn-confirm {
    background: #f44336;
    color: white;
}

.btn-confirm:hover {
    background: #d32f2f;
}

.btn-search {
    background: #ED6B43;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    height: fit-content;
}

.btn-search:hover {
    background: #d85a36;
}

.btn-clear {
    background: #666;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    height: fit-content;
    text-decoration: none;
}

.btn-clear:hover {
    background: #555;
}

/* Dashboard Styles */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-toggle {
    display: flex;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.view-toggle button {
    padding: 10px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.view-toggle button.active {
    background: #ED6B43;
    color: white;
}

.view-toggle button:hover:not(.active) {
    background: #f5f5f5;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.selected-count {
    font-size: 14px;
    color: #666;
}

/* Server Card Styles */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.server-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: box-shadow 0.3s;
    position: relative;
}

.server-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.server-card.selected {
    border: 2px solid #ED6B43;
}

.server-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.server-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 10px;
}

.server-name-container {
    display: flex;
    align-items: center;
    flex: 1;
}

.server-name {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 10px;
}

.status-running {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.status-stopped {
    background: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

.status-unknown {
    background: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

.server-details {
    margin-bottom: 20px;
}

.server-ip {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.server-service {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.server-actions {
    display: flex;
    gap: 10px;
}

/* List View Styles */
.servers-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.list-table {
    width: 100%;
    border-collapse: collapse;
}

.list-table th,
.list-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.list-table th {
    background: #f8f9fa;
    font-weight: 500;
    color: #333;
}

.list-table tr:hover {
    background: #f8f9fa;
}

.list-table tr.selected {
    background: rgba(237, 107, 67, 0.1);
}

.list-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Table Styles */
.servers-table-container, .users-table-container, .audit-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.servers-table, .users-table, .audit-table {
    width: 100%;
    border-collapse: collapse;
}

.servers-table th,
.servers-table td,
.users-table th,
.users-table td,
.audit-table th,
.audit-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.servers-table th,
.users-table th,
.audit-table th {
    background: #f8f9fa;
    font-weight: 500;
    color: #333;
}

.servers-table tr:hover,
.users-table tr:hover,
.audit-table tr:hover {
    background: #f8f9fa;
}

.actions-cell {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Role Badges */
.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

.role-admin {
    background: #ED6B43;
    color: white;
}

.role-operator {
    background: #2196f3;
    color: white;
}

.role-viewer {
    background: #4caf50;
    color: white;
}

.role-auditor {
    background: #ff9800;
    color: white;
}

/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
}

.permission-icon {
    font-size: 16px;
}

.permission-icon.enabled {
    color: #4caf50;
}

.permission-icon.disabled {
    color: #ccc;
}

/* Audit Trail Styles */
.search-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 15px;
    align-items: end;
}

.search-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.search-form .form-input {
    padding: 10px;
    font-size: 14px;
}

.timestamp {
    font-size: 13px;
    color: #666;
}

.action {
    font-weight: 500;
}

.action-login {
    color: #4caf50;
}

.action-logout {
    color: #ff9800;
}

.action-status {
    color: #2196f3;
}

.action-restart {
    color: #f44336;
}

.action-server {
    color: #9c27b0;
}

.action-user {
    color: #9c27b0;
}

.server-info {
    font-size: 13px;
    color: #666;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #333;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Action Bar */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Error and Loading States */
.error {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.no-results, .no-servers, .no-users {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-icon {
    font-size: 18px;
}

/* Dark Theme Styles */
.theme-dark {
    background: #121212;
    color: #e0e0e0;
}

.theme-dark .header {
    background: #1f1f1f;
    border-bottom: 1px solid #333;
}

.theme-dark .page-title {
    color: #e0e0e0;
}

.theme-dark .container {
    color: #e0e0e0;
}

/* Dark Theme Form Styles */
.theme-dark .form-label {
    color: #e0e0e0;
}

.theme-dark .form-input {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

.theme-dark .form-input:focus {
    border-color: #ED6B43;
    background: #333;
}

.theme-dark .form-select {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

.theme-dark .form-select:focus {
    border-color: #ED6B43;
}

/* Dark Theme Login Page */
.theme-dark .login-container {
    background: #1f1f1f;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

.theme-dark .login-title {
    color: #e0e0e0;
}

.theme-dark .demo-accounts {
    background: #2d2d2d;
    border: 1px solid #444;
}

.theme-dark .demo-accounts h4 {
    color: #e0e0e0;
}

.theme-dark .demo-accounts {
    color: #b0b0b0;
}

.theme-dark .version {
    color: #b0b0b0;
}

/* Dark Theme Cards and Tables */
.theme-dark .server-card {
    background: #1f1f1f;
    border: 1px solid #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-dark .server-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.theme-dark .server-name {
    color: #e0e0e0;
}

.theme-dark .server-ip,
.theme-dark .server-service {
    color: #b0b0b0;
}

.theme-dark .servers-list,
.theme-dark .servers-table-container,
.theme-dark .users-table-container,
.theme-dark .audit-table-container {
    background: #1f1f1f;
    border: 1px solid #333;
}

.theme-dark .list-table th,
.theme-dark .servers-table th,
.theme-dark .users-table th,
.theme-dark .audit-table th {
    background: #2d2d2d;
    color: #e0e0e0;
    border-bottom-color: #444;
}

.theme-dark .list-table td,
.theme-dark .servers-table td,
.theme-dark .users-table td,
.theme-dark .audit-table td {
    border-bottom-color: #333;
    color: #e0e0e0;
}

.theme-dark .list-table tr:hover,
.theme-dark .servers-table tr:hover,
.theme-dark .users-table tr:hover,
.theme-dark .audit-table tr:hover {
    background: #2d2d2d;
}

.theme-dark .list-table tr.selected {
    background: rgba(237, 107, 67, 0.2);
}

/* Dark Theme View Toggle */
.theme-dark .view-toggle {
    background: #1f1f1f;
    border: 1px solid #333;
}

.theme-dark .view-toggle button:hover:not(.active) {
    background: #2d2d2d;
}

/* Dark Theme Search Container */
.theme-dark .search-container {
    background: #1f1f1f;
    border: 1px solid #333;
}

/* Dark Theme Modals */
.theme-dark .modal-content {
    background: #1f1f1f;
    border: 1px solid #333;
    color: #e0e0e0;
}

.theme-dark .modal-header {
    color: #e0e0e0;
}

/* Dark Theme Permission Items */
.theme-dark .permission-item {
    background: #2d2d2d;
    border: 1px solid #444;
}

/* Dark Theme Text Colors */
.theme-dark .timestamp,
.theme-dark .server-info,
.theme-dark .selected-count {
    color: #b0b0b0;
}

/* Dark Theme Action Text Colors */
.theme-dark .action {
    color: #e0e0e0;
}

/* Dark Theme No Results */
.theme-dark .no-results,
.theme-dark .no-servers,
.theme-dark .no-users,
.theme-dark .loading {
    color: #b0b0b0;
}

/* Dark Theme Button Variants */
.theme-dark .btn-cancel {
    background: #555;
    color: #e0e0e0;
}

.theme-dark .btn-cancel:hover {
    background: #666;
}

.theme-dark .btn-clear {
    background: #555;
    color: #e0e0e0;
}

.theme-dark .btn-clear:hover {
    background: #666;
}

/* Dark Theme Scrollbars (Webkit) */
.theme-dark ::-webkit-scrollbar {
    width: 8px;
}

.theme-dark ::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.theme-dark ::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.theme-dark ::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Smooth transitions for theme changes */
body, .header, .server-card, .modal-content, .form-input, .form-select {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}