/* Custom CSS for Ydanii Portfolio */

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #E60000;
}

/* Navigation styles */
.nav-link {
    position: relative;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: #FF0000;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* Hero background shapes */
.hero-bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #FF0000, #E600E6);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #00E6E6, #FF0000);
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, #E600E6, #00E6E6);
    bottom: 20%;
    left: 60%;
    animation-delay: 4s;
}

/* Button styles */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::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 {
    left: 100%;
}

.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: currentColor;
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover::before {
    width: 100%;
}

/* Red buttons that should have white background on hover */
.btn-red-white::before {
    display: none !important;
}

.btn-red-white {
    position: static !important;
    overflow: visible !important;
}

/* Cyan buttons that should have cyan background on hover */
.btn-cyan-dark::before {
    display: none !important;
}

.btn-cyan-dark {
    position: static !important;
    overflow: visible !important;
}

/* Portfolio grid styles */
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #1A1A1A;
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(230, 0, 230, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.portfolio-item:hover::before {
    opacity: 1;
}

.portfolio-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    object-position: center;
    background: #1A1A1A; /* fills empty space when using contain */
    display: block;
    transition: transform 0.25s ease;
}
.portfolio-item:hover img {
    transform: scale(1.03);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 2;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

/* Service card styles */
.service-card {
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card .service-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.service-card .service-content > *:last-child {
    margin-top: auto;
}

/* Services carousel for mobile */
.services-carousel {
    position: relative;
    overflow: hidden;
}

.services-carousel-container {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.services-carousel-slide {
    min-width: 85%;
    max-width: 85%;
    flex-shrink: 0;
    margin-right: 2.5%;
}

.services-carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.carousel-btn {
    background: #1A1A1A;
    border: 2px solid #FF0000;
    color: #FF0000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: #FF0000;
    color: white;
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.services-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.services-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
    cursor: pointer;
    transition: background 0.3s ease;
}

.services-dot.active {
    background: #FF0000;
}

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

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

.service-card:hover {
    border-color: #FF0000;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.2);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FF0000, #E600E6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Testimonial card styles */
.testimonial-card {
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 60px;
    color: #FF0000;
    opacity: 0.3;
    font-family: serif;
}

.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Loading animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #FF0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Modal styles */
#portfolio-modal {
    backdrop-filter: blur(10px);
}

#portfolio-modal img {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-bg-shape {
        width: 150px !important;
        height: 150px !important;
    }
    
    .shape-1 {
        top: 5%;
        left: 5%;
    }
    
    .shape-2 {
        top: 70%;
        right: 5%;
    }
    
    .shape-3 {
        bottom: 10%;
        left: 50%;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-bg-shape {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 2px solid #FF0000;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-text-gray {
        color: #FFFFFF !important;
    }
    
    .border-dark-secondary {
        border-color: #FFFFFF !important;
    }
}

/* Print styles */
@media print {
    .hero-bg-shape,
    nav,
    #portfolio-modal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Custom selection colors */
::selection {
    background-color: #FF0000;
    color: white;
}

::-moz-selection {
    background-color: #FF0000;
    color: white;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #FF0000, #E600E6, #00E6E6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glitch effect for special elements */
.glitch {
    position: relative;
}

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

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: #FF0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: #00E6E6;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
    }
    15%, 49% {
        transform: translate(-2px, -1px);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% {
        transform: translate(0);
    }
    21%, 62% {
        transform: translate(2px, 1px);
    }
}

/* Particle effect background */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #FF0000;
    border-radius: 50%;
    bottom: -10px;
    animation: particle-float 10s linear infinite;
    box-shadow: 0 0 6px currentColor;
}

@keyframes particle-float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* Neon glow effect */
.neon-glow {
    text-shadow: 
        0 0 5px #FF0000,
        0 0 10px #FF0000,
        0 0 15px #FF0000,
        0 0 20px #FF0000;
}

/* Typing animation */
.typing-animation::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Carousel Container */
.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: auto;
}

/* Carousel Rows */
.carousel-row {
    position: absolute;
    width: 100%;
    height: 22%;
    overflow: hidden;
    display: flex;
    align-items: center;
    pointer-events: auto;
}

.carousel-row:nth-child(1) {
    top: 2%;
}

.carousel-row:nth-child(2) {
    top: 26%;
}

.carousel-row:nth-child(3) {
    top: 50%;
}

.carousel-row:nth-child(4) {
    top: 74%;
}

/* Carousel Track */
.carousel-track {
    display: flex;
    gap: 10px;
    white-space: nowrap;
    will-change: transform;
    pointer-events: auto;
    overflow: visible;
}

/* Position cloned tracks for seamless loop */
.carousel-row .carousel-track:nth-child(2) {
    transform: translateX(100%);
}

/* Carousel Items */
.carousel-item {
    flex-shrink: 0;
    width: 360px;
    height: 240px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    z-index: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #181818;
    transition: filter 0.3s ease, border-radius 0.3s ease;
    filter: brightness(0.5) contrast(0.7);
    pointer-events: none;
    border-radius: 20px;
}

/* HOVER EFFECTS - Now working properly! */
.carousel-item:hover {
    transform: scale(1.12);
    z-index: 10;
    box-shadow: 0 0 40px 10px rgba(255, 0, 0, 0.7);
}

.carousel-item:hover img {
    filter: brightness(1.18) contrast(1.15) saturate(1.1);
    border-radius: 24px;
}

/* CSS Animations for infinite scroll */
@keyframes scrollRight {
    from { transform: translateX(0%); }
    to { transform: translateX(-100%); }
}

@keyframes scrollLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0%); }
}

/* Apply animations to tracks with perfect synchronization */
.carousel-row[data-direction="right"] .carousel-track:first-child {
    animation: scrollRight 120s linear infinite;
}

.carousel-row[data-direction="right"] .carousel-track:last-child {
    transform: translateX(100%);
    animation: scrollRight 120s linear infinite;
}

.carousel-row[data-direction="left"] .carousel-track:first-child {
    animation: scrollLeft 110s linear infinite;
}

.carousel-row[data-direction="left"] .carousel-track:last-child {
    transform: translateX(-100%);
    animation: scrollLeft 110s linear infinite;
}

/* Different speeds for each row but synchronized tracks within each row - SLOWER */
.carousel-row:nth-child(1)[data-direction="right"] .carousel-track {
    animation: scrollRight 160s linear infinite;
}

.carousel-row:nth-child(1)[data-direction="right"] .carousel-track:last-child {
    transform: translateX(100%);
}

.carousel-row:nth-child(2)[data-direction="left"] .carousel-track {
    animation: scrollLeft 150s linear infinite;
}

.carousel-row:nth-child(2)[data-direction="left"] .carousel-track:last-child {
    transform: translateX(-100%);
}

.carousel-row:nth-child(3)[data-direction="right"] .carousel-track {
    animation: scrollRight 154s linear infinite;
}

.carousel-row:nth-child(3)[data-direction="right"] .carousel-track:last-child {
    transform: translateX(100%);
}

.carousel-row:nth-child(4)[data-direction="left"] .carousel-track {
    animation: scrollLeft 146s linear infinite;
}

.carousel-row:nth-child(4)[data-direction="left"] .carousel-track:last-child {
    transform: translateX(-100%);
}

