:root {
    --bs-body-font-family: 'D-DIN', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #1a1a1a;
    color: #f0f0f0;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Page transition animations */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Apply slide animation to main content */
main {
    animation: slideInFromRight 0.3s ease-out;
}

/* Tab content transitions */
.tab-pane {
    animation: fadeIn 0.3s ease-out;
}

/* Modal slide animations */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translateY(100%);
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-title {
    font-weight: 600;
    color: #ffffff;
}

.card-text {
    color: rgba(255, 255, 255, 0.85);
}

.text-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* Button press effects */
.btn {
    transition: all 0.2s ease-out;
}

.btn:active {
    transform: scale(0.95);
}

/* Standardized header - 56px height */
.navbar, .page-header {
    background-color: #242424 !important;
    min-height: 56px;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff !important;
}

.navbar .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    padding: 0.5rem 0;
    min-width: 0;
    flex: 1;
}

.nav-link:hover {
    color: #5fa3ff;
}

.nav-link.active {
    color: #5fa3ff;
    font-weight: 600;
}

.nav-link i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.2rem;
}

/* More compact nav for 5 items */
.navbar.fixed-bottom .container-fluid {
    max-width: 100%;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
}

/* Device and Agent list item styling for better readability */
.device-item .device-name,
.agent-item .agent-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1.125rem;
}

