/* Custom CSS Animations and Styles */

/* Preloader Styles */
.loader {
    width: 60px;
    height: 60px;
    border: 4px solid #1a1a2e;
    border-top: 4px solid #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.loader::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid transparent;
    border-top: 2px solid #00d4aa;
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

.typing-preloader {
    overflow: hidden;
    border-right: 2px solid #00d4aa;
    white-space: nowrap;
    width: fit-content;
    margin: 0 auto;
    animation: blink-caret .75s step-end infinite;
}

.preloader-fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    width: 24px;
    height: 18px;
    position: relative;
    cursor: pointer;
}

.hamburger-line {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-line:nth-child(1) {
    top: 0;
}

.hamburger-line:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-line:nth-child(3) {
    bottom: 0;
}

/* Hamburger Animation */
.hamburger-active .hamburger-line:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.hamburger-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateY(-50%) scale(0);
}

.hamburger-active .hamburger-line:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Mobile Menu Animations */
.mobile-menu-open {
    opacity: 1 !important;
    visibility: visible !important;
}

.mobile-nav-link {
    transition: all 0.3s ease-out;
}

/* Enhanced Navigation Styles */
.nav-link.active {
    color: #00d4aa;
}

.nav-link.active .absolute {
    opacity: 1;
    transform: scale(1);
}

.nav-link.active .h-0\.5 {
    width: 100%;
    left: 0;
}

/* Logo Gradient Animation */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.logo-gradient {
    background: linear-gradient(-45deg, #00d4aa, #1a1a2e, #00d4aa, #16213e);
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navbar Scroll Effects */
.navbar-scrolled {
    background: rgba(15, 15, 35, 0.95);
    border-bottom: 1px solid rgba(0, 212, 170, 0.2);
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.1);
}

/* Mobile Navigation Enhancements */
.mobile-nav-link {
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.1), transparent);
    transition: left 0.5s ease;
}

.mobile-nav-link:hover::before {
    left: 100%;
}

/* CTA Button Enhancements */
.cta-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.cta-button::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;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    box-shadow: 0 6px 25px rgba(0, 212, 170, 0.4);
    transform: translateY(-2px) scale(1.05);
}

/* Scroll Progress Bar */
.scroll-progress {
    width: 0%;
    transition: width 0.1s ease-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@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 typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #00d4aa;
    }
}

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

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

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #00d4aa;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00b894;
}

/* Selection Color */
::selection {
    background: #00d4aa;
    color: #0f0f23;
}

/* Smooth Scroll for Firefox */
html {
    scroll-behavior: smooth;
}

/* Custom Typing Animation */
.typing-name {
    overflow: hidden;
    border-right: 3px solid #00d4aa;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .15em;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

.typing-role {
    opacity: 0;
    animation: fadeIn 1s ease-out 2s forwards;
}

/* Navigation Animations */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #00d4aa;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Button Animations */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before, .btn-secondary::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;
}

.btn-primary:hover::before, .btn-secondary:hover::before {
    left: 100%;
}

/* Enhanced Card Hover Effects */
.project-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.15), transparent);
    transition: left 0.8s ease-out;
    z-index: 1;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 170, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s ease-out;
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 212, 170, 0.1);
}

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

.project-card:hover::after {
    opacity: 1;
}

.project-card > * {
    position: relative;
    z-index: 2;
}

.skill-card {
    position: relative;
    cursor: pointer;
}

.skill-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 212, 170, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.skill-card:hover::after {
    width: 200%;
    height: 200%;
}

/* Skill Progress Bar Animation */
.skill-card:hover .bg-primary {
    animation: progress-pulse 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, #00d4aa 0%, #00ffcc 50%, #00d4aa 100%);
    background-size: 200% 100%;
}

