/* 
* Illia Bilous - DevOps Engineer Portfolio
* Custom CSS Styles
*/

:root {
    /* Light Theme Variables - WCAG AA Compliant */
    --primary-color: #0056b3; /* Darker blue for better contrast */
    --primary-color-rgb: 0, 86, 179;
    --primary-color-hover: #004494;
    --secondary-color: #555555; /* Darker for better contrast */
    --background-color: #ffffff;
    --text-color: #333333; /* Darker for better contrast (4.5:1 ratio) */
    --card-bg: #ffffff;
    --card-bg-hover: #f8f9fa;
    --section-bg: #f8f9fa;
    --border-color: #c8cfd6; /* Darker for better visibility */
    --shadow-color: rgba(0, 0, 0, 0.15);
    --hover-color: #f1f3f5;
    --progress-bg: #e9ecef;
    --progress-color: #0056b3;
    --icon-color: #0056b3;
    --heading-color: #004494; /* Darker for better contrast */
    --subheading-color: #444444; /* Darker for better contrast */
    --muted-text: #595959; /* Darker for better contrast (4.5:1 ratio) */
    --btn-text: #ffffff;
    --modal-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #adb5bd; /* Darker for better contrast */
    --footer-bg: #212529;
    --footer-text: #f8f9fa;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.12);
    --link-color: #0056b3; /* Accessible link color */
    --link-hover-color: #003d7a; /* Darker on hover */
    --error-color: #b30000; /* Accessible error color */
    --success-color: #006600; /* Accessible success color */

    /* Accent colors for light theme */
    --accent-color-1: #6200ee; /* Purple - WCAG AA compliant */
    --accent-color-2: #c30052; /* Pink - WCAG AA compliant */
    --accent-color-3: #0077cc; /* Light Blue - WCAG AA compliant */

    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --heading-font-weight: 700;
    --body-font-weight: 400;
    --body-line-height: 1.6;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-sm: 0.875rem;
    --letter-spacing: 0.01em;

    /* Spacing */
    --section-spacing: 5rem;
    --element-spacing: 1.5rem;
    --card-padding: 1.5rem;

    /* Border Radius */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-circle: 50%;

    /* Animation Speeds */
    --transition-speed: 0.3s;
    --transition-speed-fast: 0.15s;
    --transition-speed-slow: 0.5s;

    /* Focus state */
    --focus-ring-color: rgba(0, 86, 179, 0.5);
    --focus-ring-width: 3px;

    /* Performance optimizations */
    --gpu-acceleration: translateZ(0);
    --will-change-transform: transform;
    --will-change-opacity: opacity;

    /* Loading and skeleton animations */
    --skeleton-bg: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    --skeleton-animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Dark Theme Variables - WCAG AA Compliant */
[data-theme="dark"] {
    /* Primary colors */
    --primary-color: #4cc9f0; /* Brighter cyan for better contrast on dark backgrounds */
    --primary-color-rgb: 76, 201, 240;
    --primary-color-hover: #7ad7f5;

    /* Text and background colors */
    --background-color: #121212; /* Dark background */
    --text-color: #f0f0f0; /* Light text for contrast (min 4.5:1 ratio) */
    --secondary-color: #bfbfbf; /* Lighter for better contrast */
    --muted-text: #cccccc; /* Lighter for better contrast (min 4.5:1 ratio) */

    /* Card and section backgrounds */
    --card-bg: #1f1f1f;
    --card-bg-hover: #2a2a2a;
    --section-bg: #1a1a1a;
    --bg-light: #1a1a1a; /* Override Bootstrap's bg-light in dark mode */

    /* Borders and shadows */
    --border-color: #3a3a3a; /* Lighter for better visibility */
    --shadow-color: rgba(0, 0, 0, 0.5);
    --hover-color: #333333;

    /* Progress bar */
    --progress-bg: #2c2c2c;
    --progress-color: #4cc9f0;
    --progress-glow: rgba(76, 201, 240, 0.5);

    /* Icons and headings */
    --icon-color: #4cc9f0;
    --heading-color: #4cc9f0; /* Bright cyan for headings */
    --subheading-color: #e9ecef;

    /* UI elements */
    --btn-text: #ffffff;
    --modal-bg: #1e1e1e;
    --input-bg: #2c2c2c;
    --input-border: #555555; /* Lighter for better contrast */
    --footer-bg: #0a0a0a;
    --footer-text: #f8f9fa;
    --btn-secondary-bg: #2a2a2a;
    --btn-secondary-border: #4a4a4a; /* Lighter for better contrast */
    --btn-secondary-text: #f5f5f5;
    --link-color: #4cc9f0; /* Accessible link color for dark theme */
    --link-hover-color: #7ad7f5; /* Lighter on hover */
    --error-color: #ff6b6b; /* Accessible error color for dark theme */
    --success-color: #4ade80; /* Accessible success color for dark theme */

    /* Accent colors - WCAG AA compliant for dark backgrounds */
    --accent-color-1: #c084fc; /* Purple - brighter for dark theme */
    --accent-color-2: #fb7185; /* Pink - brighter for dark theme */
    --accent-color-3: #38bdf8; /* Light Blue - brighter for dark theme */

    /* Shadows */
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.4);

    /* Focus state */
    --focus-ring-color: rgba(76, 201, 240, 0.5);
    --focus-ring-width: 3px;

    /* Loading and skeleton animations for dark theme */
    --skeleton-bg: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
}

