body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app, #admin-app {
    text-align: center;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    margin: 20px auto;
    transition: transform 0.3s ease;
}

#app:hover, #admin-app:hover {
    transform: translateY(-5px);
}

/* Floating container styling */
.floating-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2.5rem;
    background-color: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.floating-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #007bff, #6610f2);
}

.floating-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 123, 255, 0.2);
}

.container-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.container-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, #007bff, #6610f2);
}

.container-header h1 {
    color: #007bff;
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.container-header p {
    color: #6c757d;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Animation for fade in up effect */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

h1, h2, h3 {
    color: #333;
    margin-bottom: 20px;
}

form {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #007bff;
    outline: none;
}

button {
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

canvas {
    max-width: 100%;
    height: auto;
    margin-top: 20px;
}

/* Navigation styling */
.navbar {
    background-color: #007bff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: color 0.3s ease;
}

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

.nav-link.active {
    color: #ffffff !important;
    font-weight: bold;
}

/* Card styling */
.card {
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-weight: bold;
}

/* Event list styling */
.event-item {
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
}

.event-item:hover {
    background-color: #e9ecef;
}

.attendee-list {
    margin-top: 10px;
    padding-left: 20px;
}

.attendee-item {
    padding: 5px 10px;
    background-color: #ffffff;
    border-radius: 4px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attendee-item .badge {
    font-size: 0.75rem;
}

/* Button styling */
.btn-toggle {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 0;
    font-size: 0.875rem;
}

.btn-toggle:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Input group styling - fix for buttons and input fields alignment */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    height: auto;
    line-height: 1.5;
}

.input-group .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Ensure buttons in input groups have the same height as input fields */
.input-group-append .btn,
.input-group .btn {
    height: 100%;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
}

/* Fix for buttons that appear next to input fields but not in input groups */
button.btn + input.form-control,
input.form-control + button.btn {
    height: auto;
    min-height: 38px;
}

/* Specific fixes for management page URL input groups */
.input-group #join-url,
.input-group #management-url {
    height: 38px;
    line-height: 1.5;
}

.input-group .copy-join-url,
.input-group #copy-management-url {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix for search input groups */
#attendee-search,
#search-btn {
    height: 38px;
}

/* Fix for manual check-in/check-out forms */
#manual-check-in-form .form-control,
#manual-check-out-form .form-control,
#manual-check-in-form .btn,
#manual-check-out-form .btn {
    height: 38px;
}

/* Fix for event registration form */
#register-form .form-control,
#register-form .btn {
    height: 38px;
    line-height: 1.5;
}

/* Fix for event access forms */
#event-access-form .form-control,
#event-access-form .btn {
    height: 38px;
}

/* Fix for attendee modal forms */
#attendee-form .form-control,
#attendee-form .btn {
    height: 38px;
}

/* Fix for event creation form in index.html */
#createEventForm .input-group .form-control,
#createEventForm .input-group .input-group-text,
#createEventForm .input-group .btn {
    height: 38px;
    line-height: 1.5;
}

/* Fix for event creation form in admin.html */
#createEventForm .form-control,
#createEventForm .btn {
    height: 38px;
}

/* Fix for report generation form */
#generateReportForm .form-select,
#generateReportForm .btn {
    height: 38px;
}

/* General fixes for all forms and input groups */
.form-control,
.form-select,
.btn {
    min-height: 38px;
}

