/* ========================================
   Tutorial System Styles
   ======================================== */

/* Intro.js Custom Styling */
.financial-tutorial-tooltip {
    max-width: 450px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.financial-tutorial-tooltip .introjs-tooltip-header {
    padding: 15px 20px;
    border-bottom: 2px solid #007bff;
    background: #064060;
}

.financial-tutorial-tooltip .introjs-tooltip-header h4 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.financial-tutorial-tooltip .introjs-tooltiptext {
    padding: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.financial-tutorial-tooltip .introjs-tooltiptext p {
    margin-bottom: 10px;
}

.financial-tutorial-tooltip .introjs-tooltipbuttons {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.financial-tutorial-tooltip .introjs-button {
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 13px;
    transition: all 0.3s ease;
}

.financial-tutorial-tooltip .introjs-nextbutton {
    background: #064060;
    color: white;
    border: none;
}

.financial-tutorial-tooltip .introjs-nextbutton:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.financial-tutorial-tooltip .introjs-prevbutton {
    background-color: #6c757d;
    color: white;
    border: none;
}

.financial-tutorial-tooltip .introjs-skipbutton {
    color: #6c757d;
}

.financial-tutorial-tooltip .introjs-skipbutton:hover {
    color: #495057;
}

.financial-tutorial-highlight {
    box-shadow: 0 0 0 4px rgb(255 156 67), 0 0 20px rgb(255 156 67);
    border-radius: 4px;
    animation: pulse-highlight 2s infinite;
}

@keyframes pulse-highlight {
    0%, 100% {
        box-shadow: 0 0 0 4px rgb(255 156 67), 0 0 20px rgb(255 156 67);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 156, 67, 0.6), 0 0 30px rgba(255, 156, 67, 0.8);
    }
}

.tutorial-highlight-pulse {
    animation: pulse-strong 1.5s infinite;
}

@keyframes pulse-strong {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.5), 0 0 20px rgba(255, 193, 7, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0.7), 0 0 40px rgba(255, 193, 7, 0.9);
    }
}

.introjs-progressbar {
    background-color: #064060;
}

/* Progress Bullets */
.introjs-bullets ul li a {
    background: #ccc;
}

.introjs-bullets ul li a.active {
    background: #064060;
}

/* ========================================
   Tutorial Help Button & Menu
   ======================================== */

.tutorial-help-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
}

.btn-tutorial-help {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #064060 0%;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-tutorial-help:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-tutorial-help i {
    font-size: 20px;
}

.btn-tutorial-help .help-text {
    font-size: 14px;
}

/* Responsive - hide text on mobile */
@media (max-width: 768px) {
    .btn-tutorial-help .help-text {
        display: none;
    }
    
    .btn-tutorial-help {
        width: 55px;
        height: 55px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* Tutorial Menu */
.tutorial-menu {
    position: absolute;
    bottom: 70px;
    left: 0;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUpFade 0.3s ease;
}

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

.tutorial-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #064060;
    color: white;
}

.tutorial-menu-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.tutorial-menu-header .btn-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.tutorial-menu-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tutorial-menu-body {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.tutorial-section {
    margin-bottom: 15px;
}

.tutorial-section h5 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    margin: 15px 10px 10px 10px;
    letter-spacing: 0.5px;
}

.tutorial-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-align: left;
}

.tutorial-menu-item:hover {
    background: #f8f9fa;
    border-color: #064060;
    transform: translateX(3px);
}

.tutorial-menu-item i {
    font-size: 18px;
    color: #064060;
    width: 20px;
    text-align: center;
}

.tutorial-menu-item span {
    flex: 1;
    color: #333;
    font-weight: 500;
}

/* Scrollbar styling for menu */
.tutorial-menu-body::-webkit-scrollbar {
    width: 6px;
}

.tutorial-menu-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tutorial-menu-body::-webkit-scrollbar-thumb {
    background: #064060;
    border-radius: 10px;
}

.tutorial-menu-body::-webkit-scrollbar-thumb:hover {
    background: #ff9c43;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tutorial-menu {
        width: calc(100vw - 60px);
        right: -15px;
    }
    
    .tutorial-help-container {
        bottom: 20px;
        right: 20px;
    }
}

/* ========================================
   Additional Helper Styles
   ======================================== */

/* Tooltip for specific elements */
.has-tooltip {
    position: relative;
    cursor: help;
}

.has-tooltip::after {
    content: '?';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #064060;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Pulse animation for important elements during tutorial */
.tutorial-pulse {
    animation: tutorial-pulse-animation 2s infinite;
}

@keyframes tutorial-pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* First-time user banner (optional) */
.first-time-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background:#064060;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 9998;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.first-time-banner button {
    margin-left: 15px;
    padding: 8px 20px;
    background: white;
    color: #064060;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
}

.first-time-banner button:hover {
    background: #f8f9fa;
}


/* ========================================
   Tutorial Help Button First-Time User Animations
   ======================================== */

/* Pulsing animation for help button */
.btn-tutorial-help-pulse {
    animation: help-button-pulse 2s infinite !important;
}

@keyframes help-button-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6), 
                    0 0 0 10px rgba(102, 126, 234, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
}

/* Pulsing ring effect */
.btn-tutorial-help-pulse::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    z-index: -1;
    animation: pulse-ring-help 2s infinite;
}

@keyframes pulse-ring-help {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.15);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Help Tooltip Styles */
.help-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);  /* Changed to position above button */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    animation: helpTooltipSlideIn 0.4s ease-out;
}

@keyframes helpTooltipSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);  /* Updated for centered positioning */
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.help-tooltip-content {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 220px;
    animation: helpTooltipBounce 0.6s ease-out;
}

@keyframes helpTooltipBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

.help-tooltip-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 20px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.help-tooltip-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.help-tooltip-text {
    padding-right: 20px;
}

.help-tooltip-text strong {
    display: block;
    color: #2d3748;
    font-size: 15px;
    margin-bottom: 6px;
}

.help-tooltip-text p {
    margin: 0;
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
}

.help-tooltip-arrow {
    position: absolute;
    bottom: -8px;  /* Position at bottom of tooltip */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;  /* Arrow pointing down */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Mobile Responsive Updates for Help Tooltip */
@media (max-width: 768px) {
    .help-tooltip {
        top: auto;
        bottom: calc(100% + 15px);
        left: 50%;
        transform: translateX(-50%);
    }
    
    .help-tooltip-content {
        max-width: 200px;
        padding: 12px;
    }
    
    .help-tooltip-text strong {
        font-size: 14px;
    }
    
    .help-tooltip-text p {
        font-size: 12px;
    }
    
    .help-tooltip-arrow {
        left: 50%;
        top: auto;
        bottom: -8px;
        transform: translateX(-50%);
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid white;
        border-bottom: none;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    }
}