/* ====================================
   Guidance Assistant - Premium Virtual Assistant
   Interactive floating assistant with tooltips
   ==================================== */

/* CSS Variables for Guidance */
:root {
    --guide-primary: #1a5f7a;
    --guide-gold: #c9a227;
    --guide-gold-light: #f7eed7;
    --guide-success: #27ae60;
    --guide-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --guide-shadow-gold: 0 10px 40px rgba(201, 162, 39, 0.3);
}

/* ====================================
   Floating Assistant Button Container
   ==================================== */
.guide-assistant {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 9998;
    font-family: 'Heebo', sans-serif;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

@media (max-width: 768px) {
    .guide-assistant {
        bottom: 20px;
        left: 15px;
    }
}

/* Quick Action Label next to button */
.guide-quick-label {
    background: linear-gradient(135deg, var(--guide-gold), #e8c547);
    color: var(--guide-primary);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 6px 25px rgba(201, 162, 39, 0.4);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: guideLabelPulse 2s ease-in-out infinite;
    position: relative;
    margin-bottom: 8px;
}

.guide-quick-label::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 27px;
    background: linear-gradient(135deg, var(--guide-gold), transparent, var(--guide-gold));
    z-index: -1;
    animation: guideGlowPulse 2s ease-in-out infinite;
    opacity: 0.5;
}

.guide-quick-label::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--guide-gold);
}

.guide-quick-label:hover {
    transform: scale(1.08) translateX(-5px);
    box-shadow: 0 10px 35px rgba(201, 162, 39, 0.5);
}

.guide-quick-label i {
    font-size: 0.85rem;
}

@keyframes guideLabelPulse {
    0%, 100% { box-shadow: 0 6px 25px rgba(201, 162, 39, 0.4); }
    50% { box-shadow: 0 8px 35px rgba(201, 162, 39, 0.6); }
}

/* Main Toggle Button */
.guide-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--guide-gold), #e8c547);
    color: var(--guide-primary);
    cursor: pointer;
    box-shadow: var(--guide-shadow-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: visible;
    flex-shrink: 0;
}

.guide-toggle::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--guide-gold), transparent, var(--guide-gold));
    z-index: -1;
    animation: guideGlowPulse 2s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes guideGlowPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.15); opacity: 0.7; }
}

.guide-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(201, 162, 39, 0.5);
}

.guide-assistant.active .guide-toggle {
    transform: rotate(0deg);
    background: linear-gradient(135deg, var(--guide-primary), #0d3d4d);
    color: #fff;
}

.guide-toggle-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.guide-toggle i {
    font-size: 1.6rem;
    transition: transform 0.3s ease;
}

.guide-assistant.active .guide-toggle i.fa-headset {
    display: none;
}

.guide-assistant .guide-toggle i.fa-times {
    display: none;
}

.guide-assistant.active .guide-toggle i.fa-times {
    display: block;
}

/* Animated Notification Badge */
.guide-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 700;
    border: 2px solid #fff;
    animation: guideBounce 2s ease-in-out infinite;
}

@keyframes guideBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ====================================
   Assistant Menu Popup - Full Featured
   ==================================== */
.guide-menu {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 320px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    max-height: 85vh;
    overflow-y: auto;
}

.guide-assistant.active .guide-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

@media (max-width: 400px) {
    .guide-menu {
        width: calc(100vw - 30px);
        left: 0;
    }
}

/* Menu Header */
.guide-menu-header {
    background: linear-gradient(135deg, var(--guide-primary), #0d3d4d);
    padding: 24px 20px;
    text-align: center;
    position: relative;
}

.guide-menu-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--guide-gold), transparent);
}

.guide-menu-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 3px solid var(--guide-gold);
    margin-bottom: 12px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.guide-menu-header h4 {
    color: #fff;
    font-size: 1.15rem;
    margin: 0 0 6px;
    font-weight: 700;
}

.guide-menu-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0;
}

/* Menu Sections */
.guide-menu-section {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.guide-menu-section:last-child {
    border-bottom: none;
}

.guide-menu-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--guide-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-right: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-menu-section-title i {
    font-size: 0.7rem;
    color: var(--guide-gold);
}

/* Menu Items */
.guide-menu-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--guide-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    cursor: pointer;
}