/* Ensure consistent button sizing in all contexts */
.btn-sm {
    height: 31px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-lg {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Fix for input groups with multiple buttons */
.input-group-text + .form-control + .btn,
.form-control + .input-group-append .btn {
    height: 38px;
}

/* Highlight effect for imported events */
.highlight-event {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

/* Mobile responsive adjustments for management page */
@media (max-width: 767px) {
    /* Make action buttons in tables smaller */
    .table .btn-sm {
        padding: 0.15rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Adjust button spacing */
    td .btn + .btn {
        margin-left: 2px;
    }
    
    /* Ensure buttons don't overflow their container */
    td {
        white-space: nowrap;
    }
    
    /* Make attendee filter buttons smaller */
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Specific styling for filter buttons */
    #filter-all, #filter-checked-in, #filter-not-checked-in, #filter-checked-out {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Scan QR Code Button in Session List */
.scan-qr-btn {
    margin-top: 10px;
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-qr-btn i {
    margin-right: 5px;
}

/* Session Scanner Container */
#session-scanner-container {
    min-height: 300px;
    position: relative;
}

#session-scanner-container video {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
}

/* Mobile responsive adjustments for containers */
@media (max-width: 767px) {
    /* Increase container width to use more screen space */
    #app, #admin-app, .floating-container {
        max-width: 95%;
        margin: 1rem auto;
        padding: 1.5rem;
    }
    
    /* Adjust container header spacing */
    .container-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    /* Reduce header font size */
    .container-header h1 {
        font-size: 2rem;
    }
    
    /* Make action buttons in tables smaller */
    .table .btn-sm {
        padding: 0.15rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Adjust button spacing */
    td .btn + .btn {
        margin-left: 2px;
    }
    
    /* Ensure buttons don't overflow their container */
    td {
        white-space: nowrap;
    }
    
    /* Make attendee filter buttons smaller */
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Specific styling for filter buttons */
    #filter-all, #filter-checked-in, #filter-not-checked-in, #filter-checked-out {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Make scan QR code button smaller on mobile */
    .scan-qr-btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* For very small screens */
@media (max-width: 575px) {
    /* Maximize container width */
    #app, #admin-app, .floating-container {
        max-width: 100%;
        margin: 0.5rem auto;
        padding: 1rem;
        border-radius: 1rem;
    }
    
    /* Further reduce button size */
    .table .btn-sm {
        padding: 0.1rem 0.3rem;
        font-size: 0.7rem;
    }
    
    /* Stack buttons if needed */
    td .btn {
        margin-bottom: 2px;
    }
    
    /* Hide button text, show only icons on very small screens */
    .table .btn-sm .bi {
        margin-right: 0;
    }
    
    /* Make attendee filter buttons even smaller for very small screens */
    .btn-group .btn {
        padding: 0.2rem 0.3rem;
        font-size: 0.7rem;
    }
    
    /* Specific styling for filter buttons on very small screens */
    #filter-all, #filter-checked-in, #filter-not-checked-in, #filter-checked-out {
        padding: 0.15rem 0.25rem;
        font-size: 0.65rem;
    }
}

/* Obfuscation System Styles */
.obfuscation-toggle {
    margin-left: 0.25rem;
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
    border: 1px solid #dee2e6;
    background-color: transparent;
    color: #6c757d;
    transition: all 0.2s ease;
}

.obfuscation-toggle:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.obfuscation-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

.obfuscation-toggle i {
    font-size: 0.8rem;
}

/* Revealed text styling */
.revealed {
    background-color: #fff3cd;
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    border: 1px solid #ffeaa7;
    transition: all 0.3s ease;
    animation: reveal-highlight 0.5s ease-out;
}

@keyframes reveal-highlight {
    0% {
        background-color: #d4edda;
        border-color: #c3e6cb;
    }
    100% {
        background-color: #fff3cd;
        border-color: #ffeaa7;
    }
}

/* Obfuscated text styling */
.obfuscated {
    color: #6c757d;
    font-family: monospace;
    letter-spacing: 0.05em;
}

/* Table cell adjustments for obfuscation buttons */
.table td {
    vertical-align: middle;
}

.table td .obfuscation-toggle {
    vertical-align: middle;
}

/* Mobile responsive adjustments for obfuscation */
@media (max-width: 767px) {
    .obfuscation-toggle {
        padding: 0.1rem 0.25rem;
        font-size: 0.7rem;
        margin-left: 0.15rem;
    }
    
    .obfuscation-toggle i {
        font-size: 0.7rem;
    }
    
    .revealed {
        padding: 0.05rem 0.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 575px) {
    .obfuscation-toggle {
        padding: 0.05rem 0.2rem;
        font-size: 0.65rem;
        margin-left: 0.1rem;
    }
    
    .obfuscation-toggle i {
        font-size: 0.65rem;
    }
}
