/* ========================================
   Linia-GIS App - Unified CSS Styles
   ======================================== */

/* Base Layout & Typography */
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

/* ========================================
   Map Specific Styles
   ======================================== */
#map {
    height: 100%;
    width: 100%;
}

.spinContainer {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========================================
   Navigation & Header Styles
   ======================================== */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-text {
    display: flex;
    align-items: center;
}

/* Navigation separator */
.navbar-text.separator {
    color: #6c757d !important;
    opacity: 0.5;
}

/* ========================================
   Page Headers (Gradients)
   ======================================== */
.app-header {
    color: white;
    margin-bottom: 2rem;
    text-align: left;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.app-header .lead {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* NFC Manager Header */
.nfc-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, #00cec9 0%, #00b894 100%);
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* Map Header (if needed) */
.map-header {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    min-height: 60px;
}

/* Access Denied Header */
.error-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

/* ========================================
   Card Components
   ======================================== */
.app-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border-radius: 0.5rem;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Module Cards */
.module-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border-radius: 0.5rem;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Stats Cards */
.stats-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border-radius: 0.5rem;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stats-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 120px;
}

/* NFC Cards */
.nfc-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border-radius: 0.5rem;
}

.nfc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ========================================
   Button Components
   ======================================== */
.btn-app-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-app-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(45deg, #0056b3, #007bff);
    color: white;
}

.btn-app-secondary {
    background: linear-gradient(45deg, #6c757d, #495057);
    border: none;
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-app-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    background: linear-gradient(45deg, #495057, #6c757d);
    color: white;
}

.btn-app-danger {
    background: linear-gradient(45deg, #dc3545, #c82333);
    border: none;
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-app-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    background: linear-gradient(45deg, #c82333, #dc3545);
    color: white;
}

/* ========================================
   Login Page Styles
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    padding: 2rem 1rem;
}

.form-signin {
    width: 100%;
    max-width: 330px;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.form-signin h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #495057;
}

.form-signin .form-floating:focus-within {
    z-index: 2;
}

.form-signin input[type="email"] {
    margin-bottom: -1px;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.form-signin input[type="password"] {
    margin-bottom: 1rem;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.form-signin .btn {
    margin-top: 1rem;
}

/* ========================================
   Access Denied / Error Pages
   ======================================== */
.access-denied-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.access-denied-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.access-denied-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(-45deg);
    animation: shimmer 3s infinite;
}

.error-icon {
    font-size: 6rem;
    color: #ff6b6b;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    animation: bounce-error 2s infinite;
}

.error-title {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.error-subtitle {
    color: #7f8c8d;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.error-description {
    color: #34495e;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.error-description h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.error-description ul {
    font-size: 0.95rem;
    padding-left: 1.2rem;
}

.error-description li {
    margin-bottom: 0.4rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* ========================================
   NFC Reader Styles
   ======================================== */
.nfc-reader-layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-container {
    height: 70%;
    width: 100%;
    position: relative;
    border-bottom: 2px solid #dee2e6;
}

.tools-container {
    height: 30%;
    width: 100%;
    background-color: #f8f9fa;
    overflow-y: auto;
}

.tools-content {
    max-height: 100%;
    padding: 1rem;
}

.nfc-tools-panel .card {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Floating Action Button */
.floating-return-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.floating-return-btn .btn {
    border-radius: 50px;
    padding: 12px 20px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
    font-weight: 600;
    background: linear-gradient(45deg, #007bff, #0056b3);
    white-space: nowrap;
    overflow: hidden;
    max-width: 60px;
}

.floating-return-btn .btn .btn-text {
    opacity: 0;
    max-width: 0;
    transition: all 0.3s ease;
    margin-left: 0;
    display: inline-block;
}

.floating-return-btn .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.5);
    max-width: 200px;
    padding: 12px 24px;
}

.floating-return-btn .btn:hover .btn-text {
    opacity: 1;
    max-width: 150px;
    margin-left: 8px;
}

/* Current Location Marker */
.current-location-marker {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-location-marker i {
    filter: drop-shadow(0 0 3px rgba(0, 123, 255, 0.5));
    animation: pulse-location 2s infinite;
}

/* ========================================
   Offcanvas & Modal Styles
   ======================================== */
#rightCanvas.offcanvas {
    top: 56px;
    height: calc(100vh - 56px);
    background-color: transparent;
}

#rightCanvas .offcanvas-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.offcanvas {
    background-color: transparent !important;
}

.offcanvas-body {
    overflow-y: hidden;
    background-color: white;
}

.offcanvas-header .btn-close {
    background-color: white;
    opacity: 1;
}

.offcanvas-header .btn-close:focus {
    outline: none;
    box-shadow: none;
}

.offcanvas-bottom {
    border-top: none;
    transform: translateY(100%);
}

.modal-backdrop.fade.show {
    display: none;
}

/* ========================================
   Dropdown & Layer Styles
   ======================================== */
.dropdown-menu {
    white-space: nowrap;
}

#layerSwitch {
    min-width: 250px !important;
    padding-left: 10px;
}

.btnlayer {
    text-align: left;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 4px;
    margin-left: 5px;
    width: 245px;
    min-height: 35px;
    display: block;
    overflow: hidden;
}

.btnlayer_text {
    margin-left: 35px;
    display: block;
}

.btnlayer_separator {
    display: block;
    border-bottom: 2px solid;
    margin-left: 40px;
    width: 75px;
}

.btnlink {
    text-align: left;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 4px;
    margin-left: 5px;
    width: 245px;
    min-height: 35px;
    display: block;
    overflow: hidden;
}

.btnlink_text {
    margin-left: 35px;
    display: block;
}

.btnlink_separator {
    display: block;
    border-bottom: 2px solid;
    margin-left: 40px;
    width: 75px;
}

/* ========================================
   Utility Classes
   ======================================== */
.pointer {
    cursor: pointer;
    pointer-events: auto;
}

.topbtn {
    margin-top: 15px;
    width: 32px;
    height: 32px;
}

.toprightbtn {
    margin-top: 15px;
    margin-right: 15px;
}

.btLogOut {
    margin-top: 5px;
}

.icon-id {
    height: 35px;
    width: 35px;
}

.imgDoc {
    width: 100%;
}

.fade-in {
    animation: fadeIn 0.8s ease-in;
}

/* ========================================
   Leaflet Customizations
   ======================================== */
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
    position: absolute;
    pointer-events: none;
    border: 0px;
    background: transparent;
    content: "";
}

.leaflet-tooltip-right {
    margin-left: 5px;
}

.leaflet-tooltip {
    font-weight: bold;
    position: absolute;
    padding: 6px;
    background-color: transparent;
    border: 0px;
    border-radius: 0px;
    white-space: nowrap;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
    box-shadow: none;
}

/* ========================================
   Animations & Keyframes
   ======================================== */
@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(-45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(-45deg); }
}

@keyframes bounce-error {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

@keyframes bounce {
    0% { transform: translateY(0px); }
    50% { transform: translateY(5px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse-location {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated-icon {
    animation: bounce 1s infinite;
    -moz-animation: bounce 1s infinite;
    -webkit-animation: bounce 1s infinite;
}

/* ========================================
   Camera Modal Responsive Styles
   ======================================== */
/* Base camera modal styles */
#cameraModal .modal-dialog {
    margin: 0.5rem;
    max-height: 65vh; /* Zmniejszone dla wszystkich urządzeń */
    height: auto;
}

#cameraModal .modal-content {
    max-height: 65vh; /* Zmniejszone dla wszystkich urządzeń */
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#cameraModal .modal-header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

#cameraModal .modal-body {
    flex: 1;
    padding: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

#cameraModal #cameraVideo {
    width: 100%;
    height: auto;
    max-height: 35vh; /* Zmniejszone dla lepszego dostępu do przycisków */
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 1;
}

#cameraModal .modal-footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    border-top: 1px solid #dee2e6;
}

#cameraModal .modal-footer .btn {
    flex: 1;
    min-height: 44px;
}

/* Tablet and mobile adjustments */
@media (max-width: 768px) {
    #cameraModal .modal-dialog {
        margin: 0.25rem !important;
        max-height: 50vh !important; /* Zmniejszone o pasek adresu przeglądarki */
    }
    
    #cameraModal .modal-content {
        max-height: 50vh !important; /* Zmniejszone o pasek adresu przeglądarki */
    }
    
    #cameraModal .modal-header {
        padding: 0.5rem 0.75rem !important;
    }
    
    #cameraModal .modal-body {
        padding: 0.25rem !important;
    }
    
    #cameraModal #cameraVideo {
        max-height: 25vh !important; /* Zmniejszone o pasek adresu przeglądarki */
    }
    
    #cameraModal .modal-footer {
        padding: 0.5rem 0.75rem !important;
        gap: 0.5rem !important;
    }
}

