﻿/* ===================================
           RESET & BASE STYLES
        =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pan-y;
    background: linear-gradient(135deg, #064f84 0%, #0a6ba8 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
           CONTAINER & LAYOUT
        =================================== */
.app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
}

.title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 2px 4px 8px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

/* Logo optimization for tablet */
.app-container img {
    width: 350px !important;
    max-width: 90%;
    margin-bottom: 40px !important;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

/* ===================================
           3D CAROUSEL CONTAINER - TABLET OPTIMIZED
        =================================== */
.carousel-wrapper {
    width: 100%;
    max-width: 600px;
    min-height: 650px;
    position: relative;
    perspective: 1500px;
    -webkit-perspective: 1500px;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
    -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* ===================================
           CAROUSEL ITEMS - ENHANCED FOR TABLET
        =================================== */
.carousel-item {
    position: absolute;
    width: 100%;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 1px rgba(0,0,0,0.1);
    overflow: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.7s ease;
    -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.7s ease;
    padding: 50px 40px;
    min-height: 600px;
}

.image-container {
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
}

.carousel-image {
    width: 60%;
    object-fit: cover;
    object-position: center;
}

/* Content section - Tablet optimized spacing */
.carousel-content {
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.carousel-title {
    font-size: 28px;
    font-weight: 700;
    color: #064f84;
    margin-bottom: 8px;
    text-align: left;
    width: 100%;
    letter-spacing: 0.5px;
}

.carousel-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* ===================================
           NAVIGATION INDICATORS
        =================================== */
.indicators {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}

.indicator.active {
    background: white;
    width: 36px;
    border-radius: 6px;
}

/* ===================================
           SWIPE INSTRUCTION TEXT
        =================================== */
.instruction-text {
    position: absolute;
    bottom: -90px;
    color: white;
    font-size: 16px;
    text-align: center;
    opacity: 0.9;
}

/* ===================================
           TABLET OPTIMIZED INPUTS
        =================================== */
.input {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    font-size: 20px;
    text-align: center;
    color: #333;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 12px;
    outline: none;
    padding: 18px 24px;
    width: 100%;
    max-width: 100%;
    transition: all 0.3s ease;
    font-weight: 500;
}

.input:hover {
    border-color: #5468ff;
    box-shadow: 0 4px 12px rgba(84, 104, 255, 0.15);
}

.input:focus {
    border-color: #5468ff;
    background-color: white;
    box-shadow: 0 4px 16px rgba(84, 104, 255, 0.25);
    transform: translateY(-2px);
}

.input::placeholder {
    color: #999;
}

/* ===================================
           TABLET OPTIMIZED BUTTONS
        =================================== */

/* Normal rectangular button for NEXT and SAVE */
.button-normal {
    align-items: center;
    appearance: none;
    background-image: linear-gradient(135deg, #5adaff 0%, #5468ff 100%);
    border: 0;
    border-radius: 16px;
    box-shadow: rgba(45, 35, 66, .4) 0 4px 8px, rgba(45, 35, 66, .3) 0 12px 24px -6px, rgba(58, 65, 111, .5) 0 -4px 0 inset;
    box-sizing: border-box;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: "JetBrains Mono", monospace;
    min-width: 200px;
    padding: 24px 48px;
    justify-content: center;
    align-items: center;
    line-height: 1;
    list-style: none;
    overflow: hidden;
    position: relative;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
    will-change: box-shadow, transform;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
}

.button-normal:focus {
    box-shadow: #3c4fe0 0 0 0 2px inset, rgba(45, 35, 66, .4) 0 4px 8px, rgba(45, 35, 66, .3) 0 12px 24px -6px, #3c4fe0 0 -4px 0 inset;
}

.button-normal:hover {
    box-shadow: rgba(45, 35, 66, .4) 0 6px 12px, rgba(45, 35, 66, .3) 0 16px 32px -8px, #3c4fe0 0 -4px 0 inset;
    transform: translateY(-4px);
}

.button-normal:active {
    box-shadow: #3c4fe0 0 4px 10px inset;
    transform: translateY(2px);
}

/* Circular button for START only */
.button-29 {
    align-items: center;
    appearance: none;
    background-image: radial-gradient(100% 100% at 100% 0, #5adaff 0, #5468ff 100%);
    border: 0;
    border-radius: 50%;
    box-shadow: rgba(45, 35, 66, .4) 0 4px 8px, rgba(45, 35, 66, .3) 0 12px 24px -6px, rgba(58, 65, 111, .5) 0 -4px 0 inset;
    box-sizing: border-box;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: "JetBrains Mono", monospace;
    height: 300px;
    width: 300px;
    justify-content: center;
    align-items: center;
    line-height: 1;
    list-style: none;
    overflow: hidden;
    position: relative;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
    will-change: box-shadow, transform;
    font-size: 44px;
    font-weight: 700;
    letter-spacing: 1px;
}

.button-29:focus {
    box-shadow: #3c4fe0 0 0 0 2px inset, rgba(45, 35, 66, .4) 0 4px 8px, rgba(45, 35, 66, .3) 0 12px 24px -6px, #3c4fe0 0 -4px 0 inset;
}

.button-29:hover {
    box-shadow: rgba(45, 35, 66, .4) 0 6px 12px, rgba(45, 35, 66, .3) 0 16px 32px -8px, #3c4fe0 0 -4px 0 inset;
    transform: translateY(-4px) scale(1.02);
}

.button-29:active {
    box-shadow: #3c4fe0 0 4px 10px inset;
    transform: translateY(2px) scale(0.98);
}

/* Secondary button style */
.button-72 {
    align-items: center;
    background-color: initial;
    background-image: linear-gradient(rgba(179, 132, 201, .84), rgba(57, 31, 91, .84) 50%);
    border-radius: 50px;
    border-width: 0;
    box-shadow: rgba(57, 31, 91, 0.24) 0 4px 8px, rgba(179, 132, 201, 0.4) 0 12px 20px;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    font-family: Quicksand, sans-serif;
    font-size: 22px;
    font-weight: 700;
    justify-content: center;
    letter-spacing: .04em;
    line-height: 1.2;
    margin: 0;
    padding: 22px 40px;
    text-align: center;
    text-decoration: none;
    text-shadow: rgba(255, 255, 255, 0.4) 0 0 4px, rgba(255, 255, 255, 0.2) 0 0 12px, rgba(57, 31, 91, 0.6) 1px 1px 4px, rgba(57, 31, 91, 0.32) 4px 4px 16px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    vertical-align: baseline;
    transition: all 0.3s ease;
}

.button-72:hover {
    background-image: linear-gradient(#B384C9, #391F5B 50%);
    transform: translateY(-2px);
    box-shadow: rgba(57, 31, 91, 0.3) 0 6px 12px, rgba(179, 132, 201, 0.5) 0 16px 28px;
}

.button-72:active {
    transform: translateY(0);
}

.button-33 {
    background-color: #c2fbd7;
    border-radius: 100px;
    box-shadow: rgba(44, 187, 99, .2) 0 -25px 18px -14px inset, rgba(44, 187, 99, .15) 0 1px 2px, rgba(44, 187, 99, .15) 0 2px 4px, rgba(44, 187, 99, .15) 0 4px 8px, rgba(44, 187, 99, .15) 0 8px 16px, rgba(44, 187, 99, .15) 0 16px 32px;
    color: green;
    cursor: pointer;
    display: inline-block;
    font-family: CerebriSans-Regular, -apple-system, system-ui, Roboto, sans-serif;
    padding: 14px 32px;
    text-align: center;
    text-decoration: none;
    transition: all 250ms;
    border: 0;
    font-size: 20px;
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.button-33:hover {
    box-shadow: rgba(44, 187, 99, .35) 0 -25px 18px -14px inset, rgba(44, 187, 99, .25) 0 1px 2px, rgba(44, 187, 99, .25) 0 2px 4px, rgba(44, 187, 99, .25) 0 4px 8px, rgba(44, 187, 99, .25) 0 8px 16px, rgba(44, 187, 99, .25) 0 16px 32px;
    transform: scale(1.05) rotate(-1deg);
}

.sel_item {
    border: solid 4px #ff6a00;
    border-radius: 15px;
}

/* ===================================
           TABLET SPECIFIC OPTIMIZATIONS
        =================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .carousel-wrapper {
        max-width: 650px;
        min-height: 700px;
    }

    .carousel-item {
        padding: 60px 50px;
        min-height: 650px;
    }

    .button-29 {
        height: 320px;
        width: 320px;
        font-size: 48px;
    }

    .button-normal {
        min-width: 240px;
        padding: 28px 56px;
        font-size: 32px;
    }

    .input {
        font-size: 22px;
        padding: 20px 28px;
    }

    .carousel-title {
        font-size: 32px;
    }
}

/* Landscape tablet optimization */
@media (min-width: 1024px) {
    .carousel-wrapper {
        max-width: 700px;
    }

    .carousel-item {
        padding: 70px 60px;
    }

    .button-29 {
        height: 340px;
        width: 340px;
        font-size: 50px;
    }

    .button-normal {
        min-width: 260px;
        padding: 30px 60px;
        font-size: 34px;
    }
}

/* Portrait tablet optimization */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .app-container {
        padding: 50px 30px;
    }

    .carousel-wrapper {
        max-width: 600px;
    }
}

/* Smaller tablets */
@media (max-width: 767px) {
    .carousel-wrapper {
        max-width: 500px;
        min-height: 600px;
    }

    .carousel-item {
        padding: 40px 30px;
        min-height: 550px;
    }

    .button-29 {
        height: 260px;
        width: 260px;
        font-size: 40px;
    }

    .button-normal {
        min-width: 180px;
        padding: 20px 40px;
        font-size: 24px;
    }

    .input {
        font-size: 18px;
        padding: 16px 20px;
    }

    .carousel-title {
        font-size: 24px;
    }

    .app-container img {
        width: 280px !important;
    }
}

/* ===================================
           LOADING STATE
        =================================== */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    font-weight: 600;
}

/* ===================================
           COUNTER DISPLAY
        =================================== */
.carousel-content h1 {
    font-size: 120px;
    font-weight: 800;
    color: #5468ff;
    text-shadow: 0 4px 12px rgba(84, 104, 255, 0.3);
    margin: 0;
    line-height: 1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===================================
           TOUCH FEEDBACK
        =================================== */
* {
    -webkit-tap-highlight-color: rgba(84, 104, 255, 0.2);
}

button {
    -webkit-touch-callout: none;
}

/* Improve touch target sizes for tablet */
button, input, .indicator {
    min-height: 44px;
}

.button-normal, .button-29 {
    min-height: 60px; /* Ensure comfortable touch targets */
}

/* ===================================
           SMOOTH TRANSITIONS
        =================================== */
.carousel-item > * {
    transition: opacity 0.3s ease;
}

/* Add subtle entrance animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-item {
    animation: slideIn 0.5s ease-out;
}