/* 
 * Portfolio Website - Custom Styles
 * Built with HTML5, CSS3, and Tailwind CSS
 * Optimized for performance, accessibility, and mobile experience
 */

/* CSS Custom Properties (Variables) - Dark Mode with Red/Orange Theme */
:root {
    --primary-color: #ef4444;
    --primary-hover: #dc2626;
    --secondary-color: #f97316;
    --accent-color: #ea580c;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --bg-light: #1f2937;
    --bg-white: #111827;
    --border-light: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --transition-fast: all 0.15s ease;
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
}

/* Base Styles & Performance Optimizations */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

/* Enhanced Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--border-radius);
}

/* Skip to main content for screen readers */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    transition: top var(--transition-fast);
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* Reduced motion for accessibility */
@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;
    }
}

/* Enhanced Utility Classes */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
    transition: var(--transition-fast);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    border: 2px solid var(--border-light);
    will-change: transform;
}

.btn-secondary:hover {
    background-color: var(--bg-light);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
    opacity: 0;
}

.fade-in-left {
    animation: fadeInLeft 0.7s ease-out forwards;
    opacity: 0;
}

.fade-in-right {
    animation: fadeInRight 0.7s ease-out forwards;
    opacity: 0;
}

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

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

/* Staggered Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* Enhanced Project Card Effects */
.project-card {
    transition: var(--transition);
    will-change: transform;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.05));
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.project-card:active {
    transform: translateY(-8px) scale(1.01);
    transition: var(--transition-fast);
}

/* Enhanced Navigation Effects */
.nav-link {
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Loading Animation */
.loading-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;
    }
}

/* Responsive Typography */
.text-responsive-xl {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
}

.text-responsive-lg {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.2;
}

.text-responsive-md {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.4;
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    .mobile-center {
        text-align: center;
    }
    
    .mobile-stack {
        flex-direction: column;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .mobile-hide {
        display: none;
    }
    
    .mobile-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Improved touch targets */
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        min-width: 44px;
        padding: 0.875rem 1.5rem;
    }
    
    /* Better spacing on mobile */
    .project-card {
        margin-bottom: 1.5rem;
    }
    
    /* Optimized hero section for mobile */
    .hero-image {
        width: 280px;
        height: 280px;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .tablet-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tablet-text-center {
        text-align: center;
    }
}

/* Desktop Enhancements */
@media (min-width: 1025px) {
    .desktop-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Parallax effect for hero background */
    .hero-parallax {
        background-attachment: fixed;
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
    }
    
    /* Enhanced hover effects for desktop */
    .desktop-hover-lift:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid;
    }
    
    .project-card {
        border: 2px solid var(--text-primary);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-friendly {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
} 