@keyframes progress-pulse {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Social Link Animations */
.social-link {
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00d4aa;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.social-link:hover::before {
    transform: translateY(0);
}

.social-link i {
    position: relative;
    z-index: 1;
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #00d4aa;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Glitch Effect for Hero Text */
.glitch {
    position: relative;
    color: #00d4aa;
    font-size: 4rem;
    font-weight: bold;
    text-transform: uppercase;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-anim 0.5s infinite linear alternate-reverse;
    color: #ff0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch-anim2 1s infinite linear alternate-reverse;
    color: #00ff00;
    z-index: -2;
}

@keyframes glitch-anim {
    0% {
        clip: rect(42px, 9999px, 44px, 0);
        transform: skew(0.85deg);
    }
    5% {
        clip: rect(12px, 9999px, 59px, 0);
        transform: skew(0.04deg);
    }
    10% {
        clip: rect(48px, 9999px, 29px, 0);
        transform: skew(0.7deg);
    }
    /* Additional keyframes truncated for brevity */
    100% {
        clip: rect(25px, 9999px, 99px, 0);
        transform: skew(0.30deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .typing-name {
        font-size: 2.5rem;
    }
    
    .project-card {
        margin-bottom: 2rem;
    }
    
    .skill-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .typing-name {
        font-size: 2rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Focus States for Accessibility */
button:focus,
input:focus,
textarea:focus,
a:focus {
    outline: 2px solid #00d4aa;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bg-accent\\/30 {
        background-color: rgba(22, 33, 62, 0.8);
    }
    
    .text-gray-300 {
        color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .typing-name {
        animation: none;
        border-right: none;
    }
}

/* Custom Utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
}

.gradient-border {
    position: relative;
    background: linear-gradient(45deg, #00d4aa, #1a1a2e);
    padding: 2px;
    border-radius: 8px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: #16213e;
    border-radius: 6px;
    z-index: -1;
}

/* Animation Delays for Staggered Effects */
.animate-on-scroll:nth-child(1) { animation-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { animation-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { animation-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { animation-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { animation-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { animation-delay: 0.6s; }

/* Enhanced Animation Classes */
.animate-slideInUp {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.animate-slideInDown {
    animation: slideInDown 0.8s ease-out forwards;
}

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

.animate-bounceIn {
    animation: bounceIn 0.8s ease-out forwards;
}

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

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #1a1a2e 25%, #16213e 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Hover Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 212, 170, 0.15);
}

/* Glass Morphism Effects */
.glass {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 170, 0.1);
}

/* Neon Glow Effects */
.neon-text {
    text-shadow: 0 0 5px #00d4aa, 0 0 10px #00d4aa, 0 0 15px #00d4aa;
}

.neon-border {
    box-shadow: 0 0 5px #00d4aa, 0 0 10px #00d4aa, inset 0 0 5px #00d4aa;
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Calendar Styles */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.calendar-day:hover {
    background-color: rgba(0, 212, 170, 0.1);
    color: #00d4aa;
}

.calendar-day.available {
    background-color: rgba(0, 212, 170, 0.1);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.calendar-day.available:hover {
    background-color: rgba(0, 212, 170, 0.2);
    transform: scale(1.05);
}

.calendar-day.selected {
    background-color: #00d4aa;
    color: #0f0f23;
    font-weight: bold;
}

.calendar-day.disabled {
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-day.other-month {
    color: #666;
    opacity: 0.3;
}

/* Time Slot Styles */
.time-slot {
    padding: 12px 16px;
    background-color: rgba(26, 26, 46, 0.5);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: #fff;
}

.time-slot:hover {
    background-color: rgba(0, 212, 170, 0.1);
    border-color: rgba(0, 212, 170, 0.5);
    transform: translateY(-2px);
}

.time-slot.selected {
    background-color: #00d4aa;
    color: #0f0f23;
    border-color: #00d4aa;
    font-weight: bold;
}

.time-slot.unavailable {
    background-color: rgba(255, 255, 255, 0.05);
    color: #666;
    cursor: not-allowed;
    border-color: #333;
}

/* Meeting Form Animations */
#booking-form {
    animation: slideDown 0.3s ease-out;
}

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

/* Testimonials Styles */
.testimonial-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 170, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.05), transparent);
    transition: left 0.8s ease-out;
    z-index: 1;
}

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

.testimonial-card:hover {
    border-color: rgba(0, 212, 170, 0.3);
    box-shadow: 0 10px 30px rgba(0, 212, 170, 0.1);
    transform: translateY(-8px) scale(1.02);
}

.testimonial-card > * {
    position: relative;
    z-index: 2;
}

/* Star Rating Animation */
.testimonial-card .fa-star {
    transition: all 0.2s ease;
    transform: scale(1);
}

.testimonial-card:hover .fa-star {
    transform: scale(1.1);
}

.testimonial-card .fa-star:nth-child(1) { transition-delay: 0s; }
.testimonial-card .fa-star:nth-child(2) { transition-delay: 0.1s; }
.testimonial-card .fa-star:nth-child(3) { transition-delay: 0.2s; }
.testimonial-card .fa-star:nth-child(4) { transition-delay: 0.3s; }
.testimonial-card .fa-star:nth-child(5) { transition-delay: 0.4s; }

/* Quote Animation */
.testimonial-card blockquote {
    position: relative;
}

.testimonial-card blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: -20px;
    font-size: 4rem;
    color: rgba(0, 212, 170, 0.1);
    font-family: serif;
    line-height: 1;
}

/* Avatar Hover Effect */
.testimonial-card .fas.fa-user {
    transition: all 0.3s ease;
}

.testimonial-card:hover .fas.fa-user {
    transform: scale(1.1) rotate(5deg);
}
