@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* Base styles */
body, html {
    height: 100%;
    margin: 0;
    display: block !important; /* Override any flex display */
    font-family: 'Roboto', sans-serif;
    background-color: #121212;
    color: #fff;
    min-height: 100vh;
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

a {
    color: #96C9F4 !important;
}

#container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    gap: 2rem;
    padding: 1rem;
}

#video-container {
    width: 350px;
    height: 350px;
    margin: 20px 0;
    position: relative;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
    border: 5px solid rgba(136, 186, 228, 0.624);
}

#qr-video, #qr-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
}

#scan-results {
    flex: 1;
    position: relative;
    padding: 20px;
    max-width: 800px;
}

/* Mobile styles */
@media screen and (max-width: 767px) {
    #container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0.5rem;
    }

    #video-container {
        width: 100%;
        max-width: 500px;
        aspect-ratio: 1;
        height: auto;
        margin: 10px auto;
        z-index: 2;
    }

    #qr-video, #qr-canvas {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #scan-results {
        width: 100%;
        max-width: 100%;
        z-index: 1;
        padding-top: 10px;
    }
}

h2, h3 {
    font-weight: 700; /* Bolder font for headers */
    color: #4CAF50; /* Stylish green for headers */
}
h2 {
    text-align: center;
    padding: 10px 0; /* Add some padding to the header */
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background-color: #1e1e1e; /* Slightly lighter background for table */
}

th, td {
    border: 1px solid #333; /* Darker borders for table cells */
    text-align: left;
    padding: 8px;
}

th {
    background-color: #333; /* Even darker background for table headers */
}

/* Table styles */
.table {
    color: #fff;
}

#scans-table th {
    width: 1%; /* Set a small default width for all columns */
}

#scans-table th:nth-child(2) { /* Target the Status column (second column) */
  width: 30%; /* Set a larger width for the Status column */
}

.box-date{
    background: #1e1e1e;
    color: #868181;
    padding: 2px;
    border-radius: 5px;
    font-size: 8px;
    text-align: right;
    margin: 0;
}

.thDate{
    width: 200px;
}

.txt-label {
  font-style: italic;
  font-weight: bold;
  color: #939185;
}

/* Styling links to be more noticeable */
.status-ok {
    background-color: #417441; /* Pastel green */
}

.status-expired {
    background-color: #6f3c3c; /* Pastel red */
}

.box-scan-message{
    font-size: 11px;
}

.box-green{
  background-color: #DEF9C4;
  color: black;
  padding: 2px;
  border-radius: 5px;
}
.box-red{
  background-color: #f57f7f;
  color: black;
  padding: 2px;
  border-radius: 5px;
}

.txt-scan-info{
  font-size: 11px;
}

/* Modal styles */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

.modal-content {
    background-color: #121212;
    color: #fff;
    width: 100%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Alert type styles */
.modal-content.alert-success {
    border-color: rgba(25, 135, 84, 0.5);
}

.modal-content.alert-danger {
    border-color: rgba(220, 53, 69, 0.5);
}

.modal-content.alert-warning {
    border-color: rgba(255, 193, 7, 0.5);
}

.modal-content.alert-info {
    border-color: rgba(13, 202, 240, 0.5);
}

/* Alert headers */
.modal-header.bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.2) !important;
    border-bottom-color: rgba(25, 135, 84, 0.3);
}

.modal-header.bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.2) !important;
    border-bottom-color: rgba(220, 53, 69, 0.3);
}

.modal-header.bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.2) !important;
    border-bottom-color: rgba(255, 193, 7, 0.3);
}

.modal-header.bg-info-subtle {
    background-color: rgba(13, 202, 240, 0.2) !important;
    border-bottom-color: rgba(13, 202, 240, 0.3);
}

.modal-header, 
.modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Smaller modal footer */
.modal-footer {
  padding: 0.5rem 1rem;
}

.modal-footer small {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Sleeping indicator specific styles */
#sleeping-indicator {
    z-index: 1070 !important;
}

#sleeping-indicator .modal-dialog {
    margin: 0 auto;
}

/* Rainbow border animation */
@keyframes rainbow-border {
    0% { border-image-source: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet); }
    100% { border-image-source: linear-gradient(to right, violet, indigo, blue, green, yellow, orange, red); }
}

.loader {
    border: 16px solid #484848; /* Light grey */
    border-top: 16px solid #1486d3; /* Blue */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -60px 0 0 -60px; /* Offset by half the width/height to center the loader */
    z-index: 1000; /* Make sure the loader is above other elements */
    display: none; /* Hide loader by default */
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  

/* Class to add the blur effect */
.blur-effect {
    filter: blur(5px);
}

/* Optional: Dark background overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  z-index: 999; /* Just below the modal */
}

/* Table styles */
.hide{
    display: none;
    width: 0px;
}
.col-upgrade{
    display: none;
    width: 0px;
}
#scans-table td {
    vertical-align: middle;
}

#scans-table td:last-child {
    text-align: center;
    min-width: 50px; /* Ensure enough space for the button */
}

.options-button {
    margin: 0 auto;
    display: block;
}

/* Test controls for dev */
.test-controls {
    position: fixed;
    right: 20px;
    top: 20px;
    background: rgba(33, 37, 41, 0.9);
    padding: 15px;
    border-radius: 8px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.test-controls button {
    white-space: nowrap;
}

/* Row Animation */
@keyframes addRow  {
  0% {
    transform: scaleY(0);
  }
  100% {
    transform: scaleY(1);
  }
}

table tr.add-row-animation {
  animation: addRow .5s ease;
  transform-origin: top;
}


.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #FFF;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}
.spinner::after,
.spinner::before {
  content: '';  
  box-sizing: border-box;
  position: absolute;
  left: 0;
  top: 0;
  background: #41C9E2;
  width: 3px;
  height: 3px;
  transform: translate(150%, 150%);
  border-radius: 50%;
}
.spinner::before {
  left: auto;
  top: auto;
  right: 0;
  bottom: 0;
  transform: translate(-150%, -150%);
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
} 

#refresh-indicator{
  font-size: small; 
  color: #666;
}

/* Custom text-muted for dark mode */
.text-muted {
  color: #9ba6b2 !important;
}
