/* ============================================
   3D passport book (CSS perspective + page flips)
   Shared by the profile page and the in-app overlay.
   ============================================ */

.passport-scene {
    perspective: 1400px;
    display: flex;
    justify-content: center;
    margin-top: 28px;
    padding: 10px 0 20px;
}

.passport-book {
    position: relative;
    width: 230px;
    height: 320px;
    transform-style: preserve-3d;
    transition: transform 0.7s ease;
    animation: passport-float 5s ease-in-out infinite;
    transform: rotateX(6deg);
}

.passport-book.book-open {
    /* Shift right so the spine sits centered when open */
    transform: rotateX(6deg) translateX(115px);
}

.passport-book.book-closed-end {
    /* Fully flipped: all pages stack left of the spine, so shift right by a
       full page width to keep the closed book centered */
    transform: rotateX(6deg) translateX(230px);
}

@keyframes passport-float {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -10px; }
}

.passport-sheet {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.4, 0.1, 0.2, 1);
    cursor: pointer;
}

.passport-sheet.flipped {
    transform: rotateY(-180deg);
}

.sheet-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 4px 10px 10px 4px;
    overflow: hidden;
    background: #f2ecd8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.sheet-back {
    transform: rotateY(180deg);
    border-radius: 10px 4px 4px 10px;
}

.sheet-face:not(.sheet-cover)::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(74, 168, 255, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 75% 80%, rgba(255, 92, 122, 0.05) 0%, transparent 45%);
    pointer-events: none;
}

.sheet-cover {
    background: linear-gradient(145deg, #14343f 0%, #0d2530 60%, #0a1c26 100%);
    border: 1px solid rgba(255, 215, 130, 0.25);
}

.cover-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #d8b96a;
}

.cover-emblem {
    font-size: 3rem;
    border: 2px solid rgba(216, 185, 106, 0.6);
    border-radius: 50%;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-title {
    font-size: 1.05rem;
    font-weight: bold;
    letter-spacing: 4px;
    text-align: center;
    line-height: 1.6;
}

.cover-title-back {
    font-size: 0.9rem;
    letter-spacing: 3px;
}

.cover-name {
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: rgba(216, 185, 106, 0.8);
    max-width: 85%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cover-hint {
    position: absolute;
    bottom: 14px;
    font-size: 0.65rem;
    color: rgba(216, 185, 106, 0.45);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.page-content {
    position: relative;
    height: 100%;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

.page-empty {
    color: #8a9aa2;
    font-size: 0.8rem;
    text-align: center;
}

.page-stamp {
    border: 2px dashed;
    border-radius: 8px;
    padding: 6px 12px;
    text-align: center;
    background: rgba(255, 255, 255, 0.35);
    max-width: 90%;
    position: relative;
}

.page-stamp-city {
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.page-stamp-country {
    font-size: 0.65rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.page-stamp-date {
    font-size: 0.6rem;
    opacity: 0.7;
    margin-top: 2px;
    letter-spacing: 1px;
}

.page-stamp-visits {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.6rem;
    font-weight: bold;
    background: #f2ecd8;
    border: 1px solid currentColor;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gold achievement pages */
.achievements-page {
    background: linear-gradient(135deg, #f0e0b4 0%, #e6cf98 55%, #dcc386 100%);
    justify-content: flex-start;
    gap: 14px;
    padding-top: 22px;
}

.achievements-title {
    font-size: 0.65rem;
    letter-spacing: 3px;
    color: #8a6d2f;
    font-weight: bold;
}

.achievements-title i {
    margin-right: 4px;
}

.achieve-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: rgba(255, 252, 240, 0.5);
    border: 1px solid rgba(138, 109, 47, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
}

.achieve-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 2px solid #a8842f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a6d2f;
    font-size: 1rem;
    background: rgba(255, 250, 230, 0.6);
}

.achieve-text {
    text-align: left;
    min-width: 0;
}

.achieve-name {
    font-weight: bold;
    font-size: 0.78rem;
    letter-spacing: 1px;
    color: #5f4a1a;
}

.achieve-sub {
    font-size: 0.68rem;
    color: #8a6d2f;
}

.passport-info-page {
    justify-content: center;
    gap: 10px;
    color: #3a4a52;
}

.info-page-title {
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: #6a7a82;
}

.info-page-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #14343f;
}

.info-page-line {
    font-size: 0.72rem;
    color: #5a6a72;
}

.info-page-seal {
    margin-top: 10px;
    font-size: 2.2rem;
    color: rgba(20, 52, 63, 0.25);
    transform: rotate(-12deg);
}

.passport-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 4px;
}

.passport-nav {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.passport-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
}

.passport-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.passport-page-num {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    min-width: 90px;
    text-align: center;
}

/* In-app floating overlay (above the video) */
.passport-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.passport-overlay-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

.passport-overlay-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.passport-overlay-name {
    font-family: 'Futura Round', sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
    text-align: center;
}

.passport-overlay-loading {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Futura Round', sans-serif;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .passport-book { width: 190px; height: 265px; }
    .passport-book.book-open { transform: rotateX(6deg) translateX(95px); }
    .passport-book.book-closed-end { transform: rotateX(6deg) translateX(190px); }
}
