* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    min-height: 100vh;
    overflow: hidden;
}

.guidepage {
    text-align: center;
}

.guidepic1,
.guidepic2 {
    width: 18.75rem;
    height: 12.5rem;
}

.guidepic3 {
    width: 18.75rem;
    height: 21.875rem;
}

.guidepic4 {
    width: 25rem;
    height: 31.25rem;
}

.guidepic5 {
    width: 25rem;
    height: 6.25rem;
}

/* Page transitions */
.page {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.page.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========== LOGIN PAGE STYLES ========== */
.container {
    width: 100%;
    max-width: 25rem;
    background: linear-gradient(180deg, #2a2a2a 0%, #1e1e1e 100%);
    border-radius: 1.875rem;
    padding: 2.5rem 1.875rem;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.5);
    margin: 1.25rem;
}

.title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    color: #e0e0e0;
    margin-bottom: 2.5rem;
    letter-spacing: 0.125rem;
}

.login-form {
    margin-bottom: 1.875rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 0.9375rem;
    border: 0.0625rem solid #3a3a3a;
    border-radius: 0.625rem;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    background: #242424;
    border-color: #4a4a4a;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 2.8125rem;
}

.toggle-password {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0b0b0;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #e0e0e0;
}

.login-btn {
    width: 100%;
    padding: 0.9375rem;
    background: #00ff26;
    border: none;
    border-radius: 0.625rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0.25rem 0.9375rem rgba(0, 255, 64, 0.3);
}

.login-btn:hover {
    background: #00c70a;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.375rem 1.25rem rgba(0, 255, 64, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.qr-section {
    text-align: center;
    margin-bottom: 1.875rem;
}

.qr-text {
    font-size: 0.875rem;
    color: #b0b0b0;
    margin-bottom: 0.9375rem;
}

.qr-code {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1a1a;
    padding: 1.25rem;
    border-radius: 0.9375rem;
    border: 0.0625rem solid #3a3a3a;
    margin: 0 auto;
    width: fit-content;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qr-code:hover {
    background: #242424;
    border-color: #4a4a4a;
    transform: scale(1.05);
}

.guide-btn {
    width: 100%;
    padding: 0.9375rem;
    background: #3a3a3a;
    border: none;
    border-radius: 0.625rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
}

.guide-btn:hover {
    background: #4a4a4a;
    transform: translateY(-0.125rem);
}

.guide-btn:active {
    transform: translateY(0);
}

/* ========== QR SCANNER MODAL STYLES ========== */
.qr-scanner-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.qr-scanner-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-scanner-content {
    background-color: #2a2a2a;
    border-radius: 1.25rem;
    width: 90%;
    max-width: 31.25rem;
    padding: 1.875rem;
    position: relative;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.5);
}

.qr-scanner-content h2 {
    margin: 0 0 1.25rem 0;
    font-size: 1.5rem;
    color: #e0e0e0;
    text-align: center;
}

.qr-scanner-close,
.guide-close,
.activity-close {
    position: absolute;
    right: 0.9375rem;
    top: 0.9375rem;
    width: 1.875rem;
    height: 1.875rem;
    background: #3a3a3a;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #e0e0e0;
    z-index: 10;
    transition: all 0.3s ease;
}

.qr-scanner-close:hover,
.guide-close:hover,
.activity-close:hover {
    background: #4a4a4a;
    transform: scale(1.1);
}

#qrScannerContainer {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 25rem;
    margin: 0 auto 1.25rem;
    background: #1a1a1a;
    border-radius: 0.9375rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#qrVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.9375rem;
}

.qr-upload-section {
    text-align: center;
    margin-bottom: 1.25rem;
}

.qr-upload-section p {
    color: #b0b0b0;
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
}

.qr-upload-btn {
    padding: 0.75rem 1.875rem;
    background: #3a3a3a;
    border: none;
    border-radius: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
}

.qr-upload-btn:hover {
    background: #4a4a4a;
    transform: translateY(-0.125rem);
}

#qrScannerStatus {
    text-align: center;
    color: #b0b0b0;
    font-size: 0.875rem;
    padding: 0.625rem;
    background: #1a1a1a;
    border-radius: 0.625rem;
}

