/* Custom Styles for AT Dev Portfolio */

/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Loading Animation */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, var(--charcoal), var(--slate));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(221, 226, 231, 0.3);
    border-top: 3px solid var(--ghost);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Color Palette - AT Logo Inspired */
:root {
    --charcoal: #3A4550;
    --slate: #5C6773;
    --steel: #7A8590;
    --ghost: #F4F7FA;
    --silver: #DDE2E7;
    
    /* Gradient variations */
    --charcoal-light: #434c5a;
    --slate-light: #6b7684;
    --steel-light: #8691a0;
    --ghost-dim: #e8edf2;
    --silver-dim: #c8d1d8;
}

* {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

/* Glass Panel Effect */
.glass-panel {
    backdrop-filter: blur(20px);
    background: rgba(92, 103, 115, 0.15);
    border: 1px solid rgba(221, 226, 231, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(58, 69, 80, 0.4);
    transition: all 0.3s ease;
}

.glass-panel:hover {
    background: rgba(92, 103, 115, 0.25);
    border-color: rgba(221, 226, 231, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(58, 69, 80, 0.5);
}

/* Glass Button Effect */
.glass-button {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(122, 133, 144, 0.4);
}

/* Project Cards */
.project-card {
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.project-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.6s ease;
}

.project-card:hover::before {
    left: 100%;
}

/* Fix for gallery and project images to prevent overflow and maintain aspect ratio */
.project-card img {
  width: 100%;
  max-width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border-radius: 0.75rem;
}
.gallery-item img {
  width: 100%;
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #23272f;
  border-radius: 0.75rem;
}

/* Section Titles */
.section-title {
    background: linear-gradient(135deg, var(--slate), var(--steel), var(--silver));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Pulse Animation */
.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Floating Particles */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(122, 133, 144, 0.6);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.particle-2 {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
    animation-duration: 10s;
    background: rgba(92, 103, 115, 0.6);
}

.particle-3 {
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
    animation-duration: 7s;
    background: rgba(221, 226, 231, 0.6);
}

.particle-4 {
    top: 40%;
    right: 30%;
    animation-delay: 1s;
    animation-duration: 9s;
    background: rgba(122, 133, 144, 0.5);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-40px) translateX(-10px);
        opacity: 1;
    }
    75% {
        transform: translateY(-20px) translateX(15px);
        opacity: 0.6;
    }
}

/* Category Tabs */
.category-tab {
    color: var(--silver);
    transition: all 0.3s ease;
}

.category-tab.active {
    background: linear-gradient(135deg, rgba(92, 103, 115, 0.3), rgba(122, 133, 144, 0.3));
    color: var(--ghost);
    box-shadow: 0 4px 16px rgba(122, 133, 144, 0.3);
}

.category-tab:hover {
    color: var(--ghost);
    background: rgba(122, 133, 144, 0.2);
}

/* Gallery Items */
.gallery-item {
    transition: all 0.4s ease;
    opacity: 0;
    transform: scale(0.8);
}

.gallery-item.active {
    opacity: 1;
    transform: scale(1);
}

/* Timeline */
.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
}

/* Navigation Hover Effects */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--slate), var(--steel));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .glass-panel {
        margin: 0 1rem;
    }
    
    .project-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Glow Effects */
.glow-slate {
    box-shadow: 0 0 20px rgba(92, 103, 115, 0.5);
}

.glow-steel {
    box-shadow: 0 0 20px rgba(122, 133, 144, 0.5);
}

.glow-silver {
    box-shadow: 0 0 20px rgba(221, 226, 231, 0.5);
}

/* Enhanced Button Animations */
.glass-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 247, 250, 0.2), transparent);
    transition: left 0.5s ease;
}

.glass-button:hover::before {
    left: 100%;
}

/* Wave Background Canvas */
#waveCanvas {
    opacity: 0.7;
}

/* Performance Optimizations */
.loaded {
    animation-play-state: running;
}

/* Reduce motion for users with prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .loading-spinner {
        animation: none;
        border: 3px solid var(--ghost);
    }
}

/* Optimize rendering for canvas animations */
#waveCanvas {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize glass panels for better performance */
.glass-panel {
    will-change: transform, background-color, border-color;
    transform: translateZ(0);
}

/* Improve scrolling performance */
.smooth-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --ghost: #FFFFFF;
        --silver: #E0E0E0;
        --charcoal: #000000;
        --slate: #333333;
        --steel: #666666;
    }
    
    .glass-panel {
        border-width: 2px;
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.glass-button:focus {
    outline: 2px solid var(--ghost);
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--charcoal);
    color: var(--ghost);
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .text-8xl, .text-9xl {
        font-size: 4rem;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-5xl {
        font-size: 2.5rem;
    }
}
