/* Custom styles for portfolio */

/* CSS Variables for Dark Mode */
:root {
    --bg-primary: #F2F2F2;
    --bg-secondary: #FFFFFF;
    --text-primary: #0D0D0D;
    --text-secondary: #1A2A40;
    --accent-primary: #42628C;
    --accent-secondary: #1A2A40;
    --border-color: rgba(26, 42, 64, 0.1);
    --glass-bg: rgba(26, 42, 64, 0.85);
    --card-bg: rgba(242, 242, 242, 0.7);
}

[data-theme="dark"] {
    --bg-primary: #0D0D0D;
    --bg-secondary: #1A2A40;
    --text-primary: #F2F2F2;
    --text-secondary: #F2F2F2;
    --accent-primary: #42628C;
    --accent-secondary: #F2F2F2;
    --border-color: rgba(242, 242, 242, 0.1);
    --glass-bg: rgba(13, 13, 13, 0.85);
    --card-bg: rgba(26, 42, 64, 0.7);
}

/* Smooth theme transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Glassmorphism Navigation */
.glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

/* Scroll Reveal Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Custom animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slideIn {
    animation: slideIn 0.6s ease-out forwards;
}

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

/* Page transition */
.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(26, 42, 64, 0.2);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #42628C 0%, #F2F2F2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #F2F2F2;
}

::-webkit-scrollbar-thumb {
    background: #42628C;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1A2A40;
}

/* Skill bar animation */
.skill-bar {
    position: relative;
    height: 10px;
    background: #F2F2F2;
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #42628C 0%, #1A2A40 100%);
    border-radius: 10px;
    transition: width 1.5s ease-out;
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #42628C 0%, #1A2A40 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(66, 98, 140, 0.4);
}

/* Project card effects */
.project-card {
    position: relative;
    overflow: hidden;
}

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

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

/* Navigation active state */
.nav-active {
    color: #42628C;
    border-bottom: 2px solid #42628C;
}

/* Loading animation for visitor counter */
.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(242, 242, 242, 0.4) 0%,
        rgba(66, 98, 140, 0.2) 50%,
        rgba(242, 242, 242, 0.4) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Enhanced Card Shadows */
.card-shadow-lg {
    box-shadow:
        0 10px 30px -5px rgba(26, 42, 64, 0.1),
        0 4px 10px -2px rgba(26, 42, 64, 0.05);
}

.card-shadow-lg:hover {
    box-shadow:
        0 20px 50px -5px rgba(26, 42, 64, 0.2),
        0 10px 20px -2px rgba(26, 42, 64, 0.1);
}

/* Smooth Mobile Menu Slide */
.mobile-menu-enter {
    animation: slideDown 0.3s ease-out;
}

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

/* Typography Enhancements */
.text-balance {
    text-wrap: balance;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

/* Improved Button Hover States */
.btn-hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(66, 98, 140, 0.3);
}

.btn-hover-lift:active {
    transform: translateY(0);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* Section spacing */
.section-spacing {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

@media (max-width: 768px) {
    .section-spacing {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Dark Mode Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(26, 42, 64, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(26, 42, 64, 0.4);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
}

[data-theme="dark"] .theme-toggle {
    background: #F2F2F2;
}

[data-theme="dark"] .theme-toggle svg {
    color: #1A2A40;
}

/* 3D Tilt Effect for Cards */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.tilt-card-inner {
    transform: translateZ(20px);
}

/* Disable tilt on mobile */
@media (max-width: 768px) {
    .tilt-card {
        transform: none !important;
    }
}