/* Small mobile screens */
@media (max-width: 576px) {
    #cameraModal .modal-dialog {
        margin: 0.125rem !important;
        max-height: 45vh !important; /* Uwzględnia pasek adresu przeglądarki mobilnej */
    }
    
    #cameraModal .modal-content {
        max-height: 45vh !important; /* Uwzględnia pasek adresu przeglądarki mobilnej */
    }
    
    #cameraModal .modal-header {
        padding: 0.375rem 0.625rem !important;
    }
    
    #cameraModal .modal-body {
        padding: 0.125rem !important;
    }
    
    #cameraModal #cameraVideo {
        max-height: 22vh !important; /* Uwzględnia pasek adresu i przyciski */
        border-radius: 4px;
    }
    
    #cameraModal .modal-footer {
        padding: 0.375rem 0.625rem !important;
        gap: 0.375rem !important;
    }
    
    #cameraModal .modal-footer .btn {
        min-height: 48px !important;
        font-size: 0.9rem;
    }
}

/* Very short screens */
@media (max-height: 667px) {
    #cameraModal .modal-dialog {
        max-height: 40vh !important; /* Uwzględnia pasek adresu na krótkich ekranach */
        margin: 0.125rem !important;
    }
    
    #cameraModal .modal-content {
        max-height: 40vh !important; /* Uwzględnia pasek adresu na krótkich ekranach */
    }
    
    #cameraModal #cameraVideo {
        max-height: 20vh !important; /* Uwzględnia pasek adresu i przyciski */
    }
}

