/**
 * Custom Driver.js Styling for E-Sign Application
 * Matches brand colors and provides beautiful tour experience
 */

/* ============================================================================
   Popover Container
   ============================================================================ */

.driver-popover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    padding: 0;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================================
   Popover Header & Content
   ============================================================================ */

.driver-popover-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0 0 12px 0;
    padding: 20px 20px 0 20px;
    line-height: 1.3;
}

.driver-popover-description {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    padding: 0 20px 20px 20px;
    margin: 0;
}

/* Support for HTML in descriptions */
.driver-popover-description strong {
    font-weight: 600;
    color: white;
}

.driver-popover-description code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* ============================================================================
   Arrow Pointers
   ============================================================================ */

.driver-popover-arrow {
    animation: arrow-pulse 2s infinite;
}

@keyframes arrow-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Arrow colors for each side */
.driver-popover-arrow-side-left.driver-popover-arrow {
    border-left-color: #667eea;
}

.driver-popover-arrow-side-right.driver-popover-arrow {
    border-right-color: #667eea;
}

.driver-popover-arrow-side-top.driver-popover-arrow {
    border-top-color: #667eea;
}

.driver-popover-arrow-side-bottom.driver-popover-arrow {
    border-bottom-color: #667eea;
}

/* ============================================================================
   Buttons & Controls
   ============================================================================ */

.driver-popover-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
}

.driver-popover-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: none;
}

.driver-popover-btn:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.driver-popover-btn:active {
    transform: translateY(0);
}

.driver-popover-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Disabled state */
.driver-popover-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.driver-popover-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: none;
}

/* Close button */
.driver-popover-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 28px;
    font-weight: 300;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-popover-close-btn:hover {
    color: white;
    transform: rotate(90deg);
}

/* ============================================================================
   Progress Indicator
   ============================================================================ */

.driver-popover-progress-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================================
   Highlighted Element
   ============================================================================ */

.driver-active-element {
    outline: 4px solid rgba(102, 126, 234, 0.6) !important;
    outline-offset: 4px;
    border-radius: 4px;
    position: relative;
    z-index: 10000;
}

/* ============================================================================
   Overlay
   ============================================================================ */

.driver-overlay {
    background-color: rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-out;
}

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

/* ============================================================================
   Mobile Responsive
   ============================================================================ */

@media (max-width: 768px) {
    .driver-popover {
        max-width: 90vw;
        font-size: 14px;
    }
    
    .driver-popover-title {
        font-size: 18px;
        padding: 15px 15px 0 15px;
    }
    
    .driver-popover-description {
        font-size: 14px;
        padding: 0 15px 15px 15px;
    }
    
    .driver-popover-footer {
        padding: 12px 15px;
        flex-wrap: wrap;
    }
    
    .driver-popover-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .driver-popover-close-btn {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }
}

/* ============================================================================
   Dark Mode Support (Optional)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .driver-popover {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    }
}

/* ============================================================================
   Accessibility Enhancements
   ============================================================================ */

.driver-popover:focus-within {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .driver-popover {
        border: 3px solid white;
    }
    
    .driver-popover-btn {
        border-width: 3px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .driver-popover,
    .driver-overlay,
    .driver-popover-arrow,
    .driver-popover-btn {
        animation: none !important;
        transition: none !important;
    }
}
