/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    position: relative;
    cursor: default;
}

/* Background with Star Ray Gradient - 5 pointed star */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-gradient::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    transform: translate(-50%, -50%);
    background:
        /* Ray 1 - Top - Blue #4684b7 */
        conic-gradient(
            from 234deg at 50% 50%,
            transparent 0deg,
            transparent 54deg,
            #4684b7 54deg,
            #4684b7 72deg,
            transparent 72deg
        ),
        /* Ray 2 - Top Right - Yellow #e9b915 */
        conic-gradient(
            from 234deg at 50% 50%,
            transparent 0deg,
            transparent 126deg,
            #e9b915 126deg,
            #e9b915 144deg,
            transparent 144deg
        ),
        /* Ray 3 - Bottom Right - Lime #dac63f */
        conic-gradient(
            from 234deg at 50% 50%,
            transparent 0deg,
            transparent 198deg,
            #dac63f 198deg,
            #dac63f 216deg,
            transparent 216deg
        ),
        /* Ray 4 - Bottom Left - Red #d13e2c */
        conic-gradient(
            from 234deg at 50% 50%,
            transparent 0deg,
            transparent 270deg,
            #d13e2c 270deg,
            #d13e2c 288deg,
            transparent 288deg
        ),
        /* Ray 5 - Left - Green #80b155 */
        conic-gradient(
            from 234deg at 50% 50%,
            transparent 0deg,
            transparent 342deg,
            #80b155 342deg,
            #80b155 360deg,
            transparent 360deg
        );
    opacity: 0.9;
}

/* White center fade */
.background-gradient::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        ellipse at center,
        #ffffff 0%,
        #ffffff 10%,
        rgba(255, 255, 255, 0.95) 15%,
        rgba(255, 255, 255, 0.8) 25%,
        rgba(255, 255, 255, 0.5) 35%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 70%
    );
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.lang-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: transparent;
    padding: 2px;
    border: 2px solid transparent;
}

.lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.lang-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lang-btn.active {
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Parallax Container */
.parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    perspective: 1000px;
    perspective-origin: 50% 50%;
    overflow: hidden;
    pointer-events: none;
}

/* 3D Scene */
.parallax-scene {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* Center Card - Microsoft Edge Style */
.center-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 30px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 0 60px rgba(255, 255, 255, 0.05);
    z-index: 100;
    animation: fadeInUp 1s ease-out;
    transition: transform 0.15s ease-out;
    will-change: transform;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.center-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 15px;
}