@media (max-height: 568px) {
    #cameraModal .modal-dialog {
        max-height: 35vh !important; /* Uwzględnia pasek adresu na najkrótszych ekranach */
        margin: 0.05rem !important;
    }
    
    #cameraModal .modal-content {
        max-height: 35vh !important; /* Uwzględnia pasek adresu na najkrótszych ekranach */
    }
    
    #cameraModal .modal-header {
        padding: 0.25rem 0.5rem !important;
    }
    
    #cameraModal .modal-body {
        padding: 0.125rem !important;
    }
    
    #cameraModal #cameraVideo {
        max-height: 15vh !important; /* Uwzględnia pasek adresu na najkrótszych ekranach */
    }
    
    #cameraModal .modal-footer {
        padding: 0.25rem 0.5rem !important;
    }
}

/* Landscape mobile phones */
@media (max-width: 896px) and (max-height: 414px) and (orientation: landscape) {
    #cameraModal .modal-dialog {
        max-height: 85vh !important; /* Zmniejszone dla krajobrazowego trybu */
        margin: 0.05rem !important;
    }
    
    #cameraModal .modal-content {
        max-height: 85vh !important; /* Zmniejszone dla krajobrazowego trybu */
    }
    
    #cameraModal #cameraVideo {
        max-height: 50vh !important; /* Zwiększone dla krajobrazowego trybu */
    }
    
    #cameraModal .modal-header,
    #cameraModal .modal-footer {
        padding: 0.25rem 0.5rem !important;
    }
}

/* Modern viewport units for mobile browsers (dynamic viewport) */
@supports (height: 100dvh) {
    /* Use dynamic viewport height on mobile to account for address bar */
    @media (max-width: 768px) {
        #cameraModal .modal-dialog {
            max-height: 50dvh !important;
        }
        
        #cameraModal .modal-content {
            max-height: 50dvh !important;
        }
        
        #cameraModal #cameraVideo {
            max-height: 25dvh !important;
        }
    }
    
    @media (max-width: 576px) {
        #cameraModal .modal-dialog {
            max-height: 45dvh !important;
        }
        
        #cameraModal .modal-content {
            max-height: 45dvh !important;
        }
        
        #cameraModal #cameraVideo {
            max-height: 22dvh !important;
        }
    }
}

