/* ========== GUIDE MODAL ========== */
.guide-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}

.guide-modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.guide-content {
    background: #2a2a2a;
    border-radius: 1.25rem;
    width: 90%;
    max-width: 40rem;
    max-height: 70vh;
    max-height: 70dvh;
    /* Modern dynamic viewport height for better scaling support */
    overflow: hidden;
    position: relative;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.5);
}

.guide-close {
    position: absolute;
    right: 0.9375rem;
    top: 0.9375rem;
    width: 2rem;
    height: 2rem;
    background: #3a3a3a;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #e0e0e0;
    z-index: 10;
    transition: all 0.3s ease;
}

.guide-close:hover {
    background: #4a4a4a;
    transform: scale(1.1);
}

/* Guide TOC Content */
.guide-toc-content {
    display: flex;
    flex-direction: column;
}

.guide-toc-page {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    max-height: calc(70vh - 1rem);
    max-height: calc(70dvh - 1rem);
}

.guide-toc-page.hidden {
    display: none;
}

.guide-toc-header {
    text-align: center;
    margin-bottom: 1rem;
}

.guide-toc-header h2 {
    font-size: 1.5rem;
    color: #e0e0e0;
    margin-bottom: 0.25rem;
}

.guide-toc-header p {
    color: #888;
    font-size: 0.9rem;
}

.guide-toc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.guide-toc-card {
    background: #1e1e1e;
    border: 2px solid #3a3a3a;
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
}

.guide-toc-card:hover {
    border-color: #00ff26;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 255, 38, 0.15);
}

.guide-toc-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(0, 255, 38, 0.1);
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ff26;
}

.guide-toc-icon svg {
    width: 22px;
    height: 22px;
}

.guide-toc-card span {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Guide Section Pages */
.guide-section-page {
    display: none;
    flex-direction: column;
    height: 100%;
    max-height: 70vh;
    max-height: 70dvh;
}

.guide-section-page.active {
    display: flex;
}

.guide-back-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin: 0.75rem;
    background: #1e1e1e;
    border: 2px solid #3a3a3a;
    border-radius: 0.5rem;
    color: #e0e0e0;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: fit-content;
    flex-shrink: 0;
}

.guide-back-btn:hover {
    border-color: #00ff26;
    color: #00ff26;
}

.guide-section-content {
    padding: 0 1.25rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    /* Important for flex overflow to work */
}

.guide-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.guide-section-number {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #00ff26 0%, #00cc1f 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.guide-section-header h2 {
    color: #e0e0e0;
    font-size: 1.5rem;
    margin: 0;
}

.guide-section-content>p {
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Guide Steps */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guide-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.guide-step-num {
    width: 2rem;
    height: 2rem;
    background: #3a3a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ff26;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.guide-step-content h4 {
    color: #e0e0e0;
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
}

.guide-step-content p {
    color: whitesmoke;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* Guide Feature List */
.guide-feature-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guide-feature {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 0.75rem;
}

.guide-feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-feature-text h4 {
    color: #e0e0e0;
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
}

.guide-feature-text p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* Guide Info List */
.guide-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guide-info-row {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: #1e1e1e;
    border-radius: 0.5rem;
    align-items: flex-start;
}

.guide-info-label {
    color: #00ff26;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 8rem;
    flex-shrink: 0;
}

.guide-info-desc {
    color: #b0b0b0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Guide Button List */
.guide-button-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guide-button-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 0.75rem;
}

.guide-button-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-button-icon.vibrate {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.guide-button-icon.password {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}

.guide-button-icon.history {
    background: rgba(0, 255, 38, 0.15);
    color: #00ff26;
}

.guide-button-text h4 {
    color: #e0e0e0;
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
}

.guide-button-text p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* Guide Nav List */
.guide-nav-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guide-nav-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 0.75rem;
}

.guide-nav-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-nav-icon.geofence {
    background: rgba(0, 255, 38, 0.15);
    color: #00ff26;
}

.guide-nav-icon.password {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}

.guide-nav-icon.logout {
    background: rgba(230, 57, 70, 0.15);
    color: #e63946;
}

.guide-nav-text h4 {
    color: #e0e0e0;
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
}

.guide-nav-text p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* Guide Language Demo */
.guide-lang-demo {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.guide-lang-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.guide-lang-btn-demo {
    width: 3rem;
    height: 3rem;
    background: #3a3a3a;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
    font-weight: 700;
    font-size: 1rem;
}

.guide-lang-option span {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* Guide Subsection */
.guide-subsection {
    margin-bottom: 1.5rem;
}

.guide-subsection h3 {
    color: #00ff26;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Guide Tip Box */
.guide-tip-box {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(0, 255, 38, 0.1);
    border: 1px solid rgba(0, 255, 38, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1.5rem;
}

.guide-tip-box svg {
    color: #00ff26;
    flex-shrink: 0;
}

.guide-tip-box p {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* Guide Button (for dashboard) */
.guide-btn-dashboard {
    width: calc(100% - 2rem);
    margin: 0 1rem 1rem;
    padding: 0.875rem;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.guide-btn-dashboard:hover {
    background: #3a3a3a;
    border-color: #00ff26;
    transform: translateY(-2px);
}

.guide-btn-dashboard svg {
    flex-shrink: 0;
}

/* Guide Modal Responsive */
@media (max-width: 768px) {
    .guide-toc-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .guide-toc-card {
        padding: 1rem;
    }

    .guide-toc-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .guide-toc-card span {
        font-size: 0.8rem;
    }

    .guide-section-content {
        padding: 0 1rem 1.5rem;
    }

    .guide-info-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .guide-info-label {
        min-width: auto;
    }

    .guide-btn-dashboard {
        padding: 0.6rem;
        font-size: 0.85rem;
        margin: 0 1rem 0.75rem;
    }
}