/**
 * Utility Classes
 * Reusable CSS classes for rapid development
 */

/* Spacing Utilities */
.p-xs { padding: 4px !important; }
.p-sm { padding: 8px !important; }
.p-md { padding: 16px !important; }
.p-lg { padding: 24px !important; }
.p-xl { padding: 32px !important; }

.m-xs { margin: 4px !important; }
.m-sm { margin: 8px !important; }
.m-md { margin: 16px !important; }
.m-lg { margin: 24px !important; }
.m-xl { margin: 32px !important; }

/* Typography Utilities */
.text-gradient {
    background: linear-gradient(135deg, #1e40af, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.font-light { font-weight: 300 !important; }
.font-normal { font-weight: 400 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }
.font-black { font-weight: 900 !important; }

/* Border Utilities */
.rounded-sm { border-radius: 8px !important; }
.rounded-md { border-radius: 12px !important; }
.rounded-lg { border-radius: 16px !important; }
.rounded-xl { border-radius: 20px !important; }
.rounded-full { border-radius: 9999px !important; }

/* Shadow Utilities */
.shadow-sm { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important; }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important; }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important; }
.shadow-xl { box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1) !important; }
.shadow-2xl { box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15) !important; }
.shadow-none { box-shadow: none !important; }

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s, box-shadow 0.3s;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(30, 64, 175, 0.5);
}

.hover-rotate {
    transition: transform 0.3s;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Glass Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Gradient Text */
.gradient-text-blue {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-accent {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Border Effects */
.border-gradient {
    border-image: linear-gradient(135deg, #1e40af, #f59e0b) 1;
}

.border-glow {
    border: 2px solid #1e40af;
    box-shadow: 0 0 10px rgba(30, 64, 175, 0.3);
}

/* Button Utilities */
.btn-glow {
    box-shadow: 0 0 15px rgba(30, 64, 175, 0.5);
}

.btn-3d {
    box-shadow: 0 6px 0 #1e3a8a, 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-3d:hover {
    transform: translateY(2px);
    box-shadow: 0 4px 0 #1e3a8a, 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-3d:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #1e3a8a, 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Overlay Utilities */
.overlay-dark {
    background: rgba(0, 0, 0, 0.5);
}

.overlay-gradient {
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8));
}

/* Blur Utilities */
.blur-sm { filter: blur(4px); }
.blur-md { filter: blur(8px); }
.blur-lg { filter: blur(12px); }

/* Brightness Utilities */
.brightness-75 { filter: brightness(0.75); }
.brightness-90 { filter: brightness(0.9); }
.brightness-110 { filter: brightness(1.1); }
.brightness-125 { filter: brightness(1.25); }

/* Transform Utilities */
.scale-90 { transform: scale(0.9); }
.scale-95 { transform: scale(0.95); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

.rotate-1 { transform: rotate(1deg); }
.rotate-3 { transform: rotate(3deg); }
.rotate-6 { transform: rotate(6deg); }
.-rotate-1 { transform: rotate(-1deg); }
.-rotate-3 { transform: rotate(-3deg); }

/* Flex Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Position Utilities */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.sticky { position: sticky !important; }

/* Z-index Utilities */
.z-0 { z-index: 0 !important; }
.z-10 { z-index: 10 !important; }
.z-20 { z-index: 20 !important; }
.z-30 { z-index: 30 !important; }
.z-40 { z-index: 40 !important; }
.z-50 { z-index: 50 !important; }

/* Cursor Utilities */
.cursor-pointer { cursor: pointer !important; }
.cursor-not-allowed { cursor: not-allowed !important; }
.cursor-grab { cursor: grab !important; }

/* Overflow Utilities */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.overflow-scroll { overflow: scroll !important; }

/* Opacity Utilities */
.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

/* Transition Utilities */
.transition-none { transition: none !important; }
.transition-all { transition: all 0.3s !important; }
.transition-fast { transition: all 0.15s !important; }
.transition-slow { transition: all 0.6s !important; }

/* Display Utilities Enhancement */
.d-grid { display: grid !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

/* Background Patterns */
.bg-dots {
    background-image: radial-gradient(circle, #e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
}

.bg-grid {
    background-image: 
        linear-gradient(#e2e8f0 1px, transparent 1px),
        linear-gradient(90deg, #e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Aspect Ratio Utilities */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-4-3 { aspect-ratio: 4 / 3; }

/* Object Fit Utilities */
.object-cover { object-fit: cover !important; }
.object-contain { object-fit: contain !important; }
.object-fill { object-fit: fill !important; }

/* Line Clamp */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Backdrop Blur */
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(8px); }
.backdrop-blur-lg { backdrop-filter: blur(16px); }

/* Custom Scrollbar Utilities */
.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scrollbar-hidden::-webkit-scrollbar {
    display: none;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid #1e40af;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Interactive States */
.interactive {
    transition: all 0.3s;
    cursor: pointer;
}

.interactive:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.interactive:active {
    transform: translateY(-1px);
}

/* Badge Enhancements */
.badge-pill {
    border-radius: 50px;
    padding: 6px 16px;
}

.badge-gradient {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.badge-outline {
    background: transparent;
    border: 2px solid currentColor;
}

/* Card Styles */
.card-elevated {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-hover-float:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Icon Utilities */
.icon-sm { font-size: 14px; }
.icon-md { font-size: 18px; }
.icon-lg { font-size: 24px; }
.icon-xl { font-size: 32px; }
.icon-2xl { font-size: 48px; }

.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8fafc;
}

.icon-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8fafc;
}

/* Divider */
.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 24px 0;
}

.divider-gradient {
    height: 3px;
    background: linear-gradient(90deg, #1e40af, #f59e0b, #ef4444, #10b981);
    margin: 24px 0;
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
}

.status-dot.active {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2s infinite;
}

.status-dot.inactive {
    background: #64748b;
}

.status-dot.warning {
    background: #f59e0b;
    animation: pulse 2s infinite;
}

/* Progress Indicators */
.progress-modern {
    height: 10px;
    border-radius: 10px;
    background: #e2e8f0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-modern .progress-bar {
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.4);
}

/* Avatar Utilities */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 72px; height: 72px; }

/* Tooltip Custom */
.tooltip-custom {
    position: relative;
    cursor: help;
}

.tooltip-custom::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%) translateY(-8px);
    padding: 8px 12px;
    background: #0f172a;
    color: white;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-custom:hover::after {
    opacity: 1;
    transform: translateX(50%) translateY(-4px);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Ribbon */
.ribbon {
    position: absolute;
    top: 15px;
    right: -5px;
    padding: 6px 16px;
    background: #ef4444;
    color: white;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    z-index: 10;
}

.ribbon::before {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    border-top: 5px solid #991b1b;
    border-left: 5px solid transparent;
}

/* Skeleton Loader */
.skeleton-box {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

/* Responsive Utilities */
@media (max-width: 576px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
    .hide-desktop { display: none !important; }
}

/* Print Utilities */
@media print {
    .no-print { display: none !important; }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Visible */
.focus-ring:focus-visible {
    outline: 3px solid #1e40af;
    outline-offset: 3px;
}

/* Smooth Scroll */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* No Select */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Truncate Text */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Animation Control */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Gradient Divider */
.gradient-divider {
    height: 4px;
    background: linear-gradient(90deg, transparent, #1e40af, transparent);
    margin: 32px 0;
    border-radius: 4px;
}

/* Featured Tag */
.featured-tag {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Premium Button */
.btn-premium {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-premium::before {
    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, height 0.6s;
}

.btn-premium:hover::before {
    width: 300px;
    height: 300px;
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(30, 64, 175, 0.5);
}
