/* Custom properties for colors (Dark Mode by default) */
:root {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-card: #4a5568;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e0;
    --text-highlight: #6366f1;
    /* Indigo */
    --text-yellow: #facc15;
    /* Yellow */
    --text-green: #34d399;
    /* Green */
    --text-red: #ef4444;
    /* Red */
    --border-color: #4a5568;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --modal-bg: #2d3748;
    --modal-shadow: rgba(0, 0, 0, 0.5);
    --spinner-color: #6366f1;
    --filter-inactive-bg: #4a5568;
    --filter-inactive-text: #cbd5e0;
    --skeleton-bg: #374151;
    /* Darker grey for skeleton */
    /* --cursor-trail-color: #6366f1; /* Removed cursor trail color */
}

/* Light Mode properties */
body.light-mode {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #f9f9f9;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-highlight: #4f46e5;
    /* Darker Indigo */
    --text-yellow: #d97706;
    /* Darker Yellow */
    --text-green: #059669;
    /* Darker Green */
    --text-red: #dc2626;
    /* Darker Red */
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --modal-bg: #ffffff;
    --modal-shadow: rgba(0, 0, 0, 0.2);
    --spinner-color: #4f46e5;
    --filter-inactive-bg: #e2e8f0;
    --filter-inactive-text: #4a5568;
    --skeleton-bg: #e5e7eb;
    /* Lighter grey for skeleton */
    /* --cursor-trail-color: #4f46e5; /* Removed cursor trail color in light mode */
}


/* Apply variables */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.5s ease, color 0.5s ease;
    /* Removed: cursor: none; */
}

/* Removed: Custom Cursor Trail styles */
/*
#cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    background-color: var(--cursor-trail-color);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out, opacity 0.1s ease-out, background-color 0.5s ease;
    z-index: 9999;
    opacity: 0;
    will-change: transform, opacity;
}
*/

/* Ensure default cursor is visible on interactive elements */
a,
button,
input,
textarea,
.cursor-pointer {
    cursor: pointer !important;
}


.section-bg-pattern-1 {
    background-image: radial-gradient(circle at 10% 20%, rgba(30, 64, 175, 0.05) 0%, rgba(30, 64, 175, 0.01) 90%),
        radial-gradient(circle at 90% 80%, rgba(79, 70, 229, 0.05) 0%, rgba(79, 70, 229, 0.01) 90%);
    background-size: 150% 150%;
    background-attachment: fixed;
    /* Parallax effect */
    animation: backgroundPan 30s linear infinite alternate;
}

.section-bg-pattern-2 {
    background-image: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%),
        url('data:image/svg+xml,%3Csvg width="6" height="6" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%234a5568" fill-opacity="0.1" fill-rule="evenodd"%3E%3Cpath d="M5 0h1L0 6V5zM6 5v1H0z"/%3E%3C/g%3E%3C/svg%3E');
    background-size: 100% 100%, 6px 6px;
    background-attachment: fixed;
    /* Parallax effect */
    animation: backgroundPan 25s linear infinite reverse;
}

/* Micro-interactions: Button/Link active states */
button:active,
a:active {
    transform: scale(0.98);
    transition: transform 0.1s ease-out;
}

/* Ensure hover transform is not overridden by active */
button:hover,
a:hover {
    transform: scale(1.05);
    /* Example hover scale */
}


@keyframes backgroundPan {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    /* Larger title */
    font-weight: 700;
    /* Bold */
    color: var(--text-primary);
    /* Even lighter for titles */
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 60%;
    height: 4px;
    background-color: var(--text-highlight);
    /* Indigo accent for dark theme */
    border-radius: 9999px;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    /* Darker track */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    /* Darker thumb */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

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

    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 zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-90deg) scale(0.5);
    }

    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes particleMove {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }

    25% {
        transform: translate(20vw, 15vh) scale(1.2);
        opacity: 0.6;
    }

    50% {
        transform: translate(40vw, -10vh) scale(0.8);
        opacity: 0.4;
    }

    75% {
        transform: translate(60vw, 20vh) scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: translate(80vw, -5vh) scale(0.9);
        opacity: 0.5;
    }
}

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

    100% {
        transform: rotate(360deg);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.8), 0 0 20px rgba(99, 102, 241, 0.6);
    }

    100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.4);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fillProgress {
    from {
        width: 0%;
    }

    to {
        width: var(--progress-width);
    }
}

