/* Professional Enhancements - General Improvements */

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    right: 0;
    background: #1152d4;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 4px;
}

.skip-to-content:focus {
    top: 0;
}

/* Focus States for Accessibility */
*:focus-visible {
    outline: 2px solid #1152d4;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #1152d4;
    outline-offset: 2px;
}

/* Improved focus for interactive elements */
button, a, input, textarea, select {
    transition: outline 0.2s ease, outline-offset 0.2s ease;
}

/* Improved Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

p {
    line-height: 1.7;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.dark .loading-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Smooth Transitions for Theme Changes */
body,
body * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Better Image Loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Improved Button States */
button:disabled,
a:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }
    
    .btn-primary {
        border-width: 2px;
    }
}

/* Container Improvements */
.container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
        padding-right: 2rem;
        padding-left: 2rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1536px;
    }
}

/* Professional Spacing System */
.section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* Improved Link Styles */
a:not(.btn):not(.nav-link) {
    text-decoration: none;
    color: #1152d4;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:not(.btn):not(.nav-link):hover {
    color: #0d3da3;
    text-decoration: underline;
}

.dark a:not(.btn):not(.nav-link) {
    color: #60a5fa;
}

.dark a:not(.btn):not(.nav-link):hover {
    color: #93c5fd;
}

/* Better Selection Colors */
::selection {
    background-color: rgba(17, 82, 212, 0.25);
    color: #0d3da3;
}

.dark ::selection {
    background-color: rgba(96, 165, 250, 0.3);
    color: #ffffff;
}

/* Improved Form Elements */
input, textarea, select {
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    ring: 2px;
    ring-color: #1152d4;
    ring-offset: 2px;
}

/* Professional Shadows */
.shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02);
}

.shadow-medium {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.shadow-large {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Professional Gradients */
.gradient-primary {
    background: linear-gradient(135deg, #1152d4 0%, #2563eb 50%, #3b82f6 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
}

/* Text Gradients */
.text-gradient-primary {
    background: linear-gradient(135deg, #1152d4, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Professional Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: #eff6ff;
    color: #1152d4;
    border: 1px solid #bfdbfe;
}

.dark .badge {
    background-color: rgba(17, 82, 212, 0.15);
    color: #93c5fd;
    border-color: rgba(17, 82, 212, 0.3);
}

/* Smooth Scroll Improvements */
html {
    scroll-padding-top: 5rem;
}

/* Professional Loading Indicator */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(17, 82, 212, 0.1);
    border-top-color: #1152d4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Improved Mobile Experience */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1.25rem;
    }
}

/* Performance: Reduce repaints */
.will-change-auto {
    will-change: auto;
}

/* Better Image Aspect Ratios */
.aspect-ratio-maintain {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Professional Tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #1e293b;
    color: white;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}

.tooltip:hover::after {
    opacity: 1;
}

.dark .tooltip::after {
    background-color: #f1f5f9;
    color: #1e293b;
}

/* Performance Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* Improved Loading States */
.loading-state {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading-state::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Smooth Page Transitions */
.page-transition {
    animation: fadeInPage 0.3s ease-in-out;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Professional Error States */
.error-state {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 0.5rem;
}

.dark .error-state {
    color: #fca5a5;
    background-color: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
}

/* Professional Success States */
.success-state {
    color: #059669;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 1rem;
    border-radius: 0.5rem;
}

.dark .success-state {
    color: #6ee7b7;
    background-color: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
}

/* Improved Spacing System */
.space-y-section > * + * {
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .space-y-section > * + * {
        margin-top: 3rem;
    }
}

/* Professional Grid Improvements */
.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Improved Text Rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Better Image Optimization */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

@media (max-resolution: 1dppx) {
    img {
        image-rendering: auto;
    }
}

/* Professional Shadows - Enhanced */
.shadow-glow-primary {
    box-shadow: 0 0 20px rgba(17, 82, 212, 0.3), 0 4px 16px rgba(17, 82, 212, 0.2);
}

.shadow-glow-purple {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3), 0 4px 16px rgba(139, 92, 246, 0.2);
}

.shadow-glow-cyan {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3), 0 4px 16px rgba(6, 182, 212, 0.2);
}

/* Professional Hover Effects */
.hover-glow:hover {
    filter: drop-shadow(0 0 8px currentColor);
}

/* Improved Backdrop Blur Support */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-enhanced {
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }
}

/* Better Color Contrast */
.text-contrast {
    color: #0f172a;
}

.dark .text-contrast {
    color: #f8fafc;
}

/* Professional Dividers */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 2rem 0;
}

.dark .divider {
    background: linear-gradient(to right, transparent, #334155, transparent);
}

/* Improved Responsive Text */
.responsive-text {
    font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
}

.responsive-heading {
    font-size: clamp(1.5rem, 4vw + 1rem, 3rem);
}

/* Performance: Contain Layout */
.contain-layout {
    contain: layout style paint;
}

/* Better Aspect Ratios */
.aspect-photo {
    aspect-ratio: 4 / 3;
}

.aspect-portrait {
    aspect-ratio: 3 / 4;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Professional Loading States */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.dark .loading-overlay {
    background: rgba(11, 17, 33, 0.9);
}

/* Professional Error Boundaries */
.error-boundary {
    padding: 2rem;
    text-align: center;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    color: #991b1b;
}

.dark .error-boundary {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

/* Improved Button States */
button, .btn, a.btn {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

button:disabled, .btn:disabled, a.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

/* Professional Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

/* Better Link Underlines */
a:not(.btn):not(.nav-link) {
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

/* Improved Form Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Professional Placeholders */
::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.dark ::placeholder {
    color: #64748b;
}

/* Better Focus Indicators */
*:focus-visible {
    outline: 2px solid #1152d4;
    outline-offset: 2px;
    outline-style: solid;
}

.dark *:focus-visible {
    outline-color: #60a5fa;
}

/* Professional Hover States */
@media (hover: hover) {
    .hover-lift:hover {
        transform: translateY(-6px) translateZ(0);
    }
}

@media (hover: none) {
    .hover-lift:active {
        transform: translateY(-2px) translateZ(0);
    }
}

/* Print Styles Enhancement */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .no-print,
    header,
    footer,
    nav,
    button,
    .btn {
        display: none !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .card {
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }
}
