/**
 * Professional Enhancements & Micro-interactions
 * Elegant spacing, typography, and subtle animations
 */

/* ========================================
   SMOOTH SCROLLING
   ======================================== */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   SCROLL PROGRESS INDICATOR
   ======================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 9999;
    pointer-events: none;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px var(--accent-primary);
}

/* ========================================
   BUTTON RIPPLE EFFECT
   ======================================== */

.button-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: inherit;
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ========================================
   FORM ENHANCEMENTS
   ======================================== */

.form-input.filled,
.form-textarea.filled {
    background: linear-gradient(135deg, 
        rgba(14, 165, 233, 0.03) 0%, 
        rgba(14, 165, 233, 0.01) 100%);
}

.form-input:focus,
.form-textarea:focus {
    transform: translateY(-1px);
}

/* Floating label effect (if you want to add labels later) */
.form-group {
    position: relative;
}

.form-label {
    position: absolute;
    left: 20px;
    top: 18px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-input:focus ~ .form-label,
.form-input.filled ~ .form-label {
    top: -10px;
    left: 15px;
    font-size: 0.75rem;
    color: var(--accent-primary);
    background: var(--bg-primary);
    padding: 0 8px;
}

/* ========================================
   ENHANCED HOVER STATES
   ======================================== */

/* Service icons pulse on hover */
.service-card:hover .service-icon {
    animation: iconPulse 0.6s ease-out;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.15) rotate(5deg);
    }
}

/* Skill items enhanced hover */
.skill-item {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skill-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.15);
}

/* Certificate cards - enhanced 3D rotation */
.certificate-card {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.certificate-card:hover {
    transform: translateY(-12px) rotateX(3deg) rotateY(-3deg);
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(14, 165, 233, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ========================================
   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;
    }
    
    .reduce-motion * {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   IMPROVED SPACING & TYPOGRAPHY
   ======================================== */

/* Section spacing consistency */
section.full-screen-section {
    padding: 100px 6%;
    min-height: 100vh;
}

@media (max-width: 968px) {
    section.full-screen-section {
        padding: 80px 5%;
    }
}

@media (max-width: 640px) {
    section.full-screen-section {
        padding: 60px 5%;
    }
}

/* Content max-widths for readability */
.section-header {
    max-width: 800px;
    margin: 0 auto 60px;
}

.section-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: clamp(0.9rem, 2vw, 1rem);
    max-width: 600px;
    margin: 0 auto;
}

/* Card grid spacing */
.services-grid,
.portfolio-grid,
.certificates-flow {
    gap: clamp(20px, 3vw, 32px);
}

/* Typography scale improvements */
h1, .h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.1;
}

h2, .h2 {
    font-size: clamp(1.75rem, 4vw, 2.8rem);
    line-height: 1.2;
}

h3, .h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.3;
}

p {
    line-height: 1.7;
    max-width: 70ch; /* Optimal reading width */
}

/* ========================================
   PROFESSIONAL SHADOWS
   ======================================== */

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.shadow-xl {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3),
                0 0 40px rgba(14, 165, 233, 0.15);
}

/* ========================================
   SELECTION STYLING
   ======================================== */

::selection {
    background: rgba(14, 165, 233, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(14, 165, 233, 0.3);
    color: var(--text-primary);
}

/* ========================================
   FOCUS VISIBLE (Accessibility)
   ======================================== */

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline-offset: 2px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .header,
    .footer,
    .hero-canvas,
    .btn,
    button {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    * {
        color: #000 !important;
        background: #fff !important;
    }
}