/* Safe area insets for devices with notch (iPhone X+) */
@supports (padding: max(0px)) {
    @media (max-width: 576px) {
        #cameraModal .modal-dialog {
            max-height: calc(45vh - env(keyboard-inset-height, 0px)) !important;
            margin: max(0.125rem, env(safe-area-inset-top)) 0.125rem max(0.125rem, env(safe-area-inset-bottom)) 0.125rem !important;
        }
        
        #cameraModal .modal-content {
            max-height: calc(45vh - env(keyboard-inset-height, 0px)) !important;
        }
    }
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet Styles */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 2rem;
    }
    
    .app-card {
        margin-bottom: 1rem;
    }
    
    .access-denied-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .error-title {
        font-size: 2rem;
    }
    
    .error-icon {
        font-size: 4rem;
    }
    
    .error-description .row {
        margin-top: 1rem !important;
    }
    
    .error-description h6 {
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .error-description h6:first-of-type {
        margin-top: 0;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-app-primary,
    .btn-app-secondary,
    .btn-app-danger {
        width: 100%;
        max-width: 250px;
    }
    
    #rightCanvas.offcanvas {
        top: 64px;
        height: calc(100vh - 64px);
    }
    
    /* NFC Reader Mobile */
    .map-container {
        height: 70%;
    }
    
    .tools-container {
        height: 30%;
    }
    
    .floating-return-btn {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-return-btn .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .floating-return-btn .btn:hover {
        max-width: 160px;
        padding: 10px 20px;
    }
    
    .floating-return-btn .btn:hover .btn-text {
        max-width: 120px;
    }
}

/* Mobile Styles */
@media (max-width: 576px) {
    .app-header {
        margin-bottom: 1.5rem;
    }
    
    .app-header h1 {
        font-size: 1.75rem;
    }
    
    .form-signin {
        padding: 1.5rem;
    }
    
    /* Camera Modal Mobile */
    #cameraModal .modal-dialog {
        margin: 0.125rem !important;
        max-height: 99vh !important;
    }
    
    #cameraModal .modal-content {
        max-height: 99vh !important;
    }
    
    #cameraModal .modal-body {
        max-height: calc(99vh - 100px) !important;
    }
    
    #cameraModal #cameraVideo {
        max-height: calc(99vh - 120px) !important;
    }
}

/* Small Mobile Devices - Lower resolution */
@media (max-width: 480px) {
    /* NFC Reader Small Mobile */
    .map-container {
        height: 65%;
    }
    
    .tools-container {
        height: 35%;
    }
}

/* Large Screen Styles */
@media (min-width: 992px) {
    .container-lg {
        max-width: 1140px;
    }
}

/* Height-based responsive design */
@media only screen and (max-height: 900px) {
    .offcanvas-bottom {
        height: 60vh;
    }
    
    #modalContent {
        max-height: 560px;
        overflow-y: auto;
    }
}