/* ========== GUIDE MODAL STYLES ========== */
.guide-modal,
.activity-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
}

.guide-modal.active,
.activity-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-content,
.activity-content {
    background-color: #2a2a2a;
    border-radius: 1.25rem;
    width: 90%;
    max-width: 31.25rem;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.5);
}

.activity-content {
    display: flex;
    flex-direction: column;
}

.guide-slides {
    overflow: hidden;
    position: relative;
}

.guide-slides-wrapper {
    display: flex;
    transition: transform 0.4s ease;
}

.guide-slide {
    min-width: 100%;
    padding: 2.5rem 1.875rem;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: calc(90vh - 6.25rem);
}

.guide-slide h2 {
    margin: 0 0 1.25rem 0;
    font-size: 1.5rem;
    color: #e0e0e0;
}

.guide-slide p {
    margin: 0 0 0.9375rem 0;
    line-height: 1.6;
    color: #b0b0b0;
    font-size: 0.9375rem;
}

.guide-image-placeholder {
    width: 100%;
    height: 12.5rem;
    background: linear-gradient(135deg, #00ff26 0%, #00c70a 100%);
    border-radius: 0.625rem;
    margin: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    text-align: center;
    padding: 1.25rem;
    box-sizing: border-box;
    font-weight: 500;
}

.guide-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9375rem;
    margin: 1.25rem 0;
}

.guide-info-item {
    display: flex;
    gap: 0.9375rem;
    align-items: flex-start;
}

.guide-icon-placeholder {
    width: 3.125rem;
    height: 3.125rem;
    background: linear-gradient(135deg, #00ff26 0%, #00c70a 100%);
    border-radius: 0.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.625rem;
    text-align: center;
    font-weight: 500;
}

.guide-info-text h4 {
    margin: 0 0 0.3125rem 0;
    font-size: 1rem;
    color: #e0e0e0;
}

.guide-info-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #888;
}

.guide-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.875rem;
    border-top: 0.0625rem solid #3a3a3a;
    background: #1e1e1e;
}

.guide-dots {
    display: flex;
    gap: 0.5rem;
}

.guide-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #4a4a4a;
    transition: all 0.3s ease;
}

.guide-dot.active {
    background: #00ff26;
    width: 1.5rem;
    border-radius: 0.25rem;
}

.guide-nav-buttons {
    display: flex;
    gap: 0.625rem;
}

.guide-btn-nav {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.guide-btn-prev {
    background: #3a3a3a;
    color: #e0e0e0;
}

.guide-btn-next,
.guide-btn-finish {
    background: #00d01f;
    color: #fff;
}

.guide-btn-nav:hover {
    opacity: 0.9;
    transform: translateY(-0.125rem);
}

.guide-btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* ========== ACTIVITY HISTORY MODAL STYLES ========== */
.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.875rem;
    border-bottom: 0.0625rem solid #3a3a3a;
    background: #1e1e1e;
    flex-shrink: 0;
}

.activity-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #e0e0e0;
}

.activity-list {
    overflow-y: auto;
    flex: 1;
    padding: 1.25rem;
}

.activity-item {
    background: #1e1e1e;
    border-left: 0.1875rem solid #00ff26;
    padding: 0.9375rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: #242424;
    transform: translateX(0.3125rem);
}

.activity-location {
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 0.5rem;
}

.activity-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #888;
}

.activity-time,
.activity-date,
.activity-battery {
    display: flex;
    align-items: center;
}

.activity-time::before {
    content: "🕐";
    margin-right: 0.25rem;
}

.activity-date::before {
    content: "📅";
    margin-right: 0.25rem;
}

.activity-battery {
    margin-left: auto;
}

.activity-battery::before {
    content: "🔋";
    margin-right: 0.25rem;
}

.activity-empty {
    text-align: center;
    color: #888;
    padding: 2.5rem 1.25rem;
    font-size: 1rem;
}

/* ========== MAP PAGE STYLES ========== */
#map-page.active {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 1.25rem;
}

.map-container {
    width: 100%;
    max-width: 26.25rem;
    height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    border-radius: 1.875rem;
    border: 0.1875rem solid #3a3a3a;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.6);
    overflow: hidden;
    position: relative;
}

