/* 
   Pastel Love Warrant Stylesheet
   Designed with rich aesthetics, glassmorphism, responsive layout, and playful animations.
*/

:root {
    --primary: #ff7597;
    --primary-hover: #ff4d79;
    --primary-light: #ffeef2;
    --secondary: #9b8cff;
    --secondary-hover: #7b66ff;
    --success: #4cd964;
    --background: linear-gradient(135deg, #ffd3b6 0%, #ffaaa5 30%, #dcedc1 70%, #a8e6cf 100%);
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-border: rgba(255, 255, 255, 0.7);
    --text-main: #4a4a4a;
    --text-muted: #6e6e6e;
    --font-thai: 'Mitr', sans-serif;
    --font-eng: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-thai);
    background: var(--background);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    color: var(--text-main);
    padding: 20px;
}

/* Background Animation */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Hearts */
.hearts-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-heart {
    position: absolute;
    bottom: -50px;
    font-size: 1.5rem;
    color: rgba(255, 117, 151, 0.4);
    user-select: none;
    animation: floatUp 6s linear forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-105vh) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 16px 32px rgba(255, 150, 150, 0.15),
                0 4px 8px rgba(0, 0, 0, 0.05);
    z-index: 5;
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 30px;
}

/* Modal Overlay styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 235, 235, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}

/* Prompt Card for Names */
.prompt-card {
    text-align: center;
}

/* Name Gate Overlay */
.name-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffeef2 0%, #e8f0fe 50%, #fff0f3 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 95;
    padding: 20px;
}

.gate-error {
    font-size: 0.85rem;
    color: var(--primary-hover);
    font-weight: 500;
    min-height: 1.3em;
    transition: all 0.3s ease;
    margin-top: -4px;
}

@keyframes shakeInput {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

.input-shake {
    animation: shakeInput 0.5s ease;
}

/* ===== Back Button ===== */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(155, 140, 255, 0.25);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--secondary);
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(155, 140, 255, 0.2);
}

.back-btn:active {
    transform: translateX(-1px) scale(0.95);
}

/* ===== Fingerprint Scanner Screen ===== */
.fingerprint-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffeef2 0%, #e8e0ff 50%, #fff0f3 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 93;
    padding: 20px;
}

.fingerprint-content {
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.fp-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-hover);
    margin-bottom: 8px;
}

.fp-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.5;
}

.fingerprint-scanner {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 24px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* SVG Progress Ring */
.fp-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.fp-ring-bg {
    fill: none;
    stroke: rgba(155, 140, 255, 0.15);
    stroke-width: 6;
}

.fp-ring-progress {
    fill: none;
    stroke: var(--secondary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 452.39; /* 2 * PI * 72 */
    stroke-dashoffset: 452.39;
    transition: stroke-dashoffset 0.08s linear, stroke 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(155, 140, 255, 0.4));
}

/* Fingerprint Icon */
.fp-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--secondary);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.fp-icon.scanning {
    opacity: 1;
    color: var(--primary);
    filter: drop-shadow(0 0 12px rgba(255, 117, 151, 0.5));
    animation: fpPulse 0.8s ease-in-out infinite alternate;
}

.fp-icon.success {
    opacity: 1;
    color: var(--success);
    filter: drop-shadow(0 0 16px rgba(76, 217, 100, 0.6));
    transform: translate(-50%, -50%) scale(1.15);
}

@keyframes fpPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.08); }
}

/* Scan Line Effect */
.fp-scanline {
    position: absolute;
    left: 20%;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 2px;
    opacity: 0;
    top: 20%;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 117, 151, 0.6);
}

.fp-scanline.active {
    opacity: 1;
    animation: scanLineMove 1.5s ease-in-out infinite;
}

@keyframes scanLineMove {
    0% { top: 20%; opacity: 0.3; }
    50% { opacity: 1; }
    100% { top: 80%; opacity: 0.3; }
}

/* Status & Percentage Text */
.fp-status {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    transition: color 0.3s ease;
    min-height: 1.4em;
}

.fp-status.scanning {
    color: var(--primary);
}

.fp-status.success {
    color: var(--success);
    font-weight: 600;
}

.fp-percent {
    font-family: var(--font-eng);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.fp-percent.success {
    color: var(--success);
}

/* Glow ring when scanning */
.fingerprint-scanner.scanning {
    animation: scannerGlow 1s ease-in-out infinite alternate;
}

@keyframes scannerGlow {
    0% { filter: drop-shadow(0 0 0px transparent); }
    100% { filter: drop-shadow(0 0 15px rgba(255, 117, 151, 0.25)); }
}

.pulse-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: heartPulse 1.5s infinite alternate;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.prompt-card h2 {
    font-weight: 600;
    color: var(--primary-hover);
    margin-bottom: 10px;
}

.prompt-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.input-group input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 14px;
    border: 2px solid rgba(255, 117, 151, 0.3);
    background: rgba(255, 255, 255, 0.8);
    font-family: var(--font-thai);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 117, 151, 0.2);
    background: #fff;
}

/* Buttons System */
.btn {
    font-family: var(--font-thai);
    font-size: 1.05rem;
    font-weight: 500;
    padding: 12px 24px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ff527b 100%);
    color: white;
    box-shadow: 0 6px 15px rgba(255, 82, 123, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 82, 123, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    border: 2px solid rgba(155, 140, 255, 0.3);
}