/* Skeleton Loading Animations */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: var(--skeleton-bg);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: var(--skeleton-animation);
    border-radius: var(--border-radius-sm);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-circle);
}

/* Image loading states */
img.loaded {
    opacity: 1;
    transition: opacity var(--transition-speed) ease-in-out;
}

img.skeleton {
    opacity: 0.7;
}

img.error {
    opacity: 0.5;
    filter: grayscale(100%);
}

/* Modern UI Enhancements */
.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
    transform: var(--gpu-acceleration);
}

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

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

/* Enhanced focus states */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
    transform: translateY(-1px);
}

/* Smooth page transitions */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Global Styles */
body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    scroll-behavior: smooth;
    overflow-x: hidden;
    line-height: var(--body-line-height);
    font-weight: var(--body-font-weight);
    cursor: default;
}

/* REMOVED: Custom cursor styles
   Custom cursor has been deprecated as per requirements.
   Native system cursor is now used throughout the site. */

/* Micro-interactions for interactive elements */
a, .nav-link, .social-icons a, .navbar-brand {
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
}

a::after, .nav-link::after, .social-icons a::after, .navbar-brand::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

a:hover::after, .nav-link:hover::after, .social-icons a:hover::after, .navbar-brand:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Override Bootstrap's bg-light in dark mode */
[data-theme="dark"] .bg-light {
    background-color: var(--bg-light) !important;
}

/* Override Bootstrap's btn-secondary in dark mode */
[data-theme="dark"] .btn-secondary {
    background-color: var(--btn-secondary-bg);
    border-color: var(--btn-secondary-border);
    color: var(--btn-secondary-text);
}

/* Override Bootstrap's modal in dark mode */
[data-theme="dark"] .modal-content {
    background-color: var(--modal-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Smooth theme transition */
body.theme-transition,
body.theme-transition * {
    transition: all 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--heading-font-weight);
    color: var(--heading-color);
    margin-bottom: var(--element-spacing);
    line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { 
    font-size: 1.5rem;
    color: var(--subheading-color);
}
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--heading-color);
}

.section-heading {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--heading-color);
    font-weight: var(--heading-font-weight);
}

.divider {
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    margin: 0 auto 2rem;
    border: none;
    opacity: 1;
    border-radius: var(--border-radius-sm);
}

/* Navbar Styles */
.navbar {
    padding: 1rem 0;
    background-color: var(--background-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
    position: relative;
}

/* Scroll progress indicator */
#scroll-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color-3));
    z-index: 1001;
    transition: width 0.1s ease;
}

[data-theme="light"] #scroll-progress {
    background: linear-gradient(90deg, var(--primary-color), #2979ff);
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.5);
}

[data-theme="dark"] #scroll-progress {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color-3), var(--accent-color-1));
    box-shadow: 0 0 10px var(--progress-glow);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    position: relative;
    overflow: hidden;
}

.navbar-brand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.navbar-brand:hover::after {
    transform: translateX(100%);
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    position: relative;
    transition: color var(--transition-speed), transform 0.3s ease;
}

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

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
}

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

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

#theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

#theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(var(--primary-color-rgb, 13, 110, 253), 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

#theme-toggle:hover {
    transform: rotate(15deg);
    color: var(--primary-color);
}

#theme-toggle:hover::before {
    width: 200%;
    height: 200%;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* Hero text styling for both themes */
.hero-title {
    color: #ffffff;
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.hero-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.35rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 2;
    line-height: 1.6;
}

