/**
 * tour.css - Stili per il sistema di tour guidati
 */

/* Tour Overlay */
.tour-overlay {
    position: relative;
}

/* Forza main-header a mostrare tutto quando tour è attivo */
.main-header:has(#tourHeaderContent) {
    overflow: visible !important;
    height: auto !important;
    display: block !important;
}

/* Tour header content dentro main-header */
#tourHeaderContent {
    padding: 15px;
    width: 100%;
    display: block;
    clear: both;
}

#tourHeaderContent .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

#tourHeaderContent .tour-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

#tourHeaderContent .tour-breadcrumb {
    color: #6c757d;
    font-size: 0.9rem;
}

#tourHeaderContent .progress {
    height: 8px;
    background-color: #e9ecef;
    margin-top: 10px;
    width: 100%;
    display: block;
    border-radius: 0.25rem;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

#tourHeaderContent .progress-bar {
    transition: width 0.5s ease;
    background-color: #28a745;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
}

/* Tour Footer */
.tour-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 0;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    z-index: 1030;
}

.tour-content {
    padding: 0 15px;
    position: relative;
}

.tour-step-card {
    animation: fadeInUp 0.5s ease;
    position: relative;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

/* Tour Field Highlight */
.tour-field-highlight {
    animation: highlightPulse 2s ease infinite;
    position: relative;
    background: white !important;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
}

.tour-field-highlight::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 3px solid #007bff;
    border-radius: 8px;
    pointer-events: none;
    animation: borderPulse 2s ease infinite;
}

@keyframes borderPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Backdrop for field focus (opzionale, non più necessario) */
.tour-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1020;
    pointer-events: none;
    display: none !important; /* Disabilitato per ora */
}

/* Tour Navigation Buttons */
.tour-prev-btn,
.tour-next-btn,
.tour-complete-btn {
    min-width: 150px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.tour-prev-btn:hover,
.tour-next-btn:hover,
.tour-complete-btn:hover {
    transform: scale(1.05);
}

/* Exit Button */
.tour-exit-btn {
    transition: all 0.3s ease;
}

.tour-exit-btn:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #tourHeaderContent .tour-title {
        font-size: 1.2rem;
    }
    
    #tourHeaderContent .tour-breadcrumb {
        font-size: 0.8rem;
    }
    
    .tour-prev-btn,
    .tour-next-btn,
    .tour-complete-btn {
        min-width: 100px;
        font-size: 0.9rem;
    }
}

/* Dark mode support */
.dark-mode #tourHeaderContent {
    color: white;
}

.dark-mode #tourHeaderContent .progress {
    background-color: #454d55;
}

.dark-mode #tourHeaderContent .progress-bar {
    background-color: #28a745;
}

.dark-mode #tourHeaderContent .tour-breadcrumb {
    color: #adb5bd;
}

.dark-mode .tour-footer {
    background: #343a40;
    color: white;
}

.dark-mode .tour-step-card {
    background: #343a40;
    color: white;
}

/* Chevron icon rotation */
.chevron-icon {
    transition: transform 0.3s ease;
}

.collapsed .chevron-icon {
    transform: rotate(0deg);
}

.settingsHeader:not(.collapsed) .chevron-icon {
    transform: rotate(180deg);
}

/* Tour Cards in Dashboard */
.tour-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    height: 100%;
}

.tour-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.tour-card.border-primary:hover {
    border-color: #007bff !important;
}

.tour-card.border-warning:hover {
    border-color: #ffc107 !important;
}

.tour-card.border-info:hover {
    border-color: #17a2b8 !important;
}

.tour-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tour-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

/* Stats Card */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-card h4 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card .progress {
    background-color: rgba(255, 255, 255, 0.3);
}

.stats-card .progress-bar {
    background-color: #28a745 !important;
}

/* Progress Ring */
.progress-ring {
    width: 120px;
    height: 120px;
}

/* Smooth transitions */
* {
    transition-property: background-color, color, border-color;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* Field Help Toggle */
.field-help-toggle {
    text-decoration: none;
    font-size: 1.1rem;
}

.field-help-toggle[aria-expanded="true"] i::before {
    content: "\f057"; /* fa-times-circle */
}

.field-help-content {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #e7f3ff;
    border-left: 3px solid #007bff;
    border-radius: 4px;
}

.dark-mode .field-help-content {
    background-color: #2c3e50;
    border-left-color: #3498db;
}

/* Keyboard shortcuts hint */
.tour-keyboard-hints {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 0.85rem;
    z-index: 1049;
}

.dark-mode .tour-keyboard-hints {
    background: #343a40;
    color: white;
}

.kbd {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.9em;
}

.dark-mode .kbd {
    background-color: #495057;
    border-color: #6c757d;
}

/* Tour Pending Prompt */
#tourPendingPrompt {
    animation: slideDown 0.3s ease-out;
    margin-bottom: 20px;
}

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

#tourPendingPrompt .card-body {
    padding: 1.25rem;
}

#tourPendingPrompt h5 {
    font-weight: 600;
    color: #007bff;
}

#tourPendingPrompt .tour-resume-btn {
    margin-right: 8px;
    font-weight: 500;
}

#tourPendingPrompt .tour-dismiss-btn {
    font-weight: 500;
}

@media (max-width: 768px) {
    #tourPendingPrompt .tour-resume-btn,
    #tourPendingPrompt .tour-dismiss-btn {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    #tourPendingPrompt .tour-dismiss-btn {
        margin-bottom: 0;
    }
}

/* Tour Resume Loading Overlay */
#tourResumeLoading {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dark-mode #tourResumeLoading {
    background: rgba(33, 37, 41, 0.95) !important;
}

.dark-mode #tourResumeLoading h4,
.dark-mode #tourResumeLoading p {
    color: #e9ecef !important;
}

.dark-mode #tourResumeLoading .text-muted {
    color: #adb5bd !important;
}
