/* Modern Animations and Interactive Effects */

/* ===== Custom Properties ===== */
:root {
    /* New elegant color palette */
    --accent-primary: #06b6d4;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #10b981;
    --gradient-primary: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%);
    --gradient-secondary: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    --gradient-dark: linear-gradient(180deg, #030712 0%, #0f172a 50%, #030712 100%);
    --gradient-glow: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(6, 182, 212, 0.3);
    --shadow-glow: 0 0 40px rgba(6, 182, 212, 0.25);
    --shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.25);
    --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.3);
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.2);
    --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Smooth Scrolling ===== */
html {
    scroll-behavior: smooth;
}

/* ===== Page Loading Animation ===== */
body {
    opacity: 1;
    transition: opacity 0.3s ease;
}

body.page-loading {
    opacity: 0;
}

/* ===== Fade In Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

/* ===== Scale Animations ===== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* ===== Gradient Animation ===== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===== Glow Animation ===== */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 74, 173, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(73, 200, 255, 0.6);
    }
}

/* ===== Typing Effect ===== */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 100% {
        border-color: transparent;
    }
    50% {
        border-color: #fff;
    }
}

/* ===== Animation Classes ===== */
.animate-fade-in {
    animation: fadeIn 0.8s var(--transition-smooth) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s var(--transition-smooth) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s var(--transition-smooth) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s var(--transition-smooth) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s var(--transition-smooth) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s var(--transition-bounce) forwards;
}

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

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

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

/* ===== Stagger Animations ===== */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ===== Enhanced Navbar ===== */
#mainNav {
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s var(--transition-smooth);
}

#mainNav.scrolled {
    background: rgba(3, 7, 18, 0.98) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

#mainNav .nav-link {
    position: relative;
    transition: all 0.25s var(--transition-smooth);
    padding: 0.5rem 1rem !important;
}

#mainNav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all 0.25s var(--transition-smooth);
    transform: translateX(-50%);
}

#mainNav .nav-link:hover::after,
#mainNav .nav-link.active::after {
    width: 80%;
}

#mainNav .nav-link:hover {
    color: #22d3ee !important;
    transform: translateY(-2px);
}

#mainNav .navbar-brand:hover {
    transform: scale(1.05);
    transition: transform 0.25s var(--transition-bounce);
}

/* ===== Hero Section Enhanced ===== */
.hero-modern {
    position: relative;
    background: var(--gradient-dark);
    overflow: hidden;
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    animation: float 10s ease-in-out infinite;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    background: linear-gradient(135deg, #ffffff 0%, #22d3ee 50%, #8b5cf6 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Fallback color for accessibility when CSS is disabled or gradients unsupported */
    color: #06b6d4;
    animation: gradientShift 5s ease infinite;
}

/* ===== Glass Morphism Cards ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transition: all 0.3s var(--transition-smooth);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
    border-color: var(--glass-border-hover);
    background: var(--glass-bg-hover);
}

/* ===== Modern Cards ===== */
.card {
    transition: all 0.3s var(--transition-smooth);
    border-radius: 20px !important;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-soft);
}

.card-body {
    transition: all 0.3s var(--transition-smooth);
}

/* ===== Enhanced Buttons ===== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--transition-smooth);
    border-radius: 12px !important;
}

.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 var(--transition-smooth);
}

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

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 74, 173, 0.4);
}

.btn-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* ===== Stats Section ===== */
.stat-item {
    transition: all 0.4s var(--transition-smooth);
}

.stat-item:hover {
    transform: scale(1.1);
}

.stat-item .bs-icon {
    transition: all 0.4s var(--transition-smooth);
}

.stat-item:hover .bs-icon {
    animation: pulse 0.6s ease;
    box-shadow: var(--shadow-glow);
}

.stat-number {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== Testimonial Cards ===== */
.testimonial-card {
    position: relative;
    transition: all 0.4s var(--transition-smooth);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 60px;
    color: rgba(0, 74, 173, 0.2);
    font-family: Georgia, serif;
}

.testimonial-card:hover {
    transform: translateY(-10px) rotateX(2deg);
    box-shadow: var(--shadow-soft);
}

/* ===== Service Cards ===== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s var(--transition-smooth);
}

.service-card:hover::after {
    transform: scaleX(1);
}

/* ===== Project Cards ===== */
.project-item {
    transition: all 0.4s var(--transition-smooth);
}

.project-item:hover {
    transform: translateX(10px);
}

.project-item .bs-icon {
    transition: all 0.4s var(--transition-bounce);
}

.project-item:hover .bs-icon {
    transform: rotate(360deg) scale(1.1);
    background: var(--gradient-primary) !important;
}

/* ===== Progress Bars ===== */
.progress {
    height: 10px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: var(--gradient-primary) !important;
    transition: width 1.5s var(--transition-smooth);
}

/* ===== Icon Animations ===== */
.bs-icon {
    transition: all 0.3s var(--transition-smooth);
}

.bs-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

/* ===== Footer Enhanced ===== */
footer {
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.5), transparent);
}

footer a {
    transition: all 0.25s var(--transition-smooth);
}