.guide-menu-item:hover {
    background: linear-gradient(135deg, var(--guide-gold-light), #fff);
    border-color: var(--guide-gold);
    transform: translateX(-5px);
}

.guide-menu-item i {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.guide-menu-item.primary i {
    background: linear-gradient(135deg, var(--guide-gold), #e8c547);
    color: var(--guide-primary);
}

.guide-menu-item.whatsapp i {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
}

.guide-menu-item.info i {
    background: linear-gradient(135deg, var(--guide-primary), #2a8faa);
    color: #fff;
}

.guide-menu-item.help i {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #fff;
}

.guide-menu-item.share i {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}

.guide-menu-item.scroll i {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: #fff;
}

.guide-menu-item span {
    font-size: 0.95rem;
    flex-grow: 1;
}

.guide-menu-item .item-arrow {
    color: #ccc;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.guide-menu-item:hover .item-arrow {
    transform: translateX(-5px);
    color: var(--guide-gold);
}

/* Quick Actions Grid */
.guide-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #fff);
}

.guide-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--guide-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    background: #fff;
    border: 1px solid #eee;
    cursor: pointer;
    text-align: center;
}

.guide-quick-action:hover {
    background: var(--guide-gold-light);
    border-color: var(--guide-gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.guide-quick-action i {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--guide-primary), #2a8faa);
    color: #fff;
}

.guide-quick-action span {
    font-size: 0.8rem;
}

/* ====================================
   Page Guidance Tooltips - Clickable
   ==================================== */
.guide-tooltip {
    position: absolute;
    z-index: 9990;
    pointer-events: auto;
    animation: guideFloat 3s ease-in-out infinite;
    cursor: pointer;
    text-decoration: none;
}

@keyframes guideFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.guide-tooltip-content {
    background: linear-gradient(135deg, var(--guide-primary), #0d3d4d);
    color: #fff;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 30px rgba(26, 95, 122, 0.4);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.guide-tooltip:hover .guide-tooltip-content {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(26, 95, 122, 0.5);
    background: linear-gradient(135deg, #2a8faa, var(--guide-primary));
}

.guide-tooltip-content i {
    color: var(--guide-gold);
    font-size: 1rem;
}

.guide-tooltip-content .arrow-icon {
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.guide-tooltip:hover .guide-tooltip-content .arrow-icon {
    transform: translateX(-5px);
}

.guide-tooltip-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #e74c3c;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.guide-tooltip:hover .guide-tooltip-close {
    opacity: 1;
}

/* ====================================
   Inline Guide Hints (next to elements)
   Designed as helpful notes, not buttons
   ==================================== */
.guide-hint {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fff9e6, #fff5d6);
    border: 1px dashed rgba(201, 162, 39, 0.5);
    color: var(--guide-primary);
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    animation: guideHintFloat 3s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.15);
    position: relative;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.guide-hint:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(201, 162, 39, 0.25);
    background: linear-gradient(135deg, #fff, #fff9e6);
    border-color: rgba(201, 162, 39, 0.7);
}

@keyframes guideHintFloat {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 4px 15px rgba(201, 162, 39, 0.15);
    }
    50% {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(201, 162, 39, 0.2);
    }
}

.guide-hint::before {
    content: none;
}

.guide-hint i {
    font-size: 0.95rem;
    color: var(--guide-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(201, 162, 39, 0.05));
    border-radius: 8px;
}

/* Pointing arrow for hints */
.guide-hint.with-arrow::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #fff5d6;
}

.guide-hint.arrow-right::after {
    left: auto;
    right: -12px;
    border-left-color: transparent;
    border-right-color: #fff5d6;
}

/* Dismissible Hints */
.guide-dismissible {
    position: relative;
}

.guide-dismiss-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    opacity: 0;
}

.guide-hint:hover .guide-dismiss-btn {
    opacity: 1;
}

.guide-dismiss-btn:hover {
    transform: scale(1.2);
    background: #c0392b;
}

/* Hide when dismissed */
.guide-dismissed {
    display: none !important;
}

/* ====================================
   FAQ Modal / Help Section
   ==================================== */
.guide-faq-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.guide-faq-modal.active {
    display: flex;
}

.guide-faq-container {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    animation: guideFaqSlideIn 0.4s ease;
}

@keyframes guideFaqSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.guide-faq-header {
    background: linear-gradient(135deg, var(--guide-primary), #0d3d4d);
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guide-faq-header h3 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-faq-header h3 i {
    color: var(--guide-gold);
}

.guide-faq-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.guide-faq-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.guide-faq-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.guide-faq-item {
    border: 1px solid #eee;
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.guide-faq-item:hover {
    border-color: var(--guide-gold);
}

.guide-faq-question {
    width: 100%;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border: none;
    text-align: right;
    font-size: 1rem;
    font-weight: 600;
    color: var(--guide-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Heebo', sans-serif;
    transition: all 0.3s ease;
}

.guide-faq-question:hover {
    background: var(--guide-gold-light);
}

.guide-faq-question i {
    transition: transform 0.3s ease;
    color: var(--guide-gold);
}

.guide-faq-item.active .guide-faq-question i {
    transform: rotate(180deg);
}

.guide-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.guide-faq-item.active .guide-faq-answer {
    max-height: 300px;
}

.guide-faq-answer-content {
    padding: 18px 20px;
    color: #555;
    line-height: 1.8;
    font-size: 0.95rem;
    background: #fff;
    border-top: 1px solid #eee;
}

/* ====================================
   Form Field Guidance
   ==================================== */
.guide-field-hint {
    position: absolute;
    top: 50%;
    left: calc(100% + 15px);
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--guide-primary), #0d3d4d);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 6px 25px rgba(26, 95, 122, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.guide-field-hint::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: var(--guide-primary);
}

.form-group:focus-within .guide-field-hint,
.settings-form-group:focus-within .guide-field-hint,
.form-field:focus-within .guide-field-hint {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .guide-field-hint {
        left: 0;
        top: calc(100% + 10px);
        transform: none;
    }

    .guide-field-hint::before {
        right: auto;
        left: 20px;
        top: -16px;
        transform: none;
        border: 8px solid transparent;
        border-bottom-color: var(--guide-primary);
    }
}

/* ====================================
   Hide Mobile FAB when Guide is active
   ==================================== */
.mobile-fab-container {
    display: none !important;
}

/* ====================================
   Responsive Adjustments
   ==================================== */
@media (max-width: 576px) {
    .guide-menu {
        width: calc(100vw - 30px);
        left: 0;
    }

    .guide-tooltip-content {
        font-size: 0.8rem;
        padding: 10px 14px;
    }

    .guide-hint {
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    .guide-toggle {
        width: 58px;
        height: 58px;
    }

    .guide-quick-label {
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    .guide-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ====================================
   Animation Classes
   ==================================== */
.guide-fade-in {
    animation: guideFadeIn 0.5s ease forwards;
}

@keyframes guideFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guide-slide-in {
    animation: guideSlideIn 0.5s ease forwards;
}

@keyframes guideSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ====================================
   Print Styles - Hide Guidance
   ==================================== */
@media print {
    .guide-assistant,
    .guide-tooltip,
    .guide-hint,
    .guide-field-hint,
    .guide-faq-modal {
        display: none !important;
    }
}