.map-view {
    flex: 1;
    position: relative;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
}

.info-panel {
    background: #1e1e1e;
    padding: 0 1.25rem 1.25rem 1.25rem;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -0.3125rem 1.25rem rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9375rem;
    margin-bottom: 1.25rem;
}

.info-item {
    background: #2a2a2a;
    padding: 0.625rem 0.625rem 0.625rem 1.25rem;
    border-radius: 0.625rem;
}

.info-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.3125rem;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
    padding: 0 0 0 0.9375rem;
}

.status-active {
    color: rgb(255, 107, 107);
}

.history-btn {
    width: 100%;
    padding: 0.625rem;
    background: #2a2a2a;
    border: none;
    border-radius: 0.625rem;
    font-size: 1rem;
    font-weight: 500;
    color: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    transition: all 0.3s;
}

.history-btn:hover {
    background: #3a3a3a;
}

.bottom-nav {
    background: #1e1e1e;
    padding: 0.625rem;
    display: flex;
    justify-content: center;
    gap: 0.625rem;
    box-shadow: 0 -0.125rem 0.625rem rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.nav-btn {
    background: #2a2a2a;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 1.5625rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-btn.active {
    background: #4a9eff;
    color: #fff;
}

.nav-btn:hover {
    transform: translateY(-0.125rem);
    background: #3a3a3a;
}

.nav-btn.active:hover {
    background: #3d8de8;
}

#logoutBtn {
    background: #e63946;
    color: #fff;
}

#logoutBtn:hover {
    background: #d62839;
}

/* Activity History Loading Spinner */
.activity-spinner {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    border: 0.25rem solid #3a3a3a;
    border-top: 0.25rem solid #00ff26;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.activity-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    gap: 0.9375rem;
}

.activity-loading .activity-spinner {
    margin-bottom: 0.625rem;
}

.activity-loading-text {
    color: #b0b0b0;
    font-size: 1rem;
}

/* Language Switcher - Floating Buttons */
.language-switcher {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.lang-btn {
    padding: 0.625rem 0.875rem;
    border: 0.125rem solid #ddd;
    border-radius: 0.375rem;
    background: #fff;
    color: #333;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    min-width: 2.8125rem;
    text-align: center;
}

.lang-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
    transform: translateY(-0.125rem);
}

.lang-btn:active {
    transform: translateY(0);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .lang-btn {
        background: #2a2a2a;
        color: #fff;
        border-color: #555;
    }

    .lang-btn:hover {
        background: #3a3a3a;
        border-color: #777;
    }
}

/* Prevent Translation of Language Buttons */
.goog-te-banner-frame,
.goog-te-gadget {
    display: none !important;
}

.goog-te-combo {
    display: none !important;
}

.notranslate {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.info-label-with-icon {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #e0e0e0;
    margin-bottom: 0.3125rem;
    text-align: center;
}

.info-icon {
    width: 1rem;
    height: 1rem;
    display: block;
}

.guide-info-icon {
    width: 3.125rem;
    height: 3.125rem;
    flex-shrink: 0;
    object-fit: contain;
}

/* Password Modal Styles */
.password-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(0.25rem);
}

.password-modal-content {
    background: #2a2a2a;
    margin: 10% auto;
    padding: 0;
    border-radius: 0.75rem;
    max-width: 31.25rem;
    width: 90%;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.password-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 0.0625rem solid var(--border-color);
}

.password-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.password-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 1.875rem;
    height: 1.875rem;
    flex-shrink: 0;
}

.password-modal-close:hover {
    color: var(--text-primary);
}

.password-modal-body {
    padding: 1.25rem;
}

.password-modal-buttons {
    display: flex;
    gap: 0.625rem;
    margin-top: 1.25rem;
}

.password-modal-buttons .cancel-btn,
.password-modal-buttons .update-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.password-modal-buttons .cancel-btn {
    background: #1a1a1a;
    color: var(--text-primary);
}

.password-modal-buttons .update-btn {
    background: #00ff59;
    color: #1a1a1a;
}