@media only screen and (min-height: 901px) and (max-height: 1080px) {
    .offcanvas-bottom {
        height: 50vh;
    }
    
    #modalContent {
        max-height: 800px;
        overflow-y: auto;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .app-card {
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Print Styles */
@media print {
    .navbar,
    .floating-return-btn,
    .offcanvas,
    .modal {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .app-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    /* Tag Reader Mobile Optimization */
    .mobile-buttons,
    .action-buttons-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .mobile-buttons .btn,
    .action-buttons-container .btn {
        padding: 1rem !important;
        font-size: 1.1rem !important;
        min-height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .nfc-tools-panel .card {
        margin-bottom: 1rem;
    }
    
    /* Mobile Navigation Optimization */
    .navbar-collapse {
        border-top: 1px solid #dee2e6;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .navbar-nav {
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .navbar-text {
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
        border-bottom: 1px solid #f8f9fa;
        background-color: #f8f9fa;
    }
    
    .btn-outline-danger {
        margin: 0.5rem 1rem !important;
        width: calc(100% - 2rem);
    }
    
    /* Mobile Navigation Optimization - separator removed from code */
}

/* Tag Reader Desktop Optimization */
@media (min-width: 768px) {
    .mobile-buttons,
    .action-buttons-container {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }
    
    .mobile-buttons .btn,
    .action-buttons-container .btn {
        padding: 0.75rem !important;
        font-size: 1rem !important;
        min-height: 50px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Desktop Navigation */
    .navbar-collapse {
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem !important;
        border-bottom: none;
    }
    
    .navbar-text {
        padding: 0.5rem 1rem !important;
        margin: 0 0 0 0.5rem !important;
        border-bottom: none;
        background-color: transparent;
    }
    
    .btn-outline-danger {
        margin: 0 !important;
        width: auto;
    }
    
    /* Desktop Navigation - no separator system needed */
}

/* ========================================
   Button Text Consistency
   ======================================== */
/* Ensure scan button text has consistent size */
#scanButtonText {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

/* Ensure all btn-lg have consistent text size */
.btn-lg span {
    font-size: inherit;
    font-weight: inherit;
}

/* ========================================
   Tag Reader - QR Scanner Styles
   ======================================== */
.qr-target-box {
    width: 200px;
    height: 200px;
    border: 3px solid #ffc107;
    border-radius: 15px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    animation: qr-pulse 2s infinite;
}

@keyframes qr-pulse {
    0%, 100% { 
        border-color: #ffc107;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    }
    50% { 
        border-color: #ffca2c;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
    }
}

#qrReaderContainer {
    background: #000;
    min-height: 300px;
}

@media (max-height: 667px) {
    #qrVideo {
        max-height: 250px !important;
    }
    .qr-target-box {
        width: 150px;
        height: 150px;
    }
}

@media (max-height: 568px) {
    #qrVideo {
        max-height: 200px !important;
    }
    .qr-target-box {
        width: 120px;
        height: 120px;
    }
}

/* ========================================
   Tag Reader - Map Status Message (Top)
   ======================================== */
.map-status-message {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    min-width: 200px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: slideInFromTop 0.3s ease-out;
}

.map-status-message:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    transform: translateX(-50%) translateY(-3px);
    border-width: 3px;
}

.status-message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-message-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.status-message-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status message types */
.map-status-message.status-info {
    background: rgba(13, 202, 240, 0.9);
    border-color: #0dcaf0;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.map-status-message.status-info .status-message-icon:before {
    content: "ℹ️";
}

.map-status-message.status-success {
    background: rgba(25, 135, 84, 0.9);
    border-color: #198754;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.map-status-message.status-success .status-message-icon:before {
    content: "✅";
}

.map-status-message.status-warning {
    background: rgba(255, 193, 7, 0.9);
    border-color: #ffc107;
    color: #212529;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.map-status-message.status-warning .status-message-icon:before {
    content: "⚠️";
}

.map-status-message.status-danger {
    background: rgba(220, 53, 69, 0.9);
    border-color: #dc3545;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.map-status-message.status-danger .status-message-icon:before {
    content: "❌";
}

.map-status-message.status-primary {
    background: rgba(13, 110, 253, 0.9);
    border-color: #0d6efd;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.map-status-message.status-primary .status-message-icon:before {
    content: "🔍";
}

.map-status-message.status-scanning {
    background: rgba(108, 117, 125, 0.9);
    border-color: #6c757d;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.map-status-message.status-scanning .status-message-icon:before {
    content: "🔄";
}

.map-status-message.status-secondary {
    background: rgba(108, 117, 125, 0.9);
    border-color: #6c757d;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.map-status-message.status-secondary .status-message-icon:before {
    content: "ℹ️";
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Map modal header improvements */
#map-modal .modal-title {
    display: flex;
    align-items: center;
    font-weight: 600;
}

#map-modal .modal-title .text-muted {
    font-weight: 400;
    font-size: 0.9em;
    margin-left: 0.25rem;
}

#map-modal .modal-header .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
}

#map-modal .modal-header .text-muted.small {
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Mobile optimizations */
@media (max-width: 576px) {
    .map-status-message {
        left: 10px;
        right: 10px;
        transform: none;
        min-width: auto;
        max-width: calc(100% - 20px);
    }
    
    #map-modal .modal-header {
        flex-wrap: wrap;
    }
    
    #map-modal .modal-header .d-flex.align-items-center {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }
    
    .status-message-text {
        font-size: 0.85rem;
    }
}

/* ========================================
   Tag Reader - Map Scanner Status Overlay
   ======================================== */
.map-scanner-status {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 14px 0 14px; /* Remove bottom padding - buttons will add their own margin */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
    max-width: 384px; /* Increased from 320px (20% wider) */
    min-width: 240px; /* Increased from 200px (20% wider) */
    max-height: calc(100vh - 160px); /* Prevent overlay from going off-screen */
    font-size: 0.875rem;
    transition: all 0.3s ease;
    overflow-y: auto; /* Allow scrolling if content is too tall */
}

.scanner-data-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.data-sections {
    flex: 1;
}

.send-button-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 0 0 12px;
    min-width: 75px; /* Increased from 60px (25% wider) */
    gap: 8px;
}

.send-button-area .btn {
    border-radius: 8px;
    width: 60px; /* Increased from 48px (25% wider) */
    height: 60px; /* Increased from 48px (25% wider) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Send button specific height - 2x higher */
#mapSendBtn {
    height: 120px !important; /* Increased from 96px (25% wider) */
}

