/* Reset and base styles */
* {
    /* margin: 0;
    padding: 0; */
    /* box-sizing: border-box; */
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    min-height: 100vh;
}

/* .container {
    padding: 20px;
} */

/* Header and Navigation */
.header, .top-banner {
    background-color: #00a79d;
    color: white;
    padding: 10px 0;
}

.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 60px;
}

.logo {
    max-height: 40px;
    vertical-align: middle;
}

.banner-buttons {
    display: flex;
    gap: 10px;
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    cursor: pointer;
    font-size: 24px;
}

/* Buttons */
.btn, .cta-button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-weight: bold;
}

.btn-primary, .cta-button {
    background-color: #007bff;
    color: white;
}

.btn-outline-primary {
    background-color: rgb(136 201 197) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn:hover, .cta-button:hover {
    opacity: 0.9;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    /* padding: 10px; */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
}

/* Modals */
.modal-dialog.modal-xl {
    max-width: 90%;
    width: 90%;
    margin: 30px auto;
}

#posterPreview {
    width: 100%;
    height: 80vh;
    overflow: auto;
    background-color: #f8f9fa;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#posterPreview .poster {
    border: 2px solid #333;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transform-origin: top left;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Flash messages */
.flashes {
    list-style: none;
    padding: 0;
}

.flashes li {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.flashes .error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.flashes .success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Media queries for responsiveness */
@media (max-width: 768px) {

    .banner-buttons {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #00a79d;
        padding: 20px;
    }

    .banner-buttons.show {
        display: flex;
    }

    .hamburger-menu {
        display: block;
    }

    .btn, .cta-button {
        width: 100%;
        margin-bottom: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .pdf-image {
        width: 100%;
        height: auto;
        margin-bottom: 10px;
    }

    .top-banner {
        position: fixed; /* Keep it fixed on mobile */
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 10px;
        height: auto; /* Allow height to adjust based on content */
}

    .top-banner h1 {
        font-size: 1.5em;
        margin-bottom: 10px;
        width: 100%;
    }

    .top-banner p {
        margin-bottom: 10px;
        width: 100%;
    }

    /* Improved table responsiveness */
    .table-container {
        overflow-x: auto;
        width: 100%;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px;
    }

    /* Improved form responsiveness */
    .form-control {
        font-size: 16px; /* Prevents zooming on iOS */
    }

    /* Improved button spacing */
    .btn + .btn {
        margin-top: 10px;
    }
}

/* Additional responsive improvements */
@media (max-width: 480px) {
    h1, h2 {
        font-size: 1.5em;
    }

    h3, h4 {
        font-size: 1.2em;
    }

    /* Stacked layout for small screens */
    .table-container table,
    .table-container thead,
    .table-container tbody,
    .table-container th,
    .table-container td,
    .table-container tr {
        display: block;
    }

    .table-container thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-container tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }

    .table-container td {
        border: none;
        position: relative;
        padding-left: 50%;
    }

    .table-container td:before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }
}

/* PDF viewer styles */
#pdf-viewer {
    max-width: 100%;
    overflow-x: auto;
}

.pdf-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    .container {
        width: 100%;
        max-width: none;
    }
}