.device-item .device-agent,
.agent-item .agent-ip {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

.device-item .device-agent i,
.agent-item .agent-ip i {
    opacity: 0.85;
}

/* Snapshot items */
.snapshot-item .snapshot-name {
    font-weight: 600;
    color: #ffffff;
}

.snapshot-item .snapshot-device {
    color: rgba(255, 255, 255, 0.75);
}

/* Restore items */
.restore-item .restore-name {
    font-weight: 600;
    color: #ffffff;
}

.restore-item .restore-details {
    color: rgba(255, 255, 255, 0.75);
}

/* Network items */
.network-item .network-name {
    font-weight: 600;
    color: #ffffff;
}

.network-item .network-details {
    color: rgba(255, 255, 255, 0.75);
}

.display-4 {
    font-weight: bold;
}

/* Setup options styling */
.setup-options {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.setup-options .btn {
    padding: 1rem;
    font-size: 1.1rem;
}

.setup-options .btn i {
    font-size: 1.2rem;
}

/* Navbar brand styling */
.navbar-brand {
    color: #ffffff;
    font-weight: bold;
}

/* Smooth scrolling for the entire app */
html {
    scroll-behavior: smooth;
}

/* List item animations - only on initial load */
.initial-load .agent-item, 
.initial-load .device-item, 
.initial-load .restore-item, 
.initial-load .network-item, 
.initial-load .alert-card {
    animation: slideInFromRight 0.3s ease-out;
    animation-fill-mode: both;
}

/* Stagger animations for list items */
.initial-load .agent-item:nth-child(1), 
.initial-load .device-item:nth-child(1), 
.initial-load .restore-item:nth-child(1), 
.initial-load .network-item:nth-child(1), 
.initial-load .alert-card:nth-child(1) {
    animation-delay: 0.05s;
}

.initial-load .agent-item:nth-child(2), 
.initial-load .device-item:nth-child(2), 
.initial-load .restore-item:nth-child(2), 
.initial-load .network-item:nth-child(2), 
.initial-load .alert-card:nth-child(2) {
    animation-delay: 0.1s;
}

.initial-load .agent-item:nth-child(3), 
.initial-load .device-item:nth-child(3), 
.initial-load .restore-item:nth-child(3), 
.initial-load .network-item:nth-child(3), 
.initial-load .alert-card:nth-child(3) {
    animation-delay: 0.15s;
}

.initial-load .agent-item:nth-child(4), 
.initial-load .device-item:nth-child(4), 
.initial-load .restore-item:nth-child(4), 
.initial-load .network-item:nth-child(4), 
.initial-load .alert-card:nth-child(4) {
    animation-delay: 0.2s;
}

.initial-load .agent-item:nth-child(5), 
.initial-load .device-item:nth-child(5), 
.initial-load .restore-item:nth-child(5), 
.initial-load .network-item:nth-child(5), 
.initial-load .alert-card:nth-child(5) {
    animation-delay: 0.25s;
}

/* Continue stagger for more items */
.initial-load .agent-item:nth-child(n+6), 
.initial-load .device-item:nth-child(n+6), 
.initial-load .restore-item:nth-child(n+6), 
.initial-load .network-item:nth-child(n+6), 
.initial-load .alert-card:nth-child(n+6) {
    animation-delay: 0.3s;
}

/* Spinner animation for loading states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Bottom navigation - no animation, stays static */
.navbar.fixed-bottom {
    min-height: 56px;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

/* Adjust bottom nav for iPhone notch */
.navbar.fixed-bottom .container-fluid {
    padding-bottom: 0;
    display: flex;
    align-items: flex-start;
}

.navbar.fixed-bottom .nav-link {
    padding: 0.25rem 0;
    padding-bottom: 0;
}

.navbar.fixed-bottom .nav-link i {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
}

.navbar.fixed-bottom .nav-link small {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Main content padding to accommodate fixed header and footer */
main, .main-content {
    padding-bottom: calc(70px + env(safe-area-inset-bottom)); /* 56px nav + 14px spacing + safe area */
}

/* Filter bar styling for pages with multiple filters */
.filter-bar {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.filter-bar .form-select {
    font-size: 0.875rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.filter-bar .form-select option {
    background-color: #2b2b2b;
    color: #ffffff;
}

/* Reusable Badge Components */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.status-badge.success {
    background-color: rgba(25, 135, 84, 0.2);
    color: #198754;
}

.status-badge.warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-badge.danger {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.status-badge.info {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
}

.status-badge.secondary {
    background-color: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* Role badges for users */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

.role-badge.owner {
    background-color: rgba(111, 66, 193, 0.2);
    color: #6f42c1;
}

.role-badge.admin {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
}

.role-badge.tech {
    background-color: rgba(13, 202, 240, 0.2);
    color: #0dcaf0;
}

.role-badge.readonly {
    background-color: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* Info cards for consistent styling */
.info-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease-out;
}

.info-card:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.info-card .card-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-card .card-value {
    color: #ffffff;
    font-size: 1rem;
    word-break: break-word;
}

/* Action buttons standardization */
.action-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease-out;
}

.action-button:active {
    transform: scale(0.95);
}

/* Client badge/tag styling */
.client-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    background-color: rgba(13, 110, 253, 0.25);
    color: #5fa3ff;
    border: 1px solid rgba(13, 110, 253, 0.4);
}

/* Offline indicator */
.offline-banner {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    background-color: rgba(255, 193, 7, 0.95);
    color: #000;
    padding: 0.5rem 1rem;
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
    text-align: center;
    z-index: 999;
    font-size: 0.875rem;
    font-weight: 500;
    display: none;
}

.offline-banner.show {
    display: block;
}

.offline-content {
    opacity: 0.7;
    position: relative;
}

.offline-content::after {
    content: " (cached)";
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Empty state styling */
.empty-state {
    color: rgba(255, 255, 255, 0.75);
}

/* General improvements for readability */
small {
    color: rgba(255, 255, 255, 0.75);
}

h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
}

/* Button text should be bright */
.btn {
    font-weight: 500;
}

/* Modal improvements */
.modal-title {
    font-weight: 600;
    color: #ffffff;
}

.modal-body {
    color: rgba(255, 255, 255, 0.9);
}

.form-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.form-control {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #5fa3ff;
    color: #ffffff;
}

.form-select {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 500;
}

.form-select:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #5fa3ff;
    color: #ffffff;
}

/* ============================================
   LIGHT MODE STYLES
   Nuanced, professional color scheme
   ============================================ */

[data-bs-theme="light"] body {
    background-color: #f5f7fa;
    color: #1f2937;
}

/* Headers and Navigation - Light Mode */
[data-bs-theme="light"] .navbar,
[data-bs-theme="light"] .page-header {
    background-color: #ffffff !important;
    border-bottom-color: #e5e7eb !important;
}

[data-bs-theme="light"] .navbar-brand,
[data-bs-theme="light"] .page-title {
    color: #1f2937 !important;
}

[data-bs-theme="light"] .navbar.fixed-bottom {
    background-color: #ffffff !important;
    border-top-color: #e5e7eb !important;
}

/* Navigation Links - Light Mode */
[data-bs-theme="light"] .nav-link {
    color: #6b7280;
}

[data-bs-theme="light"] .nav-link:hover {
    color: #3b82f6;
}

[data-bs-theme="light"] .nav-link.active {
    color: #3b82f6;
}

/* Cards - Light Mode */
[data-bs-theme="light"] .card {
    background-color: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

[data-bs-theme="light"] .card.bg-dark {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

[data-bs-theme="light"] .card-title {
    color: #1f2937;
}

[data-bs-theme="light"] .card-text {
    color: #6b7280;
}

/* Typography - Light Mode */
[data-bs-theme="light"] h1,
[data-bs-theme="light"] h2,
[data-bs-theme="light"] h3,
[data-bs-theme="light"] h4,
[data-bs-theme="light"] h5,
[data-bs-theme="light"] h6 {
    color: #1f2937;
}

[data-bs-theme="light"] .text-muted {
    color: #9ca3af !important;
}

[data-bs-theme="light"] small {
    color: #6b7280;
}

/* More Page Items - Light Mode */
[data-bs-theme="light"] .more-item {
    background-color: #ffffff;
    border-color: #e5e7eb;
}

[data-bs-theme="light"] .more-item:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

[data-bs-theme="light"] .more-item-icon {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

[data-bs-theme="light"] .more-item-title {
    color: #1f2937;
}

[data-bs-theme="light"] .more-item-description {
    color: #6b7280;
}

[data-bs-theme="light"] .more-item-arrow {
    color: #9ca3af;
}

[data-bs-theme="light"] .more-section-title {
    color: #6b7280;
}

/* Device/Agent List Items - Light Mode */
[data-bs-theme="light"] .device-item .device-name,
[data-bs-theme="light"] .agent-item .agent-name {
    color: #1f2937;
}

[data-bs-theme="light"] .device-item .device-agent,
[data-bs-theme="light"] .agent-item .agent-ip {
    color: #6b7280;
}

[data-bs-theme="light"] .snapshot-item .snapshot-name,
[data-bs-theme="light"] .restore-item .restore-name,
[data-bs-theme="light"] .network-item .network-name {
    color: #1f2937;
}

[data-bs-theme="light"] .snapshot-item .snapshot-device,
[data-bs-theme="light"] .restore-item .restore-details,
[data-bs-theme="light"] .network-item .network-details {
    color: #6b7280;
}

/* PWA Install Banner - Light Mode */
[data-bs-theme="light"] #pwaInstallBanner {
    background-color: #ffffff;
    border-top-color: #e5e7eb;
    color: #1f2937;
}

/* Info Cards - Light Mode */
[data-bs-theme="light"] .info-card {
    background-color: #ffffff;
    border-color: #e5e7eb;
}

[data-bs-theme="light"] .info-card:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

[data-bs-theme="light"] .info-card .card-label {
    color: #6b7280;
}

[data-bs-theme="light"] .info-card .card-value {
    color: #1f2937;
}

/* Forms - Light Mode */
[data-bs-theme="light"] .form-control {
    background-color: #ffffff;
    border-color: #d1d5db;
    color: #1f2937;
}

[data-bs-theme="light"] .form-control:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    color: #1f2937;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-bs-theme="light"] .form-select {
    background-color: #ffffff;
    border-color: #d1d5db;
    color: #1f2937;
}

[data-bs-theme="light"] .form-select:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    color: #1f2937;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-bs-theme="light"] .form-select option {
    background-color: #ffffff;
    color: #1f2937;
}

[data-bs-theme="light"] .form-label {
    color: #1f2937;
}

/* Filter Bar - Light Mode */
[data-bs-theme="light"] .filter-bar {
    background-color: #f9fafb;
    border-bottom-color: #e5e7eb;
}

[data-bs-theme="light"] .filter-bar .form-select {
    background-color: #ffffff;
    border-color: #d1d5db;
    color: #1f2937;
}

/* Client Badge - Light Mode */
[data-bs-theme="light"] .client-badge {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

/* Empty State - Light Mode */
[data-bs-theme="light"] .empty-state {
    color: #6b7280;
}

/* Modal - Light Mode */
[data-bs-theme="light"] .modal-title {
    color: #1f2937;
}

[data-bs-theme="light"] .modal-body {
    color: #1f2937;
}

/* Status Badges - Light Mode (maintaining visibility) */
[data-bs-theme="light"] .status-badge.success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #047857;
}

[data-bs-theme="light"] .status-badge.warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

[data-bs-theme="light"] .status-badge.danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

[data-bs-theme="light"] .status-badge.info {
    background-color: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

[data-bs-theme="light"] .status-badge.secondary {
    background-color: rgba(107, 114, 128, 0.15);
    color: #4b5563;
}

/* Role Badges - Light Mode */
[data-bs-theme="light"] .role-badge.owner {
    background-color: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
}

[data-bs-theme="light"] .role-badge.admin {
    background-color: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

[data-bs-theme="light"] .role-badge.tech {
    background-color: rgba(6, 182, 212, 0.15);
    color: #0891b2;
}

[data-bs-theme="light"] .role-badge.readonly {
    background-color: rgba(107, 114, 128, 0.15);
    color: #4b5563;
}

/* Buttons - Light Mode */
[data-bs-theme="light"] .btn-link {
    color: #3b82f6;
}

[data-bs-theme="light"] .btn-link:hover {
    color: #2563eb;
}

/* Offline Banner - Light Mode */
[data-bs-theme="light"] .offline-banner {
    background-color: rgba(251, 191, 36, 0.95);
}

/* Switch/Toggle - Light Mode */
[data-bs-theme="light"] .form-check-input {
    background-color: #d1d5db;
    border-color: #9ca3af;
}

[data-bs-theme="light"] .form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

[data-bs-theme="light"] .form-check-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
} 