/* Send button specific styling - unified colors */
#mapSendBtn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    border-color: #28a745 !important;
    color: white !important;
}

#mapSendBtn:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

#mapSendBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

/* Cancel button specific styling - unified colors */
#mapCancelBtn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    border-color: #dc3545 !important;
    color: white !important;
}

#mapCancelBtn:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

#mapCancelBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

/* ========================================
   Tag Reader - Data Areas Styling
   ======================================== */
.nfc-data-area, .qr-data-area, .location-data-area, .note-data-area {
    padding: 6px 8px;
    margin: 4px 0;
    border-left: 3px solid #dee2e6;
    background-color: rgba(248, 249, 250, 0.5);
    font-size: 0.75rem;
    line-height: 1.3;
}

.nfc-data-area {
    border-left-color: #28a745;
}

.qr-data-area {
    border-left-color: #007bff;
}

.location-data-area {
    border-left-color: #ffc107;
}

.note-data-area {
    border-left-color: #fd7e14;
}

/* Note content styles */
.note-content {
    color: #212529;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.note-content span {
    word-wrap: break-word;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
}

/* Truncated note styling */
.note-content span[title]:not([title=""]) {
    cursor: help;
    border-bottom: 1px dotted #6c757d;
}

/* NFC Data specific styles */
.nfc-uid {
    font-family: monospace;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 2px;
}

.nfc-text {
    color: #212529;
    margin-bottom: 2px;
    word-wrap: break-word;
}

.nfc-details {
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
}

/* QR Data specific styles */
.qr-data-text {
    word-wrap: break-word;
    word-break: break-all;
    max-height: 60px;
    overflow-y: auto;
    color: #212529;
    font-family: monospace;
    margin-bottom: 2px;
}

.qr-data-type {
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
}

/* Location Data specific styles */
.location-coords {
    font-family: monospace;
    color: #212529;
    margin-bottom: 2px;
}

.location-accuracy {
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
}

/* ========================================
   Tag Reader - Status Indicators
   ======================================== */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6c757d;
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-top: 2px;
}

.status-indicator.ready {
    background: #6c757d;
    animation: pulse-ready 2s infinite;
}

.status-indicator.scanning {
    background: #007bff;
    animation: pulse-scanning 1s infinite;
}

.status-indicator.success {
    background: #28a745;
    animation: pulse-success 0.5s ease;
}

.status-indicator.error {
    background: #dc3545;
    animation: pulse-error 0.5s ease;
}

.status-info {
    flex-grow: 1;
    min-width: 0;
}

.status-text {
    color: #495057;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.2;
    margin: 0;
}

.status-details {
    color: #6c757d;
    font-size: 0.75rem;
    line-height: 1.3;
    margin-top: 2px;
    word-break: break-all;
    opacity: 0.9;
}

/* Status indicator animations */
@keyframes pulse-ready {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes pulse-scanning {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.2);
    }
}

@keyframes pulse-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes pulse-error {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* ========================================
   Tag Reader - Photo Management
   ======================================== */
.status-photo-area {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 6px 8px;
    margin: 4px 0;
    border-left: 3px solid #17a2b8;
    background-color: rgba(248, 249, 250, 0.5);
}

.photo-counter-inline {
    font-size: 0.7rem;
    margin-bottom: 4px;
}

.photo-thumbnails-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.photo-thumbnail {
    position: relative;
    display: inline-block;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.photo-thumbnail img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    display: block;
}

.photo-actions {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 0 6px 0 6px;
}

.photo-thumbnail:hover .photo-actions {
    opacity: 1;
}

.photo-actions .btn {
    padding: 2px 4px;
    font-size: 0.6rem;
    line-height: 1;
    border: none;
    background: transparent;
    color: white;
}

.photo-actions .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.photo-counter {
    margin-top: 4px;
    text-align: center;
}

.photo-counter small {
    font-size: 0.7rem;
}

/* ========================================
   Tag Reader - Button Consistency
   ======================================== */
.mobile-buttons .btn-lg,
.action-buttons-container .btn-lg {
    font-size: 1.125rem !important;
    padding: 0.75rem 1.25rem !important;
    line-height: 1.5 !important;
    min-height: 48px !important;
}

#startScan, #takePhoto, #scanQRCode, #getLocation {
    font-size: 1.125rem !important;
    padding: 0.75rem 1.25rem !important;
    line-height: 1.5 !important;
    min-height: 48px !important;
}