.password-modal-buttons .cancel-btn:hover {
    opacity: 0.8;
}

.password-modal-buttons .update-btn:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(59, 130, 246, 0.4);
}

/* Device Name Section */
.device-name-section {
    background: #2a2a2a;
    padding: 0 0.1875rem 0 1.4375rem;
    margin: 0.625rem;
    border-radius: 1.25rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

.device-name-container {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.name-label {
    font-weight: 600;
    font-size: 1rem;
    color: #e0e0e0;
}

.device-name-value {
    flex: 1;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    background: var(--input-bg);
    border-radius: 0.5rem;
    transition: background 0.3s ease;
}

.device-name-value:hover {
    background: var(--input-focus);
}

.edit-name-btn {
    background: var(--primary-color);
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.edit-name-btn:hover {
    background: var(--primary-hover);
}

.edit-name-btn svg {
    color: white;
}

/* Name Edit Modal */
.name-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.name-modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.name-modal-content {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1rem;
    width: 90%;
    max-width: 28.125rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
}

.name-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 0.0625rem solid #e0e0e0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1rem 1rem 0 0;
}

.name-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #e0e0e0;
}

.name-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #666666;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: background 0.3s ease;
}

.name-modal-close:hover {
    background: #e0e0e0;
}

.name-modal-body {
    padding: 1.25rem;
    background: rgb(30, 30, 30);
}

.name-modal-body .input-group {
    margin-bottom: 1.25rem;
}

.name-modal-body .input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e0e0e0;
    font-weight: 500;
}

.name-modal-body .input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 0.125rem solid #e0e0e0;
    border-radius: 0.5rem;
    font-size: 1rem;
    background: #ffffff;
    color: #000000;
    box-sizing: border-box;
}

.name-modal-body .input-group input:focus {
    outline: none;
    border-color: #ff6b6b;
}

.name-modal-buttons {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
}

.cancel-btn,
.update-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #e63946;
    color: #e0e0e0;
}

.cancel-btn:hover {
    background: #cccccc;
}

.update-btn {
    background: #00ff26;
    color: rgb(30, 30, 30);
}

.update-btn:hover {
    background: #006f21;
}

.guide-image-center {
    text-align: center;
}

.guide-finish-hidden {
    display: none;
}

/* Custom Alert Modal */
.custom-alert-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.custom-alert-overlay.active {
    display: flex;
}

