* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
    background-color: white;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* For iOS/iPad */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

/* Fix for iOS/iPad viewport height */
html {
    height: -webkit-fill-available;
}

.container {
    text-align: center;
    padding: 2rem;
    position: relative;
    width: 100%;
    max-width: 800px;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#countdown-section, #password-section {
    transition: all 0.8s ease-in-out;
    position: absolute;
    width: 100%;
    left: 0;
    padding: 20px;
}

h1 {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    color: #e91e63;
    margin-bottom: 3rem;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
    font-weight: 500;
}

h2 {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    color: #e91e63;
    margin-bottom: 1.5rem;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 500;
}

.timer {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 3vw, 2.5rem);
    margin-top: 2rem;
    flex-wrap: wrap;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.time-block span:first-child {
    font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: bold;
    color: #e91e63;
}

.label {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #666;
    margin-top: 0.5rem;
    font-weight: 300;
}

.password-input {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Passcode display */
.passcode-display {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.5 s ease;
}

.passcode-digit {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #e91e63;
    background: transparent;
    transition: all 0.3s ease;
}

.passcode-digit.error {
    border-color: #ff3d3d;
}

.passcode-digit.filled {
    background: #e91e63;
}

.passcode-digit.error.filled {
    background: #ff3d3d;
}

/* Numpad */
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 360px;
    width: 100%;
    padding: 1rem;
}

.numpad-btn {
    font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
    aspect-ratio: 1;
    border: none;
    background: rgba(233, 30, 99, 0.1);
    border-radius: 50%;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #e91e63;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    font-weight: 400;
}

.numpad-btn:active {
    background: rgba(233, 30, 99, 0.2);
    transform: scale(0.95);
}

.numpad-btn.delete {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    background: rgba(233, 30, 99, 0.05);
}

.numpad-btn.error {
    color: #ff3d3d;
    background: rgba(255, 61, 61, 0.1);
}

.numpad-btn.error:active {
    background: rgba(255, 61, 61, 0.2);
}

/* Hide the original password input */
#password {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Remove the original submit button */
#submit-btn {
    display: none;
}

#countdown-section {
    opacity: 1;
    transform: translateY(0);
}

#countdown-section.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

#password-section {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#password-section.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* iPad-specific optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 3rem;
    }

    .time-block {
        min-width: 140px;
        padding: 1rem;
    }

    .numpad {
        gap: 1.2rem;
        max-width: 400px;
    }

    .numpad-btn {
        font-size: 2.2rem;
    }

    .numpad-btn.delete {
        font-size: 1.7rem;
    }
}

/* Shake animation for wrong password */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-8px);
    }
    40%, 80% {
        transform: translateX(8px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Floating Circles Animation */
@keyframes float-down {
    0% {
        transform: translateY(-150vh) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(150vh) rotate(360deg);
        opacity: 0;
    }
}

.floating-circle {
    position: fixed;
    background: rgba(233, 30, 99, 0.15);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    will-change: transform, opacity;
}

/* Different sizes for variety */
.floating-circle.small {
    width: 30px;
    height: 30px;
}

.floating-circle.medium {
    width: 60px;
    height: 60px;
}

.floating-circle.large {
    width: 90px;
    height: 90px;
}

.floating-circle.extra-large {
    width: 120px;
    height: 120px;
    background: rgba(233, 30, 99, 0.1);
}

/* Message Section Styles */
#message-section {
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.message-content {
    max-width: 100%;
    text-align: center;
    padding: 2rem;
    transform: translateY(0);
    transition: transform 0.3s ease-out;
    position: relative;
    z-index: 2;
}

.message-text {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif;
    font-size: clamp(1.5rem, 5vw, 3rem);
    line-height: 1.4;
    color: #e91e63;
    margin-bottom: 1.5rem;
    font-weight: 400;
    white-space: pre-line;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.message-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Swipeable Container Styles */
#swipeable-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

#swipeable-container.visible {
    opacity: 1;
    visibility: visible;
}

.swipe-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    transition: transform 0.3s ease-out;
    will-change: transform;
    touch-action: pan-x;
}

.swipe-section.current {
    transform: translateX(0);
    z-index: 2;
    opacity: 1;
    visibility: visible;
}

.swipe-section.next {
    transform: translateX(100%);
    z-index: 1;
    background: white;
}

/* Add visual cue for swipe */
.swipe-hint {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-right: 3px solid rgba(233, 30, 99, 0.3);
    border-top: 3px solid rgba(233, 30, 99, 0.3);
    transform: rotate(45deg);
    animation: hint-pulse 1.5s infinite;
}

@keyframes hint-pulse {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Password Section Transition */
#password-section {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s ease-out;
}

#password-section.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    visibility: hidden;
}