/*  INDEX PAGE PRICING SECTION */
.plan-radio, .billing-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.btn-outline-primary:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-outline-primary:focus,
.btn-outline-primary.focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}
.plan-radio:checked + .btn-outline-primary,
.billing-radio:checked + .btn-outline-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-selected {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-selected:after {
    content: " ✓";
}
.billing-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.billing-toggle label {
    margin: 0 10px;
}
.yearly-savings {
    display: none;
    color: #28a745;
    font-weight: bold;
}

/* Responsive improvements for locations and profile pages */
@media (max-width: 768px) {
    /* Locations page */
    .locations-list {
        display: flex;
        flex-direction: column;
    }

    .location-item {
        margin-bottom: 20px;
        padding: 15px;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .location-item h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }

    .location-details {
        display: flex;
        flex-direction: column;
    }

    .location-details > div {
        margin-bottom: 10px;
    }

    /* Profile page */
    .profile-container {
        padding: 15px;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .profile-header {
        text-align: center;
        margin-bottom: 20px;
    }

    .profile-header img {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        margin-bottom: 10px;
    }

    .profile-details {
        display: flex;
        flex-direction: column;
    }

    .profile-details > div {
        margin-bottom: 15px;
    }

    .profile-details label {
        font-weight: bold;
        margin-bottom: 5px;
        display: block;
    }

    .profile-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .profile-actions .btn {
        width: 100%;
    }

    #locationsTable th,
    #locationsTable td,
    #usersTable th,
    #usersTable td {
        white-space: normal; /* Allow text wrapping */
        word-wrap: break-word;
        padding: 0.75rem;
    }

    #locationsTable .btn,
    #usersTable .btn {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }

    #usersTable .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
        line-height: 1.5;
        border-radius: 0.2rem;
    }

    #locationsTable .btn:last-child,
    #usersTable .btn:last-child {
        margin-bottom: 0;
    }
}

/* Styles for handling mobile keyboard issues */
@media (max-width: 768px) {
    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .container {
        flex-grow: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .top-banner {
        position: static;
    }

    #signatureCanvas {
        max-height: 200px;
    }
}

/* Styles for session page */
.session-timer {
    color: #007bff;
    font-size: 1.2em;
    font-weight: bold;
}

.content-section {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-top: 0;
}

@media (min-width: 769px) {
    .content-section {
        margin-left: 20px;
    }
}

@media (max-width: 768px) {
    .content-section {
        margin-left: 0;
        width: 100%;
    }
}

/* New Styles for Locations Page */
.locations-container {
    padding: 20px;
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 1rem;
}

.session-key {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.key-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.key-active { background-color: #28a745; }
.key-today { background-color: #ffc107; }
.key-week { background-color: #9370db; }
.key-month { background-color: #007bff; }

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.location-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.2s ease-in-out;
}

.location-card:hover {
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.location-info h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.location-info .admin-info {
    font-size: 0.9rem;
    color: #6c757d;
}

.admin-info a {
    color: #007bff;
    text-decoration: none;
}

.admin-info a:hover {
    text-decoration: underline;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.view-btn { background-color: #17a2b8; }
.assign-btn { background-color: #007bff; }
.delete-btn { background-color: #dc3545; }

.action-btn:hover {
    opacity: 0.85;
}

.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    height: 25px;
    display: flex;
}

.progress-bar-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.progress-bar-active { background-color: #28a745; }
.progress-bar-today { background-color: #ffc107; color: #333; }
.progress-bar-week { background-color: #9370db; }
.progress-bar-month { background-color: #007bff; }

@media (min-width: 768px) {
    .locations-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Flash Message Styling */
#flash-messages {
    position: fixed;
    top: 56px; /* Adjust this value based on your header's height */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050; /* Ensures it's above the navbar (1030) */
    width: 100%;
    max-width: 800px; /* Optional: to prevent the alert from being too wide on large screens */
}

#flash-messages .alert {
    margin-bottom: 0;
    border-radius: 0;
}

/* Scan Page and Sign In Flow Styles */
.scan-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0 !important;
}

.scan-container .logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
}

.scan-container h1 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.scan-container .form-group {
    margin-bottom: 20px;
}

.scan-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.scan-container .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.scan-container #signatureCanvas {
    border: 1px solid #000;
    cursor: crosshair;
    touch-action: none;
    width: 100%;
    max-width: 400px;
    height: 200px;
    margin: 0 auto;
    display: block;
}

.scan-container .controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.pdf-viewer-container {
    position: relative;
    width: 100%;
    height: 60vh; /* Adjust as needed */
    border: 1px solid #ccc;
    overflow: hidden;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}


@media (max-width: 480px) {
    .scan-container h1 {
        font-size: 20px;
    }
    .scan-container .form-control {
        font-size: 14px;
    }
    .scan-container .btn {
        font-size: 14px;
        padding: 8px 16px;
    }
    .scan-container #signatureCanvas {
        height: 150px;
    }
    .scan-container {
        margin-top: 0 !important;
    }
}