/* Light theme specific hero text styling - Updated for better contrast */
[data-theme="light"] .hero-title {
    color: #ffffff; /* Pure white for maximum contrast */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow for legibility */
}

[data-theme="light"] .hero-subtitle {
    color: #fdfdfd; /* Near-white for maximum contrast */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow for legibility */
}

[data-theme="light"] .hero-text {
    color: #ffffff; /* Pure white for maximum contrast */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow for legibility */
}

/* Dark theme specific hero text styling with glow effect */
[data-theme="dark"] .hero-title {
    text-shadow: 0 0 20px rgba(0, 209, 255, 0.6), 0 0 40px rgba(0, 209, 255, 0.3), 0 2px 5px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .hero-subtitle {
    text-shadow: 0 0 15px rgba(84, 214, 255, 0.5), 0 0 30px rgba(84, 214, 255, 0.25), 0 2px 5px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .hero-text {
    text-shadow: 0 0 10px rgba(159, 122, 234, 0.4), 0 0 20px rgba(159, 122, 234, 0.2), 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* REMOVED: Scroll indicator
   Scroll down cue has been deprecated as per requirements. */

/* Particles container */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Light theme gradient background */
[data-theme="light"] .particles-container {
    background: linear-gradient(-45deg, #0d6efd, #0a4cca, #0d6efd, #2979ff);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

/* Dark theme gradient background */
[data-theme="dark"] .particles-container {
    background: linear-gradient(-45deg, #0a0a14, #101630, #1a1a2e, #16213e);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

/* Gradient animation */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Hero text fade in animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.hero-section .container {
    z-index: 2;
    position: relative;
}

/* About Section */
.profile-img-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: transform var(--transition-speed);
}

.profile-img-container:hover {
    transform: scale(1.05);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.profile-img-container:hover .profile-img {
    transform: scale(1.1);
}

/* About Text Animation Styles */
.about-text-container {
    position: relative;
    overflow: hidden;
}

.about-text-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
    transform: translateY(0);
    opacity: 1;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Initial state for animation - will be overridden by JS */
.about-text-wrapper {
    opacity: 0;
    transform: translateY(20px);
}

/* Clip path animation styles */
.about-text-wrapper.mask-reveal {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .about-text-wrapper {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
    }
}

/* Social icons animation for About section */
#about .social-icons {
    opacity: 0;
    transform: translateY(20px);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    #about .social-icons {
        opacity: 1 !important;
        transform: none !important;
    }
}

.social-icons a {
    color: var(--text-color);
    transition: color var(--transition-speed), transform var(--transition-speed);
    display: inline-block;
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

/* Skills Section */
.skill-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease, 
                background-color 0.3s ease;
    background-color: var(--card-bg);
    height: 100%;
    padding: var(--card-padding);
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 1;
    /* Performance optimizations */
    will-change: var(--will-change-transform);
    transform: var(--gpu-acceleration);
    backface-visibility: hidden;
}

.skill-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
    background-color: var(--card-bg-hover);
}

[data-theme="dark"] .skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
                rgba(77, 159, 255, 0.1) 0%, 
                rgba(159, 122, 234, 0.05) 50%, 
                rgba(246, 135, 179, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: var(--border-radius-md);
}

[data-theme="dark"] .skill-card:hover::before {
    opacity: 1;
}

/* Ensure icons are colored appropriately for each theme */
.skill-card i {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

[data-theme="light"] .skill-card i {
    color: #007bff !important; /* Solid blue for all icons in light theme as specified in requirements */
}

/* Card title (skill name) color for light theme */
[data-theme="light"] .skill-card .card-title {
    color: #007bff !important; /* Solid blue for all skill names in light theme as specified in requirements */
}

[data-theme="dark"] .skill-card i {
    /* All skill icons must be pure white in dark theme as specified in requirements */
    color: #ffffff !important;
}

/* Card title (skill name) color for dark theme */
[data-theme="dark"] .skill-card .card-title {
    color: #ffffff !important; /* Pure white for all skill names in dark theme as specified in requirements */
}

.skill-card:hover i {
    transform: scale(1.15) rotate(5deg);
}

.skill-level {
    margin-top: 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px;
    border-radius: var(--border-radius-md);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.skill-level:hover, .skill-level:focus {
    transform: translateY(-5px);
    background-color: rgba(var(--primary-color-rgb), 0.05);
    outline: none;
}

.skill-level:focus {
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.25);
}

.skill-percentage {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    min-width: 45px;
    text-align: right;
    transition: color 0.3s ease, transform 0.3s ease;
}

.skill-level:hover .skill-percentage,
.skill-level:focus .skill-percentage {
    color: var(--primary-color);
    transform: scale(1.1);
}

.progress {
    height: 12px;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    flex: 1;
    position: relative;
    margin-top: 5px;
}

/* Progress bar track colors for light and dark themes as specified in requirements */
[data-theme="light"] .progress {
    background-color: #e0e0e0; /* Light theme track color */
}

[data-theme="dark"] .progress {
    background-color: #2f2f2f; /* Dark theme track color */
}

.skill-bar__track {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.skill-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.skill-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

.skill-level:hover .skill-tooltip,
.skill-level:focus .skill-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Light theme progress bar - Updated as per requirements */
[data-theme="light"] .progress-bar {
    background: #007bff; /* Solid accent blue as specified in requirements */
    height: 100%;
    border-radius: 30px;
    transition: width 1s cubic-bezier(0.65, 0, 0.35, 1); /* Updated easing as specified */
    position: relative;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Dark theme progress bar - Updated as per requirements */
[data-theme="dark"] .progress-bar {
    background: #00d1ff; /* Accent cyan as specified in requirements */
    height: 100%;
    border-radius: 30px;
    transition: width 1s cubic-bezier(0.65, 0, 0.35, 1); /* Updated easing as specified */
    position: relative;
    box-shadow: 0 0 12px rgba(0, 209, 255, 0.5);
}

/* Bounce animation for progress bars when they finish filling */
@keyframes bounce-fill {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.02); }
}

/* Apply bounce animation when progress bar finishes filling */
.skill-bar__fill.progress-bar.filled {
    animation: bounce-fill 0.5s ease-in-out;
}

/* Animation for the gradient background */
@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Shine effect overlay */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
                rgba(255, 255, 255, 0) 0%, 
                rgba(255, 255, 255, 0.3) 50%, 
                rgba(255, 255, 255, 0) 100%);
    animation: shine 2.5s infinite;
}

/* Animation for the shine effect */
@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Initial state for animation */
.progress-bar.init {
    width: 0% !important;
}


/* Project Cards */
.project-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease, 
                background-color 0.3s ease;
    background-color: var(--card-bg);
    height: 100%;
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 1;
    /* Performance optimizations */
    will-change: var(--will-change-transform);
    transform: var(--gpu-acceleration);
    backface-visibility: hidden;
}

[data-theme="dark"] .project-card{
    color: white;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
    background-color: var(--card-bg-hover);
}

[data-theme="dark"] .project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
                rgba(77, 159, 255, 0.1) 0%,
                rgba(159, 122, 234, 0.05) 50%,
                rgba(246, 135, 179, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: var(--border-radius-md);
}

[data-theme="dark"] .project-card:hover::before {
    opacity: 1;
}

.project-card .badge {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.project-card:hover .badge {
    transform: translateY(-2px);
}

.project-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.project-card .card-body {
    padding: 1.5rem;
}

.project-card .card-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.tech-stack .badge {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Contact Form */
.contact-form {
    position: relative;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.contact-form .form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.contact-form .input-wrapper {
    position: relative;
    overflow: hidden;
}

.contact-form .form-control {
    background-color: var(--input-bg);
    border: 2px solid var(--input-border);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-speed);
    font-size: 1rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.contact-form .input-focus-effect {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color-3));
    transition: width 0.3s ease;
    z-index: 2;
}

.contact-form .form-control:focus ~ .input-focus-effect {
    width: 100%;
}

/* Light theme form styles */
[data-theme="light"] .contact-form .form-control {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .contact-form .form-control::placeholder {
    color: #6c757d; /* Improved contrast for light theme */
    opacity: 0.8;
}

/* Dark theme form styles */
[data-theme="dark"] .contact-form .form-control {
    background-color: #2c2c2c; /* Darker background for better contrast */
    border-color: #444;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .contact-form .form-control::placeholder {
    color: #d1d1d1; /* Much lighter placeholder for better contrast in dark theme */
    opacity: 0.9;
}

/* Focus states for form controls - Enhanced for accessibility */
.contact-form .form-control:focus {
    outline: none;
    transform: translateY(-2px);
    position: relative;
    z-index: 2;
}

[data-theme="light"] .contact-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color), inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .contact-form .form-control:focus {
    border-color: var(--accent-color-3);
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Enhanced focus styles for all interactive elements */
a:focus, button:focus, .btn:focus, input:focus, textarea:focus, select:focus,
.nav-link:focus, #theme-toggle:focus, .filter-btn:focus, .project-filter:focus,
.skill-card:focus-within, .project-card:focus-within {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: 2px;
    position: relative;
    z-index: 2;
}

/* Skip to content link for keyboard users */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 1001;
    transition: top 0.3s ease;
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
}

.skip-to-content:focus {
    top: 0;
    outline: none;
}

/* Form labels */
.contact-form .form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color var(--transition-speed), transform 0.3s ease;
    display: inline-block;
}

[data-theme="light"] .contact-form .form-label {
    color: var(--heading-color);
}

[data-theme="dark"] .contact-form .form-label {
    color: #ffffff; /* Pure white for maximum contrast */
}

.contact-form .form-control:focus ~ .form-label,
.contact-form .form-group:hover .form-label {
    transform: translateY(-2px);
}

/* Error message styling */
.contact-form .error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Invalid state */
.contact-form .form-control.is-invalid {
    border-color: #dc3545;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.contact-form .form-control.is-invalid ~ .error-message {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

[data-theme="light"] .contact-form .form-control.is-invalid {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .contact-form .form-control.is-invalid {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Form submit button enhancement */
.contact-form .submit-btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.contact-form .submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
                rgba(255, 255, 255, 0) 0%, 
                rgba(255, 255, 255, 0.2) 50%, 
                rgba(255, 255, 255, 0) 100%);
    transition: left 0.7s ease;
}

.contact-form .submit-btn:hover::before {
    left: 100%;
}

.contact-form .submit-btn:hover {
    transform: translateY(-5px);
}

.contact-form .btn-loader {
    display: inline-block;
}

.contact-form .spin {
    animation: spin 1s linear infinite;
}

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

[data-theme="light"] .contact-form .submit-btn {
    background: linear-gradient(135deg, var(--primary-color), #2979ff);
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

[data-theme="light"] .contact-form .submit-btn:hover {
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

[data-theme="dark"] .contact-form .submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color-3));
    border: none;
    box-shadow: 0 4px 15px rgba(84, 214, 255, 0.3);
}

[data-theme="dark"] .contact-form .submit-btn:hover {
    box-shadow: 0 6px 20px rgba(84, 214, 255, 0.4);
}

/* Form success and error alerts */
#formSuccess, #formError {
    padding: 1rem;
    border-radius: var(--border-radius-md);
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

#formSuccess {
    background-color: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.2);
    color: #198754;
}

#formError {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

[data-theme="dark"] #formSuccess {
    background-color: rgba(25, 135, 84, 0.2);
    border: 1px solid rgba(25, 135, 84, 0.3);
    color: #2dd4bf;
}

