/* Enhanced body styling with nice borders and improved design */
body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    position: relative;
    overflow-x: hidden;
}

/* Enhanced section borders and styling */
section {
    position: relative;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #3b82f6 20%, 
        #8b5cf6 50%, 
        #ec4899 80%, 
        transparent 100%);
    opacity: 0.6;
}

section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        #3b82f6 0%, 
        #8b5cf6 50%, 
        #ec4899 100%);
    opacity: 0.3;
}

/* Enhanced terminal styling */
.terminal-window {
    font-family: 'Fira Code', 'Courier New', monospace;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 120px rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, #000000, #0a0a0a);
}

.terminal-header {
    background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.terminal-body {
    background: radial-gradient(ellipse at top, #0a0f0a, #000000);
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #22c55e #1a1a1a;
}

.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #22c55e;
    border-radius: 4px;
}

.terminal-cursor {
    animation: blink 1s infinite;
    color: #22c55e;
    font-weight: bold;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Enhanced metrics dashboard */
.metric-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 116, 139, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.8s ease;
}

.metric-card:hover::before {
    left: 100%;
}

.metric-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
                0 0 60px rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

/* Enhanced code blocks */
.bg-gray-900 {
    background: linear-gradient(135deg, #1a1a1a, #0d0d0d) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Enhanced project cards with tech aesthetic */
.project-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.2),
                0 0 80px rgba(139, 92, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
}

/* Enhanced skill tags with tech styling */
.skill-category-cloud {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    position: relative;
    overflow: hidden;
}

.skill-category-infrastructure {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    position: relative;
    overflow: hidden;
}

.skill-category-data {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    position: relative;
    overflow: hidden;
}

.skill-category-devops {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    position: relative;
    overflow: hidden;
}

.skill-category-security {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Enhanced navigation with tech styling */
nav {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    font-weight: 600;
    color: #475569;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: #3b82f6;
    transform: translateY(-2px);
}

/* Enhanced hero section with tech aesthetic */
.hero-gradient {
    background: linear-gradient(135deg, #1e293b, #334155, #475569);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: heroGradientShift 10s ease infinite;
}

@keyframes heroGradientShift {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

/* Enhanced status indicators */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Enhanced tech grid background */
.tech-grid {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0 0, 0 0;
    animation: techGridMove 20s linear infinite;
}

@keyframes techGridMove {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 50px 50px, 50px 50px; }
}

/* Enhanced floating animations */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(2deg);
    }
    50% {
        transform: translateY(-10px) rotate(-1deg);
    }
    75% {
        transform: translateY(-15px) rotate(1deg);
    }
}

/* Enhanced glow effects */
.tech-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3),
                0 0 40px rgba(139, 92, 246, 0.2),
                0 0 60px rgba(236, 72, 153, 0.1);
}

.tech-glow:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5),
                0 0 60px rgba(139, 92, 246, 0.3),
                0 0 90px rgba(236, 72, 153, 0.2);
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-display: swap;
}

body {
    font-display: swap;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduce paint on scroll */
.project-card,
.skill-card,
.metric-card,
.achievement-card {
    will-change: transform;
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
}

/* Add lazy loading for images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"]:loaded {
    opacity: 1;
}

/* Optimize animations */
@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 loading states */
.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; }
}

/* Enhanced focus states for accessibility */
:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Enhanced print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .metric-card,
    .achievement-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .terminal-window {
        border: 1px solid #000;
        background: #fff !important;
        color: #000 !important;
    }
    
    .terminal-body {
        background: #fff !important;
        color: #000 !important;
    }
}

/* Enhanced animations with more visual appeal */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Enhanced animation classes */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.8s ease-out;
}

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

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

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

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Enhanced navigation with mature gradient effects */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--primary-slate);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

.nav-link:hover {
    color: var(--accent-gold);
    transform: translateY(-1px);
}

/* Enhanced card hover effects with mature color themes */
.skill-card,
.project-card,
.experience-card,
.education-card,
.contact-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 95, 0.05), transparent);
    transition: left 0.5s ease;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(51, 65, 85, 0.05), transparent);
    transition: left 0.5s ease;
}

.experience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(31, 41, 55, 0.05), transparent);
    transition: left 0.5s ease;
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(71, 85, 105, 0.05), transparent);
    transition: left 0.5s ease;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(184, 134, 11, 0.05), transparent);
    transition: left 0.5s ease;
}

.skill-card:hover::before,
.project-card:hover::before,
.experience-card:hover::before,
.education-card:hover::before,
.contact-card:hover::before {
    left: 100%;
}

/* Enhanced project cards with mature color themes */
.project-card {
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(51, 65, 85, 0.1);
    background: linear-gradient(white, white) padding-box,
                rgba(51, 65, 85, 0.05) border-box;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(31, 41, 55, 0.15);
    border-color: rgba(184, 134, 11, 0.2);
}

.project-card h3 {
    color: var(--primary-charcoal);
    font-weight: 600;
}

.project-card h3:hover {
    color: var(--accent-gold);
}

/* Enhanced skill tags with mature color themes */
.skill-tag {
    transition: all 0.2s ease;
    border-radius: 6px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    font-size: 0.875rem;
}

.skill-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.1);
}

/* Mature color-coded skill categories */
.skill-category-cloud {
    background: linear-gradient(135deg, #1e3a5f, #334155);
    color: white;
}

.skill-category-infrastructure {
    background: linear-gradient(135deg, #374151, #4b5563);
    color: white;
}

.skill-category-data {
    background: linear-gradient(135deg, #1f2937, #374151);
    color: white;
}

.skill-category-devops {
    background: linear-gradient(135deg, #475569, #64748b);
    color: white;
}

.skill-category-security {
    background: linear-gradient(135deg, #b8860b, #cd7f32);
    color: white;
}

/* Enhanced timeline styling for experience */
.experience-timeline {
    position: relative;
    padding-left: 30px;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-experience);
    border-radius: 1px;
}

.experience-timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.experience-timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.2);
}

/* Mobile menu animation */
#mobile-menu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.show {
    max-height: 400px;
}

/* Enhanced hero section with mature gradient */
.hero-gradient {
    background: var(--gradient-primary);
    position: relative;
    background-size: 200% 200%;
    animation: gradientShift 12s ease infinite;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.2;
}

.hero-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(184, 134, 11, 0.1), transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(31, 41, 55, 0.1), transparent 50%);
}

/* Section animations */
.section-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading animation */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-gradient {
        text-align: center;
    }
    
    .skill-card,
    .project-card,
    .experience-card {
        margin-bottom: 20px;
    }
    
    .experience-timeline {
        padding-left: 20px;
    }
    
    .experience-timeline-item::before {
        left: -24px;
    }
}

/* Print styles */
@media print {
    nav,
    #mobile-menu,
    .contact-card,
    footer {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .skill-card,
    .project-card,
    .experience-card,
    .education-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        break-after: avoid;
    }
}

/* Accessibility improvements */
.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 styles for better accessibility */
*:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .skill-card,
    .project-card,
    .experience-card,
    .education-card {
        border: 2px solid #000;
    }
    
    .nav-link::after {
        background-color: #000;
    }
}

/* 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;
    }
}
