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

html, body {
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* ============================================
   Container & Layout
   ============================================ */
.page {
    width: 100%;
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.page.hidden {
    display: none;
}

.page-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.page-2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.page-3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.services-container {
    flex-direction: column;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.carousel-container {
    flex-direction: column;
    justify-content: center;
}

/* ============================================
   Welcome Section
   ============================================ */
.welcome-section {
    text-align: center;
    width: 100%;
}

/* ============================================
   Typography
   ============================================ */
.welcome-text {
    color: white;
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: 0.5px;
    word-spacing: 0.1em;
    text-align: left;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.15em;
    white-space: normal;
}

.services-title {
    color: white;
    font-size: 2.4rem;
    font-weight: 300;
    margin-bottom: 3rem;
    letter-spacing: 1px;
}

.service-title {
    color: white;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* ============================================
   Carousel Styles - Odometer Format (Page 1)
   ============================================ */
.solutions-carousel {
    display: inline-block;
    position: relative;
    font-weight: 700;
    color: #ffd700;
    min-width: 110px;
    width: auto;
    max-width: 200px;
    height: 5.2em;
    overflow: hidden;
    vertical-align: middle;
    margin: 0 0.1em;
    padding: 0 0.2em;
    clip-path: inset(0 0 0 0);
    flex-shrink: 0;
}

.carousel-item {
    display: block;
    position: absolute;
    width: 100%;
    height: 1.4em;
    text-align: left;
    line-height: 1.4em;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    white-space: nowrap;
    padding-left: 0.15em;
    top: 1.9em;
    left: 0;
    opacity: 0.5;
    font-size: 0.85em;
}

.carousel-item.active {
    opacity: 1;
    font-size: 1em;
    font-weight: 700;
    z-index: 10;
}

/* ============================================
   Grid Layout (Page 2)
   ============================================ */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    width: 100%;
}

.grid-item {
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
}

.grid-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 215, 0, 0.6);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.grid-item:active {
    transform: translateY(-2px);
}

.grid-content {
    text-align: center;
    color: white;
}

.grid-content h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffd700;
}

.grid-content p {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Carousel Slots (Page 3)
   ============================================ */
.carousel-slots {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 600px;
}

.carousel-slot {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    overflow: hidden;
}

.carousel-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 6px;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ============================================
   Exit Button (Page 3)
   ============================================ */
.exit-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 215, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.6);
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.exit-btn:hover {
    background: rgba(255, 215, 0, 0.5);
    border-color: #ffd700;
    transform: translateY(-2px);
}

.exit-btn:active {
    transform: translateY(0);
}

/* ============================================
   Progress Indicator (Page 3)
   ============================================ */
.progress-indicator {
    width: 100%;
    max-width: 600px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff9800);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* ============================================
   Orientation Alert
   ============================================ */
.orientation-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-size: 1.5rem;
}

.orientation-alert.hidden {
    display: none;
}

.alert-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    color: #333;
    font-size: 1.2rem;
    font-weight: 500;
}

/* ============================================
   Page Hints (scroll indicators)
   ============================================ */
.page-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    animation: bounce 2s infinite;
}

.page-hint.hidden {
    display: none;
}

.hint-content {
    text-align: center;
    color: white;
    font-size: 0.9rem;
}

.page-hint .arrow-down {
    width: 20px;
    height: 20px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    margin: 10px auto 0;
}

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

/* ============================================
   Small Mobile Screens
   ============================================ */