[data-theme="dark"] #formError {
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #f87171;
}

/* Alert animations */
#formSuccess.animate__animated,
#formError.animate__animated {
    animation-duration: 0.5s;
}

#formSuccess.animate__fadeIn,
#formError.animate__fadeIn {
    animation-name: alertFadeIn;
}

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

/* Pulse animation for alerts */
#formSuccess::after,
#formError::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.5; }
    100% { opacity: 0; transform: scale(1.5); }
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
}

footer .social-icons a {
    color: var(--footer-text);
}

footer .social-icons a:hover {
    color: var(--primary-color);
}

/* Scroll to Top Button */
#scrollToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed), visibility var(--transition-speed), transform var(--transition-speed);
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#scrollToTop.visible {
    opacity: 1;
    visibility: visible;
}

#scrollToTop:hover {
    transform: translateY(-5px);
}

/* Modal Styles */
.modal-content {
    background-color: var(--modal-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* Custom Button Styles with Enhanced Interactions */
.btn {
    border-radius: var(--border-radius-md);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Button ripple effect */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
    z-index: -1;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* Button glow effect on hover */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(var(--primary-color-rgb), 0.8) 0%, rgba(var(--primary-color-rgb), 0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: var(--border-radius-md);
    pointer-events: none;
}

.btn:hover::before {
    opacity: 0.15;
}

/* Enhanced ripple animation */
@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Primary button styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--btn-text);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-color-hover);
    border-color: var(--primary-color-hover);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Outline button styles */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
    position: relative;
    z-index: 1;
}

.btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: var(--border-radius-md);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: -1;
}

.btn-outline-primary:hover {
    color: var(--btn-text);
    border-color: var(--primary-color);
    background-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

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

/* Dark theme button enhancements */
[data-theme="dark"] .btn-primary {
    box-shadow: 0 4px 15px rgba(0, 209, 255, 0.3);
}

[data-theme="dark"] .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 209, 255, 0.4);
}

[data-theme="dark"] .btn-outline-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 209, 255, 0.4);
}

/* Button text animation on hover */
.btn span {
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn:hover span {
    transform: translateX(3px);
}

/* Button icon animation */
.btn i {
    transition: transform 0.3s ease;
    display: inline-block;
}

.btn:hover i {
    transform: translateX(3px) scale(1.1);
}

/* Learn More button specific styling - Updated for better visibility */
.scroll-btn {
    background-color: #007bff !important; /* Solid accent blue as specified in requirements */
    color: #ffffff !important; /* White text for maximum contrast */
    border-color: #007bff !important;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3) !important; /* Enhanced shadow for better visibility */
    transition: all 150ms ease !important; /* Brief 150ms transition as specified */
}

.scroll-btn:hover {
    background-color: #0056b3 !important; /* Darker background on hover as specified */
    border-color: #0056b3 !important;
    transform: scale(1.03) !important; /* Scale effect on hover as specified */
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.4) !important; /* Enhanced shadow on hover */
}