/* Add tap hint */
.tap-hint {
    font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(233, 30, 99, 0.5);
    font-size: 1rem;
    animation: pulse 1.5s infinite;
    pointer-events: none;
    font-weight: 300;
}

@keyframes pulse {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 0.3;
    }
}

/* Next Section Styles */
@keyframes fadeToBlack {
    0% {
        background-color: white;
    }
    100% {
        background-color: black;
    }
}

#next-section {
    background: white;
}

#next-section.black-bg {
    animation: fadeToBlack 1s ease-in-out forwards;
}

.netflix-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.netflix-video.visible {
    opacity: 1;
}

/* Netflix Profile Screen Styles */
.profile-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #141414;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    color: white;
    font-family: 'Netflix Sans', sans-serif;
}

.profile-screen.visible {
    opacity: 1;
}

.profile-title {
    font-size: 3.5vw;
    color: #fff;
    font-weight: 400;
    margin-bottom: 2rem;
}

.profiles-container {
    display: flex;
    gap: 2vw;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 4vw;
}

.profile {
    cursor: pointer;
    width: 10vw;
    min-width: 84px;
    max-width: 200px;
    text-align: center;
    transition: all 0.2s ease;
}

.profile:hover {
    transform: scale(1.1);
}

.profile-avatar {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 2px solid transparent;
}

.profile:hover .profile-avatar {
    border-color: #fff;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    color: rgb(128, 128, 128);
    font-size: 1.2vw;
    transition: color 0.2s ease;
}

.profile:hover .profile-name {
    color: #fff;
}