@media (max-width: 480px) {
    .welcome-text {
        font-size: 1.2rem;
        gap: 0.12em;
        letter-spacing: 0.4px;
        word-spacing: 0.05em;
    }

    .solutions-carousel {
        min-width: 105px;
        max-width: 160px;
        height: 5.2em;
        margin: 0 0.08em;
        padding: 0 0.15em;
    }

    .carousel-item {
        font-size: 0.75em;
        padding-left: 0.1em;
    }

    .container {
        padding: 1rem 0.75rem;
    }

    .services-title {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .grid-item {
        aspect-ratio: 1.1 / 1;
    }

    .grid-content h3 {
        font-size: 1.2rem;
    }

    .grid-content p {
        font-size: 0.8rem;
    }

    .container.page3 {
        padding: 3rem 1rem 1rem;
    }

    .service-title {
        font-size: 1.4rem;
    }

    .carousel-wrapper {
        height: 150px;
    }

    .carousel-slot {
        padding: 1rem;
    }

    .exit-btn {
        top: 10px;
        left: 10px;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Landscape Mode (All Devices)
   ============================================ */
@media (orientation: landscape) {
    .page {
        padding: 0.3rem 0.2rem;
        min-height: 100vh;
        height: auto;
    }

    .welcome-text {
        font-size: 1.1rem;
        gap: 0.12em;
        letter-spacing: 0.3px;
    }

    .solutions-carousel {
        min-width: 100px;
        max-width: 160px;
        height: 5.2em;
    }

    .carousel-item {
        font-size: 0.75em;
    }

    .services-title {
        font-size: 0.75rem;
        margin-bottom: 0.08rem;
        line-height: 1;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem;
        width: 100%;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .grid-item {
        aspect-ratio: 4.5 / 1;
        min-height: auto;
        padding: 0.15rem 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .grid-content {
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.02rem;
    }

    .grid-content h3 {
        font-size: 0.55rem;
        margin-bottom: 0;
        line-height: 1;
    }

    .grid-content p {
        font-size: 0.48rem;
        margin: 0;
        line-height: 1;
    }

    .services-container {
        overflow-y: auto;
        max-height: 100vh;
        padding: 0.5rem;
    }

    .container.page3 {
        padding: 0.15rem;
        height: calc(100vh - 10px);
        overflow: hidden;
    }

    .service-title {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
        width: 95%;
        margin-left: auto;
        margin-right: auto;
    }

    .carousel-slots {
        gap: 0;
        max-height: calc(100vh - 70px);
        overflow: hidden;
        width: 95%;
        max-width: none;
        margin: 0 auto;
    }

    .carousel-wrapper {
        height: 100%;
        width: 100%;
    }

    .carousel-slot {
        padding: 0;
        height: calc(100vh - 100px);
        display: flex;
        flex-direction: column;
        width: 95%;
        margin: 0 auto;
    }

    .carousel-slot {
        display: none;
    }

    .carousel-slot.active {
        display: block;
    }

    .progress-indicator {
        width: 95%;
        margin: 0 auto;
    }

    .carousel-image {
        object-fit: cover;
    }

    .exit-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   Tablet Styles
   ============================================ */
@media (min-width: 481px) and (max-width: 767px) {
    .welcome-text {
        font-size: 1.6rem;
        gap: 0.15em;
        letter-spacing: 0.5px;
    }

    .solutions-carousel {
        min-width: 150px;
        max-width: 240px;
        height: 5.2em;
    }

    .carousel-item {
        font-size: 0.8em;
    }

    .services-title {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.8rem;
    }

    .grid-content h3 {
        font-size: 1.5rem;
    }

    .grid-content p {
        font-size: 0.95rem;
    }

    .service-title {
        font-size: 1.8rem;
    }

    .carousel-wrapper {
        height: 180px;
    }

    .carousel-slots {
        max-width: 500px;
        gap: 1.5rem;
    }
}

/* ============================================
   Desktop Styles
   ============================================ */
@media (min-width: 768px) and (orientation: portrait) {
    html, body {
        overflow: auto;
    }

    .container {
        min-height: 100vh;
        padding: 4rem 2rem;
    }

    .welcome-text {
        font-size: 2.4rem;
        gap: 0.3em;
        letter-spacing: 0.8px;
        word-spacing: 0.15em;
    }

    .solutions-carousel {
        min-width: 260px;
        max-width: 400px;
        height: 5.2em;
        margin: 0 0.3em;
    }

    .carousel-item {
        font-size: 0.95em;
        top: 1.9em;
        padding-left: 0.3em;
    }

    .services-title {
        font-size: 3rem;
        margin-bottom: 4rem;
    }

    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }

    .grid-item {
        aspect-ratio: 1 / 1;
    }

    .grid-content h3 {
        font-size: 2rem;
    }

    .grid-content p {
        font-size: 1.1rem;
    }

    .service-title {
        font-size: 2.4rem;
    }

    .carousel-wrapper {
        height: 250px;
    }

    .carousel-slots {
        max-width: 700px;
        gap: 2.5rem;
    }

    .carousel-slot {
        padding: 2rem;
    }
}

/* ============================================
   Desktop Landscape
   ============================================ */
@media (min-width: 768px) and (orientation: landscape) {
    .welcome-text {
        font-size: 2rem;
        gap: 0.2em;
        letter-spacing: 0.6px;
    }

    .solutions-carousel {
        min-width: 220px;
        max-width: 340px;
        height: 5.2em;
        margin: 0 0.2em;
    }

    .carousel-item {
        font-size: 0.9em;
        top: 1.9em;
        padding-left: 0.3em;
    }

    .services-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }

    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .grid-content h3 {
        font-size: 1.4rem;
    }

    .grid-content p {
        font-size: 0.9rem;
    }

    .service-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .carousel-wrapper {
        height: 220px;
    }

    .carousel-slots {
        max-width: 600px;
        gap: 0;
        overflow: hidden;
    }

    .carousel-slot {
        display: none;
    }

    .carousel-slot.active {
        display: block;
    }
}