footer a:hover {
    color: #22d3ee !important;
    transform: translateX(5px);
    display: inline-block;
}

footer .list-inline-item a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.3s var(--transition-smooth);
}

footer .list-inline-item a:hover {
    background: var(--gradient-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

/* ===== Section Animations ===== */
section {
    position: relative;
}

.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 74, 173, 0.5), transparent);
    margin: 0 auto;
    width: 80%;
}

/* ===== Scroll Reveal Classes ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition-smooth);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Image Hover Effects ===== */
.img-hover-zoom {
    overflow: hidden;
    border-radius: 15px;
}

.img-hover-zoom img {
    transition: transform 0.5s var(--transition-smooth);
}

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

/* ===== Contact Icons ===== */
.contact-icon {
    transition: all 0.3s var(--transition-bounce);
}

.contact-icon:hover {
    transform: scale(1.1) rotate(3deg);
}

/* ===== Gradient Text ===== */
.gradient-text {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Fallback color for accessibility when CSS is disabled or gradients unsupported */
    color: #06b6d4;
}

/* ===== Background Particles Effect ===== */
.particles-bg {
    position: relative;
}

.particles-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, rgba(6, 182, 212, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    animation: float 25s linear infinite;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation: fadeInUp 0.8s var(--transition-smooth) forwards;
    }
    
    .glass-card:hover,
    .card:hover {
        transform: translateY(-4px);
    }
}

/* ===== Custom Cursor ===== */
/* Simplified cursor for better performance - less lag */
.custom-cursor {
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-primary, #06b6d4);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    /* Remove heavy transitions for instant response */
    transition: width 0.15s ease, height 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    will-change: left, top;
    backface-visibility: hidden;
}

.custom-cursor-dot {
    width: 4px;
    height: 4px;
    background: var(--accent-primary, #06b6d4);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    will-change: left, top;
    backface-visibility: hidden;
}

.custom-cursor.hover {
    width: 40px;
    height: 40px;
    background-color: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-secondary, #8b5cf6);
}

.custom-cursor.clicking {
    width: 18px;
    height: 18px;
    background-color: rgba(139, 92, 246, 0.2);
}

/* Hide default cursor when custom cursor is active */
body.custom-cursor-active {
    cursor: none;
}

body.custom-cursor-active a,
body.custom-cursor-active button,
body.custom-cursor-active input,
body.custom-cursor-active textarea,
body.custom-cursor-active [role="button"],
body.custom-cursor-active .btn {
    cursor: none;
}

/* Disable custom cursor on touch devices */
@media (pointer: coarse) {
    .custom-cursor,
    .custom-cursor-dot {
        display: none !important;
    }
    
    body.custom-cursor-active {
        cursor: auto;
    }
    
    body.custom-cursor-active a,
    body.custom-cursor-active button,
    body.custom-cursor-active input,
    body.custom-cursor-active textarea,
    body.custom-cursor-active [role="button"],
    body.custom-cursor-active .btn {
        cursor: auto;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .custom-cursor,
    .custom-cursor-dot {
        display: none !important;
    }
}

/* ===== Dark Theme Body Styles ===== */
[data-bs-theme="dark"] body,
body {
    background: linear-gradient(180deg, #030712 0%, #0f172a 50%, #030712 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

/* Ensure all sections have proper dark background */
section {
    background-color: transparent;
}

/* Section with light background override to dark */
[data-bs-theme="dark"] section:not(.bg-dark):not(.particles-bg) {
    background-color: #0f172a;
}

/* Cards with proper dark styling */
[data-bs-theme="dark"] .card {
    background-color: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .card-subtitle {
    color: #ffffff;
}

[data-bs-theme="dark"] .card-text {
    color: #94a3b8;
}

[data-bs-theme="dark"] .card-footer {
    background-color: rgba(15, 23, 42, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Text color fixes for dark theme */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #f8fafc;
}

[data-bs-theme="dark"] p {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* Dark theme for non-dark sections */
[data-bs-theme="dark"] .photo-gallery {
    background-color: #0f172a;
}

/* Fix progress bars */
[data-bs-theme="dark"] .progress {
    background-color: rgba(15, 23, 42, 0.8);
}

/* Fix for card body backgrounds */
[data-bs-theme="dark"] .card-body.bg-dark {
    background-color: rgba(15, 23, 42, 0.9);
}

/* Ensure all bg-dark sections are consistent */
[data-bs-theme="dark"] .bg-dark {
    background-color: #030712 !important;
}

/* Fix navbar background */
[data-bs-theme="dark"] #mainNav {
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

/* Fix footer */
[data-bs-theme="dark"] footer.bg-dark {
    background-color: #030712 !important;
}

/* Fix links in dark theme */
[data-bs-theme="dark"] footer a {
    color: #94a3b8;
}

[data-bs-theme="dark"] footer a:hover {
    color: #22d3ee !important;
}

/* Fix list items */
[data-bs-theme="dark"] .list-unstyled li a {
    color: #94a3b8;
}

[data-bs-theme="dark"] .list-unstyled li a:hover {
    color: #22d3ee !important;
}
