/* Global Dark Theme for Emtron License Server */
:root {
    /* Core colors - matching download-server */
    --bs-body-bg: #121212;
    --bs-body-bg-rgb: 18, 18, 18;
    --bs-tertiary-bg: #1c1c1c;
    --bs-tertiary-bg-rgb: 28, 28, 28;
    --bs-primary: #2f81eb;
    --bs-primary-rgb: 47, 129, 235;
}

body,
.navbar,
.accordion,
.list-group,
.footer {
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #121212 !important;
    color: #e0e0e0;
}

.container,
.container-fluid {
    background-color: #121212;
}

.card {
    background-color: #1c1c1c;
    border-color: #2f2f2f;
    color: #e0e0e0;
}

.form-control,
.form-select {
    background-color: #1a1a1a;
    border-color: #3a3a3a;
    color: #e0e0e0;
}

.form-control:focus,
.form-select:focus {
    background-color: #1a1a1a;
    border-color: #2f81eb;
    color: #e0e0e0;
}

.btn-primary {
    background-color: #2f81eb;
    border-color: #2f81eb;
}

.btn-primary:hover {
    background-color: #1e5fc9;
    border-color: #1e5fc9;
}

.navbar {
    background-color: #121212 !important;
    border-bottom: 1px solid #2f2f2f;
}

.nav-link {
    color: #b0b0b0 !important;
}

.nav-link:hover,
.nav-link.active {
    color: #2f81eb !important;
}

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

.text-muted {
    color: #8b8b8b !important;
}

.btn-secondary {
    background-color: #2f2f2f;
    border-color: #3f3f3f;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background-color: #3f3f3f;
    border-color: #4f4f4f;
}

.modal-content {
    background-color: #1c1c1c;
    border-color: #2f2f2f;
}

.modal-header {
    border-bottom-color: #2f2f2f;
}

.modal-footer {
    border-top-color: #2f2f2f;
}

.table {
    color: #e0e0e0;
    border-color: #2f2f2f;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #1a1a1a;
}

.table-striped tbody tr:hover {
    background-color: #2a2a2a;
}

.alert-danger {
    background-color: #3c1f1f;
    border-color: #8b0000;
    color: #ff6b6b;
}

.alert-success {
    background-color: #1f3c1f;
    border-color: #008b00;
    color: #6bff6b;
}

.alert-warning {
    background-color: #3c3c1f;
    border-color: #8b8b00;
    color: #ffff6b;
}

.alert-info {
    background-color: #1f3c3c;
    border-color: #008b8b;
    color: #6bffff;
}

/* Toast styling */
.toast {
    background-color: #1c1c1c;
    border-color: #2f2f2f;
    color: #e0e0e0;
}

.toast-header {
    background-color: #2a2a2a;
    border-bottom-color: #3f3f3f;
    color: #e0e0e0;
}

/* Badge styling */
.badge {
    background-color: #2f81eb;
}

/* Link styling */
a {
    color: #2f81eb;
    text-decoration: none;
}

a:hover {
    color: #1e5fc9;
    text-decoration: underline;
}

/* Admin page table styles */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table {
    margin-bottom: 0;
    font-size: 0.75rem;
    table-layout: fixed;
    width: 100%;
    background-color: #1c1c1c;
}

.table thead th {
    position: sticky;
    top: 0;
    background-color: #1c1c1c;
    z-index: 10;
    overflow-wrap: break-word;
    word-break: break-word;
}

.table td,
.table th {
    padding: 0.35rem 0.25rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.table td:last-child {
    width: 80px;
    text-align: center;
}

/* Admin page utility classes */
.card-dark {
    background-color: #1c1c1c !important;
    border-color: #2d2d2d !important;
}

.input-dark {
    background-color: #2d2d2d !important;
    border-color: #3d3d3d !important;
    color: #e0e0e0 !important;
}

.input-dark:focus {
    background-color: #2d2d2d !important;
    border-color: #2f81eb !important;
    color: #e0e0e0 !important;
}

.table-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.table-actions-center {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
}

.scrollable-container {
    max-height: 400px;
    overflow-y: auto;
}

.code-monospace {
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
}

/* Telemetry page styles */
.container-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

body.flex-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.card.telemetry-card {
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.form-control.monospace {
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.success-card {
    display: none;
    text-align: center;
    padding: 2rem;
}

.success-icon {
    font-size: 3rem;
    color: #2f81eb;
    margin-bottom: 1rem;
}

.qr-preview {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #252525;
    border-radius: 8px;
    text-align: center;
}

.qr-preview canvas {
    max-width: 100%;
    height: auto;
}

.footer {
    background-color: #1c1c1c;
    border-top: 1px solid #2d2d2d;
    padding: 1.5rem;
    text-align: center;
    color: #888;
    font-size: 0.875rem;
}

/* Print activation codes page styles */
@media print {
    body {
        background-color: #f5f5f5 !important;
        color: #1a1a2e !important;
    }

    .print-container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .code-card {
        page-break-inside: avoid;
    }
}

.print-header {
    text-align: center;
    margin-bottom: 30px;
}

.print-header h1 {
    color: #1a1a2e;
    margin-bottom: 10px;
    font-size: 28px;
}

.print-header p {
    color: #666;
    font-size: 14px;
}

.print-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-print {
    padding: 10px 20px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.btn-print:hover {
    background-color: #1d4ed8;
}

.btn-back {
    padding: 10px 20px;
    background-color: #e5e7eb;
    color: #1a1a2e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.btn-back:hover {
    background-color: #d1d5db;
}

.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.code-card {
    background: white;
    border: 2px dashed #999;
    border-radius: 8px;
    padding: 20px;
    page-break-inside: avoid;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.code-card canvas {
    margin: 10px 0;
    display: block;
}

.code-card-label {
    font-weight: bold;
    margin-top: 10px;
    font-size: 14px;
    color: #333;
}

.code-card-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

.empty-state {
    display: none;
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1a1a2e;
}

.qr-container {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

.text-left {
    text-align: left;
}

.text-muted-print {
    text-decoration: none;
    color: #666;
}

/* Dashboard nav item visibility */
.nav-item-hidden {
    display: none;
}

/* Print page QR container */
.qr-container {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

.empty-state {
    display: none;
}

.text-align-center {
    text-align: center;
}

/* Toast Notifications */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 350px;
}

.toast-notification {
    background-color: #dc3545;
    color: white;
    padding: 16px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    animation: slideInRight 0.3s ease-out;
    font-size: 15px;
    line-height: 1.4;
}

.toast-notification.success {
    background-color: #198754;
}

.toast-notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.toast-notification-close:hover {
    opacity: 0.8;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Password Validation Requirements */
.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.requirement-icon {
    display: inline-block;
    width: 1.2rem;
    text-align: center;
    font-weight: bold;
}

.requirement.met .requirement-icon {
    color: #28a745;
}

.requirement.met .requirement-text {
    color: #28a745;
    text-decoration: line-through;
}

.requirement.unmet .requirement-icon {
    color: #dc3545;
}