/* VINSnap Visual Design & Accessibility Enhancements */

/* ==================== MICRO-INTERACTIONS & ANIMATIONS ==================== */

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Success Animation */
@keyframes success-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes success-checkmark {
    0% { transform: scale(0) rotate(45deg); }
    50% { transform: scale(1.1) rotate(45deg); }
    100% { transform: scale(1) rotate(45deg); }
}

.success-animation {
    animation: success-bounce 0.6s ease-in-out;
}

.checkmark-icon {
    display: inline-block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-green);
    position: relative;
    animation: success-bounce 0.6s ease-in-out;
}

.checkmark-icon::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 24px;
    border: solid white;
    border-width: 0 3px 3px 0;
    top: 8px;
    left: 16px;
    transform: rotate(45deg);
    animation: success-checkmark 0.4s 0.2s ease-in-out both;
}

/* Fade In Up Animation */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fade-in-up 0.4s ease-out;
}

/* Slide In Animation */
@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slide-in-right 0.3s ease-out;
}

/* ==================== COLOR-CODED SEVERITY INDICATORS ==================== */

/* Severity Badges */
.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease-in-out;
}

.severity-critical {
    background: rgba(248, 113, 113, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.severity-critical::before {
    content: '●';
    font-size: 16px;
    animation: pulse-red 2s infinite;
}

.severity-high {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.severity-high::before {
    content: '●';
    font-size: 16px;
}

.severity-medium {
    background: rgba(250, 204, 21, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.severity-medium::before {
    content: '●';
    font-size: 16px;
}

.severity-low {
    background: rgba(34, 211, 166, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 211, 166, 0.3);
}

.severity-low::before {
    content: '●';
    font-size: 16px;
}

.severity-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.severity-info::before {
    content: '●';
    font-size: 16px;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Status Dots */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot-critical {
    background: var(--accent-red);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
    animation: pulse-red 2s infinite;
}

.status-dot-success {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(34, 211, 166, 0.6);
}

.status-dot-warning {
    background: var(--accent-yellow);
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.status-dot-info {
    background: var(--accent-blue);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* ==================== IMPROVED EMPTY STATES ==================== */

.empty-state-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    min-height: 400px;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    opacity: 0.5;
    filter: grayscale(20%);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.empty-state-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state-description {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.empty-state-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease-in-out;
}

.empty-state-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* ==================== ACCESSIBILITY ENHANCEMENTS ==================== */

/* Focus Indicators */
*:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-blue);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    transition: top 0.3s ease-in-out;
}

.skip-to-content:focus {
    top: 0;
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor !important;
    }

    .card {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== CONSISTENT SPACING SYSTEM (4px grid) ==================== */

.spacing-4 { margin: 4px; }
.spacing-8 { margin: 8px; }
.spacing-12 { margin: 12px; }
.spacing-16 { margin: 16px; }
.spacing-20 { margin: 20px; }
.spacing-24 { margin: 24px; }
.spacing-32 { margin: 32px; }
.spacing-40 { margin: 40px; }
.spacing-48 { margin: 48px; }

.p-4 { padding: 4px; }
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

.pt-4 { padding-top: 4px; }
.pt-8 { padding-top: 8px; }
.pt-12 { padding-top: 12px; }
.pt-16 { padding-top: 16px; }

.pb-4 { padding-bottom: 4px; }
.pb-8 { padding-bottom: 8px; }
.pb-12 { padding-bottom: 12px; }
.pb-16 { padding-bottom: 16px; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

/* ==================== SMOOTH TRANSITIONS (300ms) ==================== */

.transition-all {
    transition: all 0.3s ease-in-out;
}

.transition-colors {
    transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.transition-transform {
    transition: transform 0.3s ease-in-out;
}

.transition-opacity {
    transition: opacity 0.3s ease-in-out;
}

/* ==================== TEXT SIZE CONTROLS ==================== */

.text-size-small {
    font-size: 0.875rem !important;
}

.text-size-normal {
    font-size: 1rem !important;
}

.text-size-large {
    font-size: 1.125rem !important;
}

.text-size-xlarge {
    font-size: 1.25rem !important;
}

/* Text Size Control Widget */
.text-size-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(14, 22, 36, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.text-size-btn {
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.text-size-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.text-size-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* ==================== LOADING STATES ==================== */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 12, 22, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.loading-spinner-modern {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== KEYBOARD NAVIGATION INDICATORS ==================== */

.keyboard-user *:focus {
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
}

.mouse-user *:focus {
    outline: none;
}

/* ==================== HOVER EFFECTS ==================== */

.hover-lift {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2);
}

.hover-glow {
    transition: box-shadow 0.3s ease-in-out;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.hover-scale {
    transition: transform 0.3s ease-in-out;
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* ==================== PROGRESS INDICATORS ==================== */

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.3s ease-in-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== NOTIFICATION BADGES ==================== */

.notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--accent-red);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    animation: badge-pop 0.3s ease-out;
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==================== TOOLTIPS ENHANCED ==================== */

.tooltip-enhanced {
    position: relative;
    cursor: help;
}

.tooltip-enhanced::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    padding: 8px 12px;
    background: rgba(14, 22, 36, 0.98);
    color: var(--text-primary);
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
    z-index: 1000;
}

.tooltip-enhanced::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(59, 130, 246, 0.2);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.tooltip-enhanced:hover::before,
.tooltip-enhanced:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
