/* =========================================
   RayLink Premium Enhancements
   Advanced styling for a polished look
   ========================================= */

/* === Smooth Scrolling === */
html {
    scroll-behavior: smooth;
}

/* === Premium Gradients === */
.gradient-primary {
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-700) 100%);
}

.gradient-success {
    background: linear-gradient(135deg, var(--color-success-500) 0%, var(--color-success-700) 100%);
}

.gradient-page-bg {
    background: linear-gradient(135deg, #f8f9fc 0%, #e8f4fd 100%);
}

.gradient-overlay {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

/* === Glass Morphism === */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === Elevated Cards === */
.card-elevated {
    transform: translateY(0);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card-elevated:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 112, 243, 0.15);
}

/* === Floating Animation === */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* === Shimmer Effect === */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* === Pulse Animation === */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* === Glow Effects === */
.glow-primary {
    box-shadow: 0 0 20px rgba(0, 112, 243, 0.4);
}

.glow-success {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.glow-on-hover {
    transition: box-shadow var(--transition-normal);
}

.glow-on-hover:hover {
    box-shadow: 0 0 30px rgba(0, 112, 243, 0.5);
}

/* === Ripple Effect === */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::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;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* === Skeleton Loading === */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-neutral-200) 25%,
        var(--color-neutral-100) 50%,
        var(--color-neutral-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-2);
}

.skeleton-circle {
    border-radius: 50%;
    width: 60px;
    height: 60px;
}

/* === Scroll Progress Bar === */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary-500);
    transform-origin: 0%;
    z-index: 9999;
}

/* === Badges & Pills === */
.badge-premium {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
    box-shadow: 0 2px 8px rgba(0, 112, 243, 0.3);
}

.badge-new {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    animation: pulse 2s infinite;
}

/* === Tooltip === */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    padding: var(--space-2) var(--space-3);
    background: var(--color-neutral-900);
    color: white;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    border: 5px solid transparent;
    border-top-color: var(--color-neutral-900);
    opacity: 0;
    transition: all var(--transition-fast);
}

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

/* === Stats Counter Animation === */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.8s ease-out;
}

/* === Card Patterns === */
.card-pattern {
    position: relative;
    overflow: hidden;
}

.card-pattern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(0, 112, 243, 0.05) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* === Status Indicators === */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--space-2);
}

.status-dot.online {
    background: var(--color-success-500);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--color-neutral-400);
}

.status-dot.busy {
    background: var(--color-error-500);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* === Progress Rings === */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease;
}

/* === Notification Dot === */
.notification-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--color-error-500);
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* === Premium Buttons === */
.btn-premium {
    position: relative;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700));
    color: white;
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-premium::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.5s;
}

.btn-premium:hover::before {
    left: 100%;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 112, 243, 0.3);
}

/* === Dividers === */
.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-6) 0;
}

.divider-gradient {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--color-primary-500) 50%,
        transparent 100%
    );
    margin: var(--space-6) 0;
}

.divider-with-text {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-6) 0;
}

.divider-with-text::before,
.divider-with-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.divider-with-text span {
    padding: 0 var(--space-4);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* === Tab Enhancements === */
.tab-enhanced {
    position: relative;
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-enhanced::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary-500);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.tab-enhanced.active::after,
.tab-enhanced:hover::after {
    transform: scaleX(1);
}

/* === Checkbox & Radio Custom === */
.checkbox-premium,
.radio-premium {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary-500);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.radio-premium {
    border-radius: 50%;
}

.checkbox-premium:checked,
.radio-premium:checked {
    background: var(--color-primary-500);
    border-color: var(--color-primary-500);
}

.checkbox-premium:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-premium:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* === Responsive Utilities === */
@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-stack {
        flex-direction: column !important;
    }

    .mobile-center {
        text-align: center !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }
}

/* === Print Styles === */
@media print {
    .no-print {
        display: none !important;
    }

    .print-break-before {
        page-break-before: always;
    }

    .print-break-after {
        page-break-after: always;
    }
}

/* === Focus Visible Enhancement === */
:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* === Selection Styling === */
::selection {
    background: var(--color-primary-500);
    color: white;
}

::-moz-selection {
    background: var(--color-primary-500);
    color: white;
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-neutral-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-500);
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