.custom-alert-box {
    background: #2a2a2a;
    border-radius: 1.25rem;
    padding: 2rem;
    max-width: 25rem;
    width: 90%;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.5);
    animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
    from {
        transform: translateY(-3.125rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-alert-message {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-align: center;
    word-wrap: break-word;
}

.custom-alert-btn {
    width: 100%;
    padding: 0.75rem;
    background: #00ff26;
    border: none;
    border-radius: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s;
}

.custom-alert-btn:hover {
    background: #00c70a;
    transform: translateY(-0.125rem);
}

.custom-alert-btn:active {
    transform: translateY(0);
}

/* Mobile Responsive for Custom Alert */
@media (max-width: 30rem) {
    .custom-alert-box {
        padding: 1.5rem;
        max-width: 90%;
        border-radius: 1rem;
    }

    .custom-alert-message {
        font-size: 0.875rem;
        margin-bottom: 1.25rem;
    }

    .custom-alert-btn {
        padding: 0.625rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 23.4375rem) {
    .custom-alert-box {
        padding: 1.25rem;
    }

    .custom-alert-message {
        font-size: 0.8125rem;
        margin-bottom: 1rem;
    }
}


/* ========== RESPONSIVE - TABLET ========== */
@media (max-width: 48rem) {
    .device-name-section {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }

    .name-label {
        font-size: 0.875rem;
    }

    .device-name-value {
        font-size: 0.875rem;
        padding: 0.375rem 0.625rem;
    }

    .edit-name-btn {
        padding: 0.375rem;
    }

    .edit-name-btn svg {
        width: 0.875rem;
        height: 0.875rem;
    }

    .name-modal-content {
        width: 95%;
        margin: 0.625rem;
    }

    .name-modal-header {
        padding: 0.9375rem;
    }

    .name-modal-header h2 {
        font-size: 1.125rem;
    }

    .name-modal-body {
        padding: 0.9375rem;
    }

    .cancel-btn,
    .save-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .language-switcher {
        top: 0.75rem;
        right: 0.75rem;
        left: auto;
        gap: 0.375rem;
    }

    .lang-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.6875rem;
        min-width: 2.5rem;
    }
}

/* ========== RESPONSIVE - MOBILE ========== */
@media (max-width: 30rem) {
    .guide-slide img[src="guidepic4.PNG"],
    .guide-slide img[src="guidepic5.PNG"] {
        max-width: 100%;
        height: auto;
        width: 100%;
    }

    .language-switcher {
        top: 0.75rem;
        right: 0.75rem;
        left: auto;
        gap: 0.375rem;
    }

    .lang-btn {
        padding: 0.4375rem 0.6875rem;
        font-size: 0.625rem;
        min-width: 2.375rem;
    }

    #map-page.active {
        background: #1e1e1e;
        padding: 0;
    }

    .map-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .info-grid {
        gap: 0.625rem;
    }

    .info-item {
        padding: 0.75rem;
    }

    .info-label {
        font-size: 0.6875rem;
    }

    .info-value {
        font-size: 0.875rem;
    }

    .bottom-nav {
        padding: 0.625rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
        padding-bottom: max(3.625rem, env(safe-area-inset-bottom));
    }

    .qr-scanner-content {
        width: 95%;
        padding: 1.25rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .qr-scanner-content h2 {
        font-size: 1.25rem;
        margin-bottom: 0.9375rem;
    }

    #qrScannerContainer {
        width: 100%;
        max-width: 18.75rem;
        aspect-ratio: 1 / 1;
    }

    .qr-scanner-close {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1.125rem;
        right: 0.625rem;
        top: 0.625rem;
    }

    .qr-upload-section p {
        font-size: 0.8125rem;
    }

    .qr-upload-btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }

    #qrScannerStatus {
        font-size: 0.8125rem;
    }

    .guide-content {
        width: 95%;
        max-height: 95vh;
    }

    .guide-slide {
        padding: 1.875rem 1.25rem;
        max-height: calc(95vh - 5.625rem);
    }

    .guide-slide h2 {
        font-size: 1.25rem;
        margin-bottom: 0.9375rem;
    }

    .guide-slide p {
        font-size: 0.875rem;
    }

    .guide-image-placeholder {
        height: 9.375rem;
        font-size: 0.75rem;
    }

    .guide-icon-placeholder {
        width: 2.8125rem;
        height: 2.8125rem;
        font-size: 0.5625rem;
    }

    .guide-info-text h4 {
        font-size: 0.9375rem;
    }

    .guide-info-text p {
        font-size: 0.8125rem;
    }

    .guide-navigation {
        padding: 0.9375rem 1.25rem;
        flex-wrap: wrap;
        gap: 0.625rem;
    }

    .guide-dots {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .guide-nav-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .guide-btn-nav {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
        flex: 1;
    }

    .guide-close {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1.125rem;
    }

    .activity-content {
        width: 95%;
        max-height: 95vh;
    }

    .activity-header {
        padding: 0.9375rem 1.25rem;
    }

    .activity-header h2 {
        font-size: 1.25rem;
    }

    .activity-list {
        padding: 0.9375rem;
    }

    .activity-item {
        padding: 0.75rem;
        margin-bottom: 0.625rem;
    }

    .activity-location {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }

    .activity-meta {
        gap: 0.5rem;
        font-size: 0.6875rem;
        flex-wrap: wrap;
    }

    .activity-battery {
        width: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .activity-close {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1.125rem;
    }

    .activity-spinner {
        width: 1.875rem;
        height: 1.875rem;
        border: 0.1875rem solid #3a3a3a;
        border-top: 0.1875rem solid #00ff26;
    }

    .activity-loading {
        padding: 1.875rem 0.9375rem;
        gap: 0.75rem;
    }

    .activity-loading .activity-spinner {
        margin-bottom: 0.5rem;
    }

    .activity-loading-text {
        font-size: 0.875rem;
    }
}
