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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
    transition: background-color 0.5s ease;
}

.container, .admin-panel {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.admin-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

#qr-reader {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    max-height: 70vh;
    overflow: hidden;
    border: none !important;
    padding: 0 !important;
}

/* Ensure the video fits within the container */
#qr-reader video {
    width: 100% !important;
    height: auto !important;
    min-height: 300px;
    max-height: 60vh;
    object-fit: cover;
}

/* Make sure the HTML5 QR scanner UI elements are visible */
#qr-reader__scan_region {
    position: relative;
    max-height: 60vh;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Fix for iPhone white strips issue */
#qr-reader__dashboard_section_swaplink {
    display: none !important;
}

#qr-reader__dashboard_section_csr {
    margin: 0 !important;
    padding: 0 !important;
}

#qr-reader__dashboard_section_csr > div {
    margin: 0 !important;
    padding: 0 !important;
}

/* Target the specific elements causing the white strips */
#qr-reader__scan_region > div {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

/* Override any inline styles that might be causing the issue */
#qr-reader__scan_region img,
#qr-reader__scan_region canvas,
#qr-reader__scan_region video {
    width: 100% !important;
    height: auto !important;
    left: 0 !important;
    top: 0 !important;
    position: relative !important;
}

/* Fix for the container that holds the camera view */
#qr-reader__scan_region > div:first-child {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

#qr-reader__dashboard {
    padding: 10px;
    margin-top: 10px;
}

#process-button-container {
    margin-top: 15px;
    text-align: center;
}

#process-button {
    background-color: #27ae60;
}

#process-button:hover {
    background-color: #219653;
}

button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin: 20px auto;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.hidden {
    display: none !important;
}

.result-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    word-break: break-all;
}

.label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #7f8c8d;
}

.value {
    padding: 5px;
    display: block;
}

#params-container {
    margin-top: 20px;
}

.param-item {
    display: flex;
    padding: 8px;
    background-color: #f9f9f9;
    margin-bottom: 8px;
    border-radius: 4px;
}

.param-name {
    font-weight: bold;
    min-width: 100px;
    margin-right: 10px;
}

/* Summit selection styles - shared between main and admin pages */
#summit-selection-container, #admin-summit-selection {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

#summit-selection-container h2, #admin-summit-selection h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#summit-selection-container p, #admin-summit-selection p {
    margin-bottom: 15px;
}

#summit-select, #admin-summit-select, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

#summit-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

#selected-summit {
    font-weight: bold;
}

#change-summit {
    background-color: #6c757d;
    padding: 5px 10px;
    font-size: 14px;
    margin: 0;
    width: auto;
}

#change-summit:hover {
    background-color: #5a6268;
}

/* Success and error styles */
.success {
    background-color: #00cc00 !important;
    color: white !important;
}

.error {
    background-color: #ff3333 !important;
    color: white !important;
}

#result-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 36px;
    text-align: center;
    font-weight: bold;
}

/* Full screen success/error */
.fullscreen-result {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.fullscreen-result #result-message {
    font-size: 48px;
    margin-bottom: 50px;
}

.fullscreen-result button {
    font-size: 24px;
    padding: 15px 30px;
    max-width: 300px;
}

/* Loading spinner */
.spinner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.spinner-container.active {
    display: flex;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #ff9900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Admin-specific styles */
.stats-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stats-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.stats-value {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

.delete-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff3f3;
    border-radius: 8px;
    border: 1px solid #ffcccb;
}

.delete-title {
    font-size: 18px;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 15px;
}

.delete-warning {
    color: #dc3545;
    margin-bottom: 15px;
}

.delete-confirmation {
    margin-bottom: 15px;
}

.delete-confirmation input {
    padding: 8px;
    width: 100%;
    max-width: 200px;
    margin-top: 5px;
}

.delete-button {
    background-color: #dc3545;
}

.delete-button:hover {
    background-color: #c82333;
}

.delete-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.auth-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-input-container {
    position: relative;
    margin-bottom: 15px;
}

.auth-input {
    width: 100%;
    padding: 10px;
    padding-right: 40px; /* Make room for the icon button */
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    font-size: 18px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 10;
}

.password-toggle:hover {
    color: #495057;
}

.auth-button {
    width: 100%;
}

.return-button {
    background-color: #6c757d;
    margin-top: 30px;
}

.return-button:hover {
    background-color: #5a6268;
}

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

@media (max-width: 600px) {
    .container, .admin-panel {
        padding: 15px;
    }
    
    button {
        padding: 10px;
    }
}

/* Version text at the bottom */
.version-text {
    text-align: center;
    font-size: 10px;
    color: #999;
    width: 100%;
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 10;
    margin: 0;
    padding: 0;
}