#startScan i, #takePhoto i, #scanQRCode i, #getLocation i {
    font-size: 1.125rem !important;
}

#scanButtonText {
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* ========================================
   Tag Reader - Mobile Responsiveness
   ======================================== */
@media (max-width: 768px) {
    .map-scanner-status {
        top: 5px;
        left: 5px;
        padding: 8px 12px;
        max-width: 336px; /* Increased from 280px (20% wider) */
        min-width: 216px; /* Increased from 180px (20% wider) */
    }
    
    .scanner-status-content {
        gap: 6px;
    }
    
    .status-text {
        font-size: 0.8rem;
    }
    
    .photo-thumbnail img {
        width: 55px;
        height: 40px;
    }
    
    .photo-actions {
        opacity: 1;
    }

    .qr-data-area {
        font-size: 0.8rem;
        padding: 6px;
    }

    .qr-data-text {
        max-height: 45px;
        font-size: 0.7rem;
    }

    .qr-data-content {
        margin-left: 15px;
    }

    .scanner-data-container {
        flex-direction: row;
        gap: 6px;
    }

    .send-button-area {
        align-self: flex-start;
        padding: 8px 0 0 8px;
        flex-direction: column;
        gap: 10px;
        min-width: 74px; /* 15% smaller than 87px (87 * 0.85 = 74) */
    }

    .send-button-area .btn {
        width: 59px !important; /* 15% smaller than 70px (70 * 0.85 = 59.5) */
        height: 59px !important; /* 15% smaller than 70px */
        font-size: 1.2rem !important;
        border-radius: 10px !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2) !important;
    }
    
    #mapSendBtn {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        border: 2px solid #ffffff !important;
        height: 119px !important; /* 15% smaller than 140px (140 * 0.85 = 119) - maintaining 2x height ratio */
    }
    
    #mapSendBtn:hover,
    #mapSendBtn:active {
        background: linear-gradient(135deg, #20c997 0%, #28a745 100%) !important;
        transform: scale(1.05) !important;
        box-shadow: 0 4px 16px rgba(40, 167, 69, 0.5) !important;
    }
    
    #mapCancelBtn {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
        border: 2px solid #ffffff !important;
    }
    
    #mapCancelBtn:hover,
    #mapCancelBtn:active {
        background: linear-gradient(135deg, #c82333 0%, #dc3545 100%) !important;
        transform: scale(1.05) !important;
        box-shadow: 0 4px 16px rgba(220, 53, 69, 0.5) !important;
    }
    
    .photo-actions .btn {
        padding: 2px 3px;
        font-size: 0.65rem;
    }

    .photo-thumbnails-container {
        gap: 4px;
    }
}

/* Hide scanner status when map is small */
@media (max-height: 400px) {
    .map-scanner-status {
        display: none !important;
    }
}

/* Large screens - double width for Scanner Status Overlay and narrower send buttons */
@media (min-width: 1200px) {
    .map-scanner-status {
        max-width: 768px !important; /* Double of 384px */
        min-width: 480px !important; /* Double of 240px */
    }
    
    .send-button-area {
        min-width: 64px !important; /* 15% narrower than 75px */
    }
    
    .send-button-area .btn {
        width: 51px !important; /* 15% narrower than 60px */
        height: 51px !important; /* 15% narrower than 60px */
    }
    
    #mapSendBtn {
        height: 102px !important; /* 15% narrower than 120px, maintaining 2x ratio */
    }
    
    /* Module selector always in one line on large screens */
    .module-selector-container {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
    }
    
    .module-dropdown {
        min-width: 200px !important;
        max-width: 300px !important;
    }
}

/* ========================================
   Tag Reader - Module Selector Styles
   ======================================== */
.module-selector-container {
    min-height: 44px !important;
    justify-content: flex-end !important;
}

.module-label {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #495057 !important;
    white-space: nowrap;
    margin-bottom: 0 !important;
}

.module-dropdown {
    font-size: 1rem !important;
    font-weight: 500 !important;
    padding: 0.625rem 0.875rem !important;
    min-height: 44px !important;
    min-width: 180px !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
    background-color: #ffffff !important;
    color: #495057 !important;
    line-height: 1.4 !important;
}

.module-dropdown:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25) !important;
    outline: none !important;
}

.module-dropdown option {
    font-size: 1rem !important;
    font-weight: 500 !important;
    padding: 0.5rem !important;
}