@font-face {
    font-family: 'Netflix Sans';
    src: url('Netflix Sans Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

.add-profile .profile-avatar {
    background: rgba(128, 128, 128, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-icon {
    font-size: 3vw;
    color: rgb(128, 128, 128);
    transition: color 0.2s ease;
}

.add-profile:hover .add-icon {
    color: white;
}

.add-profile {
    pointer-events: none;
    opacity: 0.5;
}

.add-profile:hover {
    transform: none;
}

.add-profile:hover .profile-avatar {
    border-color: transparent;
}

.add-profile:hover .profile-name,
.add-profile:hover .add-icon {
    color: rgb(128, 128, 128);
}

.manage-profiles {
    margin-top: 4rem;
    padding: 0.5em 2em;
    font-size: 1.2vw;
    color: rgb(128, 128, 128);
    background: transparent;
    border: 1px solid rgb(128, 128, 128);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Netflix Sans', sans-serif;
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.manage-profiles:hover {
    color: rgb(128, 128, 128);
    border-color: rgb(128, 128, 128);
}

.netflix-logo {
    position: absolute;
    top: 20px;
    left: 30px;
    width: 130px;
    height: auto;
}

.netflix-logo img {
    width: 100%;
    height: auto;
}

/* Content Page Styles */
.content-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #141414;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out;
    font-family: 'Netflix Sans', sans-serif;
}

.content-page.visible {
    opacity: 1;
    visibility: visible;
}

.netflix-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 60px;
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 1000;
}

.netflix-header .netflix-logo {
    width: 92px;
}

.main-nav {
    margin-left: 80px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav a {
    color: #e5e5e5;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.main-nav a.active {
    color: white;
    font-weight: bold;
    position: relative;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #e50914;
}

.featured-content {
    position: relative;
    height: 100vh;
    width: 100%;
    background: url('featured-bg.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: center;
    padding-left: 60px;
}

.content-info {
    max-width: 600px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 1s ease-in-out;
    margin-bottom: 0;
    position: relative;
    top: -40px;
}

.content-page.visible .content-info {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.5s;
}

.content-type {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    width: fit-content;
    margin-left: 40%; /* Start from middle of container */
    transform: translateX(-50%); /* Center the element */
}

.netflix-n-logo {
    height: 35px;
    width: auto;
}

.content-type span {
    color: #e5e5e5;
    font-size: 1.6vw;
    letter-spacing: 1px;
    font-weight: 500;
    text-transform: uppercase;
}

.content-title {
    font-size: 5vw;
    margin: 20px 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    text-align: left;
}

.content-rating {
    margin-bottom: 20px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.star {
    color: #e50914;
    margin-right: -4px;
    font-size: 1.8vw;
}

.year-info, .season-info {
    color: #e5e5e5;
    margin: 0 8px;
    font-size: 1.2vw;
    position: relative;
    top: 1px;
}

.content-description {
    color: white;
    font-size: 1.2vw;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    text-align: left;
    max-width: 500px;
}

.content-actions {
    display: flex;
    gap: 20px;
}

.play-button, .more-info-button {
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1.2vw;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-weight: bold;
    font-family: 'Netflix Sans', sans-serif;
}

.play-button {
    background: #e50914;
    color: white;
}

.play-button:hover {
    background: #ff0a16;
}

.more-info-button {
    background: rgba(109, 109, 110, 0.7);
    color: white;
}

.more-info-button:hover {
    background: rgba(109, 109, 110, 0.4);
}

.play-icon, .info-icon {
    font-size: 1.4vw;
}

.content-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 60px;
    background: linear-gradient(to top, rgba(20,20,20,1) 0%, rgba(20,20,20,0.7) 50%, transparent 100%);
    z-index: 1;
}

.content-nav a {
    color: #e5e5e5;
    text-decoration: none;
    margin-right: 30px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.content-nav a.active {
    color: white;
    font-weight: bold;
    position: relative;
}

.content-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #e50914;
}

.vlog-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

.vlog-player.visible {
    opacity: 1;
    visibility: visible;
}

.vlog-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.episode-info {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 4px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.episode-info span {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Netflix Sans', sans-serif;
    letter-spacing: 0.5px;
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: auto;
}

/* Progress Bar Styles */
.progress-bar-container {
    width: 100%;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    position: relative;
    cursor: pointer;
    margin-bottom: 8px;
    transition: height 0.2s ease-in-out;
}

.progress-bar:hover {
    height: 6px;
    margin-top: -1px;
    margin-bottom: 7px;
}

.progress-bar-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
}

.progress-bar-loaded {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    transition: width 0.3s ease-out;
}

.progress-bar-played {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: #E50914;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-played::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translate(0, -50%);
    width: 12px;
    height: 12px;
    background: #E50914;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Remove the hover rule since we want the circle always visible */
.progress-bar:hover .progress-bar-played::after {
    transform: translate(0, -50%);
}

/* When dragging, maintain the same transform */
.progress-bar.dragging .progress-bar-played::after {
    transform: translate(0, -50%);
}

.progress-time {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 14px;
    font-family: 'Netflix Sans', sans-serif;
    padding: 0 2px;
}

.control-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    font-family: 'Netflix Sans', sans-serif;
    font-size: 14px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.control-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Makes the icons white */
}

/* Fade effect for main content */
.content-page.fade-out .featured-content,
.content-page.fade-out .netflix-header,
.content-page.fade-out .content-nav {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
