/*
=============================================================================
MODERN UI ELEMENTS - Enhanced Visual Components for AISaaScore v1.0.7
=============================================================================
Purpose: Add visual interest with modern UI patterns while maintaining security
=============================================================================
*/

/* ===== ANIMATED GRADIENT BACKGROUNDS ===== */
.gradient-hero {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-subtle {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
}

/* ===== GLASSMORPHISM CARDS ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: var(--space-6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.25);
}

/* ===== NEUMORPHISM ELEMENTS ===== */
.neu-button {
    background: linear-gradient(145deg, #e6e6e6, #ffffff);
    box-shadow: 20px 20px 60px #d1d1d1, -20px -20px 60px #ffffff;
    border: none;
    border-radius: 12px;
    padding: var(--space-4) var(--space-6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.neu-button:active {
    box-shadow: inset 20px 20px 60px #d1d1d1, inset -20px -20px 60px #ffffff;
}

/* ===== ANIMATED CARDS WITH HOVER EFFECTS ===== */
.feature-card {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: var(--space-8);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* ===== ANIMATED BADGES ===== */
.badge-animated {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: white;
    border-radius: 24px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    animation: pulse 2s infinite;
}

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

/* ===== MODERN BUTTONS WITH RIPPLE EFFECT ===== */
.btn-modern {
    position: relative;
    overflow: hidden;
    padding: var(--space-3) var(--space-6);
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: var(--font-medium);
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.btn-modern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-modern:hover::after {
    width: 300px;
    height: 300px;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
}

/* ===== FLOATING ACTION BUTTON ===== */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ===== SKELETON LOADERS ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== MODERN TOOLTIPS ===== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--neutral-900);
    color: white;
    padding: var(--space-2) var(--space-3);
    border-radius: 6px;
    font-size: var(--text-sm);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.tooltip:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* ===== ANIMATED PROGRESS BARS ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--neutral-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
    border-radius: 4px;
    animation: progressAnimation 2s ease-in-out;
    transition: width 0.6s ease;
}

@keyframes progressAnimation {
    0% { width: 0%; }
}

/* ===== MODERN NOTIFICATION BADGES ===== */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    animation: notificationPop 0.3s ease;
}

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

/* ===== INTERACTIVE RATING STARS ===== */
.rating-stars {
    display: inline-flex;
    gap: var(--space-1);
}

.star {
    font-size: 24px;
    color: var(--neutral-300);
    cursor: pointer;
    transition: all 0.2s ease;
}

.star:hover,
.star.active {
    color: #fbbf24;
    transform: scale(1.2);
}

/* ===== MODERN TABS ===== */
.tab-container {
    border-bottom: 2px solid var(--neutral-200);
}

.tab-list {
    display: flex;
    gap: var(--space-4);
    margin-bottom: -2px;
}

.tab-button {
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-primary);
    transition: width 0.3s ease;
}

.tab-button:hover::after,
.tab-button.active::after {
    width: 100%;
}

.tab-button.active {
    color: var(--brand-primary);
    font-weight: var(--font-semibold);
}

/* ===== ANIMATED DIVIDERS ===== */
.divider-animated {
    position: relative;
    text-align: center;
    margin: var(--space-8) 0;
}

.divider-animated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-primary), transparent);
    animation: dividerPulse 3s infinite;
}

@keyframes dividerPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ===== MODERN FORM ELEMENTS ===== */
.input-modern {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--neutral-200);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    font-size: var(--text-base);
}

.input-modern:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

.input-modern::placeholder {
    color: var(--neutral-400);
}

/* ===== FLOATING LABELS ===== */
.form-group {
    position: relative;
    margin-bottom: var(--space-6);
}

.floating-label {
    position: absolute;
    top: 50%;
    left: var(--space-4);
    transform: translateY(-50%);
    background: white;
    padding: 0 var(--space-2);
    color: var(--neutral-500);
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-modern:focus ~ .floating-label,
.input-modern:not(:placeholder-shown) ~ .floating-label {
    top: 0;
    font-size: var(--text-sm);
    color: var(--brand-primary);
}

/* ===== ICON ANIMATIONS ===== */
.icon-bounce {
    animation: bounce 1s infinite;
}

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

.icon-spin {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE GRID SYSTEM ===== */
.masonry-grid {
    column-count: 3;
    column-gap: var(--space-6);
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: var(--space-6);
}

@media (max-width: 1024px) {
    .masonry-grid { column-count: 2; }
}

@media (max-width: 640px) {
    .masonry-grid { column-count: 1; }
}

/* ===== SECURITY: XSS Protection for User Content ===== */
.user-content * {
    /* Prevent script injection */
    pointer-events: auto !important;
}

.user-content script,
.user-content iframe,
.user-content object,
.user-content embed,
.user-content applet {
    display: none !important;
}