/* New: Skeleton Loading Animation */
@keyframes pulse {
    0% {
        background-color: var(--skeleton-bg);
    }

    50% {
        background-color: color-mix(in srgb, var(--skeleton-bg) 80%, var(--bg-card));
    }

    /* Lighter pulse */
    100% {
        background-color: var(--skeleton-bg);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-slide-left.is-visible {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right.is-visible {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-fade-in.is-visible {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-zoom-in.is-visible {
    animation: zoomIn 0.8s ease-out forwards;
}

.animate-rotate-in.is-visible {
    animation: rotateIn 0.8s ease-out forwards;
}

.animate-pop-in.is-visible {
    animation: popIn 0.5s ease-out forwards;
}

.skill-progress.is-visible {
    animation: fillProgress 1.5s ease-out forwards;
}

/* Skeleton Loader Styles */
.skeleton-loader {
    background-color: var(--skeleton-bg);
    animation: pulse 1.5s infinite ease-in-out;
    border-radius: 0.5rem;
    /* Match card border radius */
}

.article-image-placeholder {
    width: 100%;
    height: 48px;
    /* Match image height */
    margin-bottom: 0.5rem;
}

.project-image-placeholder,
.modal-image-placeholder {
    width: 100%;
    height: 192px;
    /* Match image height */
    margin-bottom: 1.5rem;
}


/* Modal specific styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--modal-bg);
    color: var(--text-primary);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px var(--modal-shadow);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.modal-overlay.is-visible .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* Loading Spinner Styles */
.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid var(--spinner-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

/* CSS Particles for Hero Section */
.particles-container {
    overflow: hidden;
}

.particles-container div {
    position: absolute;
    border-radius: 50%;
    animation: particleMove infinite alternate;
    filter: blur(2px);
    pointer-events: none;
    z-index: -1;
}

/* Hover effects for cards */
.service-card:hover,
.skill-card:hover,
.project-card:hover,
.testimonial-card:hover,
.certification-card:hover,
.article-card:hover,
.note-card:hover {
    /* Added note-card */
    box-shadow: 0 0 20px var(--text-highlight);
}

/* New section card styles */
.certification-card,
.article-card,
.note-card {
    /* Added note-card */
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    box-shadow: 0 4px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s ease-in-out;
}

.article-card img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

/* Testimonial Carousel Styles */
#testimonials-carousel {
    display: flex;
    transition: transform 0.5s ease-in-out;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.testimonial-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 100%;
}

#testimonial-prev,
#testimonial-next {
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 50%;
    transition: background-color 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

#testimonial-prev,
#testimonial-next {
    background-color: var(--filter-inactive-bg);
    color: var(--text-primary);
}

#testimonial-prev:hover,
#testimonial-next:hover {
    background-color: var(--text-highlight);
}

#testimonial-dots .dot {
    background-color: var(--filter-inactive-bg);
}

#testimonial-dots .dot.active {
    background-color: var(--text-highlight);
}

/* Project filter buttons */
.filter-btn {
    background-color: var(--filter-inactive-bg);
    color: var(--filter-inactive-text);
}

.filter-btn:hover {
    background-color: var(--text-highlight);
    color: var(--text-primary);
}

.filter-btn.active-filter {
    background-color: var(--text-highlight);
    color: var(--text-primary);
}

/* Contact form validation error messages */
.error-message {
    color: var(--text-red);
}

/* Three.js Canvas Styling */
#three-js-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #1a202c;
    /* Dark background for the 3D scene */
}