/* Mobile header row - everything in one line */
@media (max-width: 768px) {
    .mobile-header-row {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }
    
    .mobile-header-row .card-title {
        font-size: 1rem !important;
        white-space: nowrap !important;
        margin-right: 4px !important;
    }
}

/* Mobile adjustments for module selector - keep in one line */
@media (max-width: 768px) {
    .module-selector-container {
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        flex-shrink: 1 !important;
    }
    
    .module-label {
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    .module-dropdown {
        flex: 1 !important;
        max-width: 120px !important;
        font-size: 0.85rem !important;
        min-height: 36px !important;
        padding: 0.4rem 0.6rem !important;
    }
}

@media (max-width: 576px) {
    .mobile-header-row .card-title {
        font-size: 0.9rem !important;
    }
    
    .module-selector-container {
        gap: 4px !important;
        justify-content: flex-end !important;
    }
    
    .module-label {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
    }
    
    .module-dropdown {
        max-width: 100px !important;
        font-size: 0.75rem !important;
        min-height: 32px !important;
        padding: 0.3rem 0.5rem !important;
    }
}

/* ========================================
   Tag Reader - Action Buttons Layout
   ======================================== */
/* Desktop: 2x2 grid layout */
.action-buttons-container {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 0.75rem !important;
}

/* Scanner action buttons (below scanner-data-container) */
.scanner-action-buttons {
    margin: 8px 0 10px 0;
    padding: 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
}

.scanner-action-buttons .btn-sm {
    width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Note modal buttons layout - keep in one line on mobile */
#addNoteModal .modal-footer {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

#addNoteModal .modal-footer .btn {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
    #addNoteModal .modal-footer .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
    
    #addNoteModal .modal-footer .btn i {
        margin-right: 4px;
    }
}

/* Desktop grid positioning */
#startScan {
    grid-column: 1;
    grid-row: 1;
}

#scanQRCode {
    grid-column: 2;
    grid-row: 1;
}

#takePhoto {
    grid-column: 1;
    grid-row: 2;
}

#getLocation {
    grid-column: 2;
    grid-row: 2;
}

/* Mobile: single column list */
@media (max-width: 767px) {
    .action-buttons-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto auto !important;
        gap: 1rem !important;
    }
    
    /* Mobile order: NFC, QR, Photo, Location */
    #startScan {
        grid-column: 1;
        grid-row: 1;
        order: 1;
    }
    
    #scanQRCode {
        grid-column: 1;
        grid-row: 2;
        order: 2;
    }
    
    #takePhoto {
        grid-column: 1;
        grid-row: 3;
        order: 3;
    }
    
    #getLocation {
        grid-column: 1;
        grid-row: 4;
        order: 4;
    }
    
    .action-buttons-container .btn {
        padding: 1rem !important;
        font-size: 1.1rem !important;
        min-height: 60px !important;
    }
}

/* Very small mobile screens */
@media (max-width: 576px) {
    .action-buttons-container {
        gap: 1.25rem !important;
    }
    
    .action-buttons-container .btn {
        padding: 1.25rem !important;
        font-size: 1.2rem !important;
        min-height: 64px !important;
        font-weight: 600 !important;
    }
}

/* Extra small mobile screens - Enhanced button visibility */
@media (max-width: 480px) {
    .send-button-area {
        padding: 10px 0 0 10px !important;
        gap: 14px !important;
        min-width: 85px !important; /* 15% smaller than 100px (100 * 0.85 = 85) */
    }

    .send-button-area .btn {
        width: 68px !important; /* 15% smaller than 80px (80 * 0.85 = 68) */
        height: 68px !important; /* 15% smaller than 80px */
        font-size: 1.3rem !important;
        border-radius: 14px !important;
        border: 3px solid #ffffff !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    }

    /* Visual distinction for send button */
    #mapSendBtn {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        position: relative;
        height: 136px !important; /* 15% smaller than 160px (160 * 0.85 = 136) - maintaining 2x height ratio */
    }

    #mapSendBtn::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(45deg, #20c997, #28a745);
        border-radius: 18px;
        z-index: -1;
        opacity: 0.8;
    }

    /* Visual distinction for cancel button */
    #mapCancelBtn {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
        position: relative;
    }

    #mapCancelBtn::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(45deg, #c82333, #dc3545);
        border-radius: 18px;
        z-index: -1;
        opacity: 0.8;
    }

    /* Hover effects for touch devices */
    .send-button-area .btn:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }
}