/* Layout Styles */

/* Full page sections setup */
section {
    min-height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    padding: 0;
    transition: var(--section-transition);
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 1000px;
    backface-visibility: hidden;
}

/* Section positioning - controlled by JS */
.hero {
    z-index: 5;
    transform: translateY(0);
}

.portfolio {
    position: fixed;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    transition: var(--section-transition);
    will-change: opacity, transform, filter;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.skills {
    z-index: 3;
    transform: translateY(200%);
    background-color: #0B0B0B;
    padding: 0;
    position: fixed;
    overflow: hidden;
    transition: var(--section-transition);
    will-change: opacity, transform, filter;
    transform-style: preserve-3d;
    perspective: 1000px;
    height: 100vh;
    min-height: 100vh;
}

body:not(.dark-mode) .skills {
    background-color: #F9F9F9;
}

body.dark-mode .skills {
    background-color: #0B0B0B;
}

.process {
    z-index: 2;
    transform: translateY(300%);
    position: fixed;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    transition: var(--section-transition);
    will-change: opacity, transform, filter;
    transform-style: preserve-3d;
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-color);
}

body.dark-mode .process {
    background-color: #1a1a1a;
}

.contact-us {
    z-index: 1;
    transform: translateY(400%);
    position: fixed;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    transition: var(--section-transition);
    will-change: opacity, transform, filter;
    transform-style: preserve-3d;
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-color);
}

body.dark-mode .contact-us {
    background-color: #1a1a1a;
}

/* Custom animation classes for sections */
section.fade-in,
section.fade-in-up {
    animation-duration: 1s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
}

section.fade-out,
section.fade-out-up {
    animation-duration: 1s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
}

section.fade-in {
    animation-name: fadeIn;
}

section.fade-out {
    animation-name: fadeOut;
}

section.fade-in-up {
    animation-name: fadeInUp;
}

section.fade-out-up {
    animation-name: fadeOutUp;
}

/* Section Indicator */
.section-indicator {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Show section indicator when not on the hero section */
body:not([data-current-section="0"]) .section-indicator {
    opacity: 1;
    visibility: visible;
}

.section-indicator-blur {
    background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

body.dark-mode .section-indicator-blur {
    background: linear-gradient(135deg,
    rgba(40, 40, 40, 0.12) 0%,
    rgba(20, 20, 20, 0.04) 100%);
    border: 1px solid rgba(100, 100, 100, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.section-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(120, 120, 120, 0.3);
    border: 1px solid rgba(100, 100, 100, 0.4);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
}

.section-indicator .dot:hover {
    background-color: rgba(50, 50, 50, 0.8);
    transform: scale(1.2);
}

.section-indicator .dot.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.4);
}

.section-indicator .dot .label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 3px 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.section-indicator .dot:hover .label {
    opacity: 1;
    visibility: visible;
    left: 25px;
}

body.dark-mode .section-indicator .dot {
    background-color: rgba(40, 40, 40, 0.4);
    border-color: rgba(70, 70, 70, 0.6);
}

body.dark-mode .section-indicator .dot:hover {
    background-color: rgba(60, 60, 60, 0.6);
}

body.dark-mode .section-indicator .dot.active {
    background-color: #a395ff;
    border-color: #b8aeff;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(163, 149, 255, 0.6);
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    z-index: 10;
    cursor: pointer;
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-indicator-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-color);
}

body.dark-mode .scroll-indicator-text {
    color: var(--text-dark);
}

.scroll-indicator-arrow {
    width: 24px;
    height: 24px;
    border: solid var(--text-color);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

body.dark-mode .scroll-indicator-arrow {
    border-color: var(--text-dark);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(45deg);
    }
    40% {
        transform: translateY(-10px) rotate(45deg);
    }
    60% {
        transform: translateY(-5px) rotate(45deg);
    }
}

/* Footer */
footer {
    background-color: #f5f5f5;
    padding: 2rem 0;
    text-align: center;
    transition: var(--transition);
}

body.dark-mode footer {
    background-color: #1a1a1a;
}

footer p {
    margin: 0.5rem 0;
}

footer .fa-heart {
    color: #e25555;
}

/* Fix contact-us section */
.contact-card-wrapper {
    box-sizing: border-box;
    padding: 20px;
}

.contact-card {
    width: 100%;
    max-width: 1000px;
}

@media (max-width: 768px) {
    .section-indicator {
        left: auto;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        gap: 8px;
        z-index: 1000;
        padding: 0;
    }

    .section-indicator-blur {
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        border-radius: 0;
        padding: 8px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        box-shadow: none;
        width: auto;
    }

    body.dark-mode .section-indicator-blur {
        background: none;
        border: none;
        box-shadow: none;
    }

    .section-indicator .dot {
        width: 1px;
        height: 8px;
        border-radius: 0.5px;
        background: rgba(255, 255, 255, 0.15);
        border: none;
        transition: all 0.3s ease;
        position: relative;
        cursor: pointer;
    }

    body.dark-mode .section-indicator .dot {
        background: rgba(255, 255, 255, 0.12);
    }

    .section-indicator .dot:hover {
        background: rgba(255, 255, 255, 0.3);
        width: 1.5px;
        height: 10px;
    }

    body.dark-mode .section-indicator .dot:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    .section-indicator .dot.active {
        height: 16px;
        width: 1.5px;
        background: rgba(108, 99, 255, 0.6);
    }

    body.dark-mode .section-indicator .dot.active {
        background: rgba(163, 149, 255, 0.7);
    }

    .section-indicator .dot .label {
        display: none;
    }

    /* Fixed section heights for mobile */
    section,
    .scrollable-section {
        height: 100vh !important; /* Fallback */
        height: calc(var(--vh, 1vh) * 100) !important;
        min-height: 100vh !important; /* Fallback */
        min-height: calc(var(--vh, 1vh) * 100) !important;
        max-height: 100vh !important; /* Fallback */
        max-height: calc(var(--vh, 1vh) * 100) !important;
        overflow: hidden !important;
    }

    /* Fix containers to fit content within viewport */
    section .container {
        max-height: calc(100vh - 50px) !important;
        overflow-y: auto !important;
        padding-top: 70px !important; /* Account for header */
        padding-bottom: 20px !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Specifically fix skills section layout */
    .skills .container {
        padding-top: 50px !important;
    }

    .skills-grid-wrapper {
        height: auto;
    }

    .skills-grid {
        gap: 8px;
    }

    /* Fix contact section */
    .contact-card-wrapper {
        height: 100vh !important;
        padding: 70px 10px 20px !important;
    }

    .contact-card {
        max-height: calc(100vh - 90px);
    }

    /* Fix process section */
    .process .container {
        justify-content: flex-start !important;
        padding-top: 70px !important;
    }

    /* Make sure no content gets cut off */
    .process-steps {
        margin-bottom: 20px;
    }
}

/* Ultra-minimal for very small screens */
@media (max-width: 480px) {
    .section-indicator {
        right: 6px;
        gap: 6px;
    }

    .section-indicator-blur {
        padding: 6px 0;
        gap: 6px;
    }

    .section-indicator .dot {
        width: 0.8px;
        height: 6px;
    }

    .section-indicator .dot.active {
        height: 12px;
        width: 1px;
    }

    .section-indicator .dot:hover {
        width: 1.2px;
        height: 8px;
    }
}