/* Filter and category buttons special effects */
.filter-btn, .project-filter {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-btn::after, .project-filter::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.filter-btn:hover::after, .project-filter:hover::after,
.filter-btn.active::after, .project-filter.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.filter-btn.active, .project-filter.active {
    background-color: var(--primary-color);
    color: var(--btn-text);
    transform: translateY(-2px);
}

/* Pulse animation for active buttons */
.filter-btn.active::before, .project-filter.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    border-radius: var(--border-radius-md);
    z-index: -1;
    animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

/* Responsive Adjustments - Enhanced for better mobile experience */
@media (max-width: 992px) {
    /* Typography adjustments */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }

    /* Navbar adjustments */
    .navbar-collapse {
        background-color: var(--background-color);
        padding: 1rem;
        border-radius: var(--border-radius-md);
        box-shadow: 0 5px 15px var(--shadow-color);
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Improve tap targets for mobile */
    .nav-link, .btn, .filter-btn, .project-filter {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
    }

    /* Adjust spacing for mobile */
    section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    /* Adjust card layouts */
    .skill-card, .project-card {
        margin-bottom: 1.5rem;
    }

    /* Disable hover effects on touch devices */
    .skill-card:hover, .project-card:hover {
        transform: none;
        box-shadow: var(--card-shadow);
    }

    /* Adjust button hover effects for touch */
    .btn:hover {
        transform: none;
    }

    /* Custom cursor not needed on touch devices */
    .custom-cursor {
        display: none;
    }

    /* Adjust form layout */
    .contact-form .form-control {
        padding: 0.875rem 1rem;
    }
}

@media (max-width: 768px) {
    /* Profile image adjustments */
    .profile-img-container {
        width: 200px;
        height: 200px;
        margin-bottom: 2rem;
    }

    /* Hero section adjustments */
    .hero-section h1 {
        font-size: 2.25rem;
    }

    .hero-section h2 {
        font-size: 1.5rem;
    }

    .hero-section .hero-text {
        font-size: 1.1rem;
    }

    /* Adjust button sizes for better tap targets */
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Adjust filter buttons layout */
    .skill-categories, .project-filters {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-btn, .project-filter {
        margin: 0.25rem;
        flex: 0 0 auto;
    }

    /* Improve form layout on tablets */
    .contact-form .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .contact-form [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 576px) {
    /* Further reduce sizes for small screens */
    .profile-img-container {
        width: 150px;
        height: 150px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section h2 {
        font-size: 1.25rem;
    }

    .section-heading {
        font-size: 2rem;
    }

    /* Adjust padding for small screens */
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Stack filter buttons on very small screens */
    .filter-btn, .project-filter {
        margin: 0.25rem 0.125rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Adjust card padding */
    .card-body {
        padding: 1.25rem;
    }

    /* Improve form usability on small screens */
    .contact-form .form-label {
        font-size: 0.9375rem;
    }

    .contact-form .form-control {
        font-size: 0.9375rem;
    }

    /* Adjust scroll to top button position */
    #scrollToTop {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* Accessibility-specific media query */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