.btn-secondary:hover {
    background: #fff;
    border-color: var(--secondary);
    color: var(--secondary-hover);
}

.btn-success {
    background: linear-gradient(135deg, #4cd964 0%, #30b847 100%);
    color: white;
    box-shadow: 0 6px 15px rgba(76, 217, 100, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 217, 100, 0.45);
}

.btn-pulse {
    animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffeef2 0%, #e8f0fe 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 90;
    text-align: center;
    padding: 20px;
}

.loader-content {
    max-width: 400px;
    width: 100%;
}

.spinner {
    font-size: 4.5rem;
    animation: spinnerBounce 2s infinite ease-in-out;
    margin-bottom: 20px;
}

@keyframes spinnerBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.loading-screen h2 {
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
    border-radius: 6px;
    transition: width 0.1s linear;
}

/* Main Warrant Container */
.warrant-container {
    z-index: 10;
    width: 100%;
    max-width: 500px;
}

.warrant-card {
    overflow: visible;
}

.folder-tab {
    position: absolute;
    top: -24px;
    left: 24px;
    background: var(--primary);
    color: white;
    font-family: var(--font-eng);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 8px rgba(255, 117, 151, 0.15);
}

.warrant-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px dashed rgba(255, 117, 151, 0.3);
    padding-bottom: 15px;
}

.police-badge {
    font-size: 3rem;
    margin-bottom: 5px;
}

.warrant-header h1 {
    font-weight: 600;
    font-size: 1.8rem;
    color: var(--primary-hover);
}

.case-number {
    font-family: var(--font-eng);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 4px;
}

/* Suspect Profile Section */
.suspect-profile {
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    padding: 15px;
    margin-bottom: 25px;
}

.photo-frame {
    width: 110px;
    height: 110px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    position: relative;
    transform: rotate(-3deg);
    flex-shrink: 0;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%; /* Focus on the face in the center-top of the photo */
    border-radius: 8px;
    background: #ffeef2;
}

.stamp-confidential {
    position: absolute;
    bottom: 5px;
    right: -8px;
    background: rgba(255, 77, 121, 0.9);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    transform: rotate(12deg);
    letter-spacing: 0.5px;
    border: 1px solid white;
}

.suspect-info {
    flex-grow: 1;
}

.suspect-info .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 2px;
}

.name-display {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--primary-hover);
    margin-bottom: 6px;
}

.status-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Sections Inside Card */
.warrant-section {
    margin-bottom: 25px;
}

.warrant-section h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--secondary-hover);
    display: flex;
    align-items: center;
    gap: 6px;
}

.charges-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.charges-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.charges-list .icon {
    font-size: 1.25rem;
    background: white;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.charge-details {
    display: flex;
    flex-direction: column;
}

.charge-details strong {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

.charge-details span {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.evidence-box {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    padding: 12px 16px;
    border: 1px dashed rgba(155, 140, 255, 0.4);
}

.evidence-box p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 6px;
}

.evidence-box p:last-child {
    margin-bottom: 0;
}

/* Plea Section & Runaway Button */
.plea-section {
    text-align: center;
    border-top: 2px dashed rgba(255, 117, 151, 0.3);
    padding-top: 20px;
}

.question-text {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 18px;
    color: var(--text-main);
}

.button-group {
    display: flex;
    gap: 15px;
    position: relative;
    height: 52px; /* Set fixed height to contain the relative layout */
    justify-content: center;
    align-items: center;
}

.button-group .btn {
    position: absolute;
    width: calc(50% - 8px);
}

/* Position left button and right button initially */
#denyBtn {
    left: 0;
    transition: transform 0.1s ease, opacity 0.3s ease;
    z-index: 10;
}

#confessBtn {
    right: 0;
    z-index: 11;
}

/* Verdict / Sentence Card */
.verdict-card {
    text-align: center;
    max-width: 440px;
}

.celebration-emoji {
    font-size: 3.5rem;
    margin-bottom: 15px;
    animation: bounceEmoji 1s infinite alternate;
}

@keyframes bounceEmoji {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.verdict-card h2 {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.verdict-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.sentence-box {
    background: #fff0f3;
    border: 2px dashed var(--primary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: inset 0 0 10px rgba(255, 117, 151, 0.05);
}

.sentence-box h3 {
    font-size: 1.15rem;
    color: var(--primary-hover);
    margin-bottom: 8px;
}

.sentence-box p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.sentence-box .sentence-host {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 10px;
    border-top: 1px solid rgba(255, 117, 151, 0.2);
    padding-top: 8px;
}

.contact-prompt {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Animate pop utility */
.animate-pop {
    animation: animPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes animPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Confetti CSS */
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd3b6;
    top: -10px;
    z-index: 101;
    opacity: 0.8;
    border-radius: 50%;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(105vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive adjustment */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .glass-card {
        padding: 20px;
    }
    
    .warrant-header h1 {
        font-size: 1.5rem;
    }
    
    .suspect-profile {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .photo-frame {
        transform: rotate(0);
    }
    
    .name-display {
        font-size: 1.25rem;
    }
}