.center-card .logo {
    height: 49px; /* 30% smaller than logo2 */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.center-card .logo2 {
    height: 70px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.center-card .brand-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    text-align: center;
    flex: 1;
}

.center-card .title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.btn-next {
    margin-top: 20px;
    padding: 12px 40px;
    background: #ffffff;
    color: #333;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    background: #f0f0f0;
}

/* Projects Wrapper */
.projects-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* Project Cards with parallax layers */
.project-card {
    position: absolute;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, opacity 0.6s ease-out;
    will-change: transform, opacity;
    animation: cardEnter 0.6s ease-out forwards;
    pointer-events: all;
}

@keyframes cardEnter {
    from {
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.project-card:hover {
    z-index: 100 !important;
}

.project-card:hover .project-card-inner {
    transform: scale(1.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.project-card-inner {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Shine effect */
.project-card-inner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 60%,
        transparent 70%
    );
    transform: translateX(-100%) rotate(45deg);
    transition: none;
    pointer-events: none;
}

.project-card-inner.shine::before {
    animation: shineAnimation 0.8s ease-out;
}

@keyframes shineAnimation {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.project-image-container {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

/* Miniatura on hover */
.project-miniature {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.project-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

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

.modal-content {
    width: 90%;
    height: 85%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.2),
        inset 0 0 60px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

.modal-scroll-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.modal-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.modal-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.modal-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* Modal Project Section */
.modal-project-section {
    min-height: 100%;
    display: flex;
    align-items: center;
    padding: 60px;
    scroll-snap-align: start;
    gap: 50px;
}

.modal-project-image {
    flex: 0 0 40%;
    max-width: 400px;
}

.modal-project-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.modal-project-info {
    flex: 1;
    color: #1a1a1a;
}

.modal-project-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.5);
}

.modal-project-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
    text-align: justify;
}

.modal-project-description a {
    color: #4684b7;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.modal-project-description a:hover {
    color: #2a5a8a;
    text-decoration: underline;
}

.btn-learn-more {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #4684b7 0%, #2a5a8a 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.4s ease;
    box-shadow: 0 8px 30px rgba(70, 132, 183, 0.5);
    position: relative;
    overflow: hidden;
}

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

.btn-learn-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(70, 132, 183, 0.6);
}

.btn-learn-more:hover::before {
    left: 100%;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4684b7 0%, #80b155 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-screen p {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Scroll Indicator in Modal */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    animation: bounce 2s infinite;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Progress Dots */
.modal-progress {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 5;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-dot:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.2);
}

.progress-dot.active {
    background: #4684b7;
    box-shadow: 0 0 15px rgba(70, 132, 183, 0.5);
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .modal-project-section {
        flex-direction: column;
        padding: 40px 30px;
        text-align: center;
    }

    .modal-project-image {
        flex: none;
        max-width: 280px;
    }

    .modal-project-title {
        font-size: 1.7rem;
    }

    .modal-project-description {
        font-size: 1rem;
        text-align: center;
    }

    .center-card {
        padding: 22px 30px;
    }

    .center-card .title {
        font-size: 1.5rem;
    }

    .center-card .brand-name {
        font-size: 1rem;
    }

    .center-card .logo {
        height: 35px; /* 30% smaller */
        width: auto;
    }

    .center-card .logo2 {
        height: 50px;
        width: auto;
    }

    .project-name {
        font-size: 0.9rem;
    }
}

/* Responsive - Mobile Large */
@media (max-width: 768px) {
    .language-selector {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
    }

    .lang-btn {
        width: 26px;
        height: 26px;
    }

    .modal-content {
        width: 95%;
        height: 92%;
        border-radius: 18px;
    }

    .modal-close {
        width: 38px;
        height: 38px;
        font-size: 22px;
        top: 12px;
        right: 12px;
    }

    .modal-project-section {
        padding: 30px 20px;
        gap: 30px;
    }

    .modal-project-image {
        max-width: 220px;
    }

    .modal-project-title {
        font-size: 1.4rem;
    }

    .modal-project-description {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .btn-learn-more {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .project-name {
        font-size: 0.85rem;
    }

    .project-card-inner {
        padding: 10px;
        border-radius: 14px;
    }

    .center-card {
        padding: 18px 25px;
    }

    .center-card-top {
        gap: 12px;
    }

    .center-card .logo {
        height: 28px; /* 30% smaller */
        width: auto;
    }

    .center-card .logo2 {
        height: 40px;
        width: auto;
    }

    .center-card .title {
        font-size: 1.2rem;
    }

    .center-card .brand-name {
        font-size: 0.85rem;
    }
}

/* Responsive - Mobile Small */
@media (max-width: 480px) {
    .language-selector {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        gap: 6px;
    }

    .lang-btn {
        width: 24px;
        height: 24px;
    }

    .modal-content {
        width: 98%;
        height: 95%;
        border-radius: 14px;
    }

    .modal-project-section {
        padding: 25px 15px;
        gap: 20px;
    }

    .modal-project-image {
        max-width: 180px;
    }

    .modal-project-title {
        font-size: 1.2rem;
    }

    .modal-project-description {
        font-size: 0.9rem;
    }

    .btn-learn-more {
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    .project-name {
        font-size: 0.75rem;
    }

    .project-card-inner {
        padding: 8px;
        border-radius: 12px;
    }

    .project-image-container {
        border-radius: 10px;
        margin-bottom: 8px;
    }

    .center-card {
        padding: 15px 20px;
    }

    .center-card-top {
        gap: 10px;
    }

    .center-card .logo {
        height: 22px; /* 30% smaller */
        width: auto;
    }

    .center-card .logo2 {
        height: 32px;
        width: auto;
    }

    .center-card .title {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }

    .center-card .brand-name {
        font-size: 0.75rem;
    }

    .modal-progress {
        right: 10px;
        gap: 6px;
    }

    .progress-dot {
        width: 8px;
        height: 8px;
    }

    .scroll-indicator {
        font-size: 0.8rem;
        bottom: 20px;
    }
}

/* Animation delays for cards */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.15s; }
.project-card:nth-child(3) { animation-delay: 0.2s; }
.project-card:nth-child(4) { animation-delay: 0.25s; }
.project-card:nth-child(5) { animation-delay: 0.3s; }
.project-card:nth-child(6) { animation-delay: 0.35s; }
.project-card:nth-child(7) { animation-delay: 0.4s; }
.project-card:nth-child(8) { animation-delay: 0.45s; }
.project-card:nth-child(9) { animation-delay: 0.5s; }
.project-card:nth-child(10) { animation-delay: 0.55s; }
.project-card:nth-child(11) { animation-delay: 0.6s; }
.project-card:nth-child(12) { animation-delay: 0.65s; }
