:root {
    --primary: #c72027; /* Richer Turkish Airlines Red */
    --primary-hover: #a11a20;
    --dark: #0f1115;
    --text-main: #ffffff;
    --text-muted: #8b95a6;
    --bg-glass: rgba(15, 17, 21, 0.75);
    --border-glass: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(0, 0, 0, 0.3);
}

/* Typography & Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    background-color: #0b0f19; /* Deep dark background */
    color: #e5e7eb; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden;
}

/* ==========================================
   PRELOADER
============================================= */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #0b0f19;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}
.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.preloader-logo {
    width: 60px; height: 60px;
    color: var(--primary);
    animation: pulseLogo 1.5s ease-in-out infinite alternate;
}
.preloader-line-container {
    width: 150px; height: 2px;
    background: rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}
.preloader-line {
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: var(--primary);
    animation: scanLine 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes pulseLogo { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.1); opacity: 1; text-shadow: 0 0 20px rgba(199,32,39,0.6); } }
@keyframes scanLine { to { left: 100%; } }

/* ==========================================
   CINEMATIC BACKGROUND
============================================= */
.bg-image {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?q=80&w=2074&auto=format&fit=crop') center/cover no-repeat;
    z-index: -4;
    filter: blur(4px) brightness(0.3) contrast(1.2);
    transform: scale(1.05);
}

.bg-mesh {
    position: fixed;
    top: -50%; left: -50%;
    width: 200vw; height: 200vh;
    background: 
        radial-gradient(circle at 50% 50%, rgba(199, 32, 39, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(30, 41, 59, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(15, 23, 42, 0.6) 0%, transparent 50%);
    z-index: -3;
    animation: rotateMesh 30s linear infinite;
    filter: blur(60px);
}
@keyframes rotateMesh { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(180deg) scale(1.1); } 100% { transform: rotate(360deg) scale(1); } }

.particles-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
}
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(11, 15, 25, 0.9) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Header */
.minimal-header { padding: 40px; display: flex; justify-content: flex-start; align-items: center; position: relative; z-index: 10; }
.logo { display: flex; align-items: center; gap: 16px; }
.logo-icon { width: 48px; height: 48px; object-fit: contain; }
.logo-text { display: flex; flex-direction: column; }
.brand { font-size: 1.4rem; font-weight: 700; letter-spacing: 1.5px; color: var(--text-main); }
.sub-brand { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 2.5px; margin-top: 2px; }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    perspective: 1200px; /* Enhanced 3D depth */
    position: relative;
}

/* Premium Return Button */
.btn-return {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 100;
    animation: slideRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.btn-return.hidden { display: none; }
.btn-return:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
}
.btn-return svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.btn-return:hover svg { transform: translateX(-4px); }

@keyframes slideRight { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

/* Ultra-Premium Glass Card with Animated Border */
.card-border-glow {
    position: relative;
    padding: 2px; /* Border thickness */
    border-radius: 26px;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
}

.card-border-glow::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 70%, var(--primary) 80%, transparent 100%);
    animation: rotateGlow 4s linear infinite;
    z-index: -1;
}

@keyframes rotateGlow { 100% { transform: rotate(360deg); } }

.verification-card {
    background: var(--bg-glass);
    border-radius: 24px;
    padding: 56px 48px;
    width: 100%;
    max-width: 520px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    position: relative;
    z-index: 2;
    transition: opacity 0.5s ease;
}

/* ... keeping form styles intact ... */
.card-header { margin-bottom: 40px; text-align: center; }
.card-header h1 { font-size: 2.2rem; font-weight: 300; letter-spacing: -0.5px; margin-bottom: 16px; }
.card-header p { font-size: 1rem; color: var(--text-muted); line-height: 1.6; }
.card-indicator { width: 40px; height: 3px; background: var(--primary); border-radius: 2px; margin: 24px auto 0; }

.elegant-form { display: flex; flex-direction: column; gap: 24px; }

/* Laser Focus Effect on Inputs */
.form-floating {
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.form-floating input {
    width: 100%;
    padding: 32px 20px 12px 56px; /* Increased top padding to push text down */
    background: var(--input-bg);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    min-height: 64px; /* Ensure consistent height */
    line-height: 1.2;
}

/* Bottom animated laser line */
.form-floating::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2px;
    background: var(--primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    box-shadow: 0 -2px 10px rgba(199,32,39,0.8);
    border-radius: 2px;
}

.form-floating label {
    position: absolute;
    left: 56px; top: 22px; /* Centered initially when empty */
    color: #6a7485;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 70px);
}

.form-floating .input-icon {
    position: absolute;
    left: 20px; top: 21px; /* Centered vertically */
    width: 22px; height: 22px;
    color: #6a7485;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-floating input:focus, .form-floating input:valid {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
}
.form-floating input:focus ~ label, .form-floating input:valid ~ label {
    top: 10px; font-size: 0.75rem; color: var(--text-muted); font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase;
}
.form-floating input:focus ~ .input-icon, .form-floating input:valid ~ .input-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.form-floating input:focus {
    border-color: transparent;
}
/* Trigger laser line */
.form-floating input:focus ~ label::after, 
.form-floating:focus-within::after {
    width: calc(100% - 2px);
}

/* Magnetic Button (JS will handle transform) */
.btn-verify {
    background: var(--primary);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease; /* Exclude transform for JS */
    display: flex; justify-content: center; align-items: center;
    position: relative; overflow: hidden; margin-top: 8px;
    box-shadow: 0 4px 15px rgba(199, 32, 39, 0.2);
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-verify::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
}

.btn-verify:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(199, 32, 39, 0.4); }
.btn-verify:hover::before { left: 100%; }
.btn-verify:active { transform: translateY(0); box-shadow: 0 4px 15px rgba(199, 32, 39, 0.2); }
.btn-text { display: flex; align-items: center; gap: 10px; }
.spinner { width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.2); border-radius: 50%; border-top-color: white; animation: spin 0.8s linear infinite; }

.result-message { 
    margin-top: 24px; padding: 20px; border-radius: 16px; display: flex; align-items: flex-start; gap: 16px; animation: fadeIn 0.4s ease; 
}
.result-message.hidden { display: none; }
.result-message.error { background: rgba(199, 32, 39, 0.08); border: 1px solid rgba(199, 32, 39, 0.2); }
.error-icon { width: 32px; height: 32px; border-radius: 50%; background: rgba(199, 32, 39, 0.15); color: #ff4d54; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.error-icon svg { width: 18px; height: 18px; }
.error-content h4 { color: #ff8a8f; font-size: 1.05rem; margin-bottom: 4px; font-weight: 600; }
.error-content p { color: #b0b8c9; font-size: 0.9rem; line-height: 1.5; }

.minimal-footer { text-align: center; padding: 32px; color: #535d70; font-size: 0.85rem; animation: fadeIn 1s ease; }

/* ==========================================
   PREMIUM 3D TICKET UI
============================================= */
.ticket-wrapper {
    position: absolute;
    width: 100%;
    max-width: 480px;
    z-index: 10;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out; /* For JS mousemove */
}

.ticket-wrapper.hidden { display: none; }

.ticket-result {
    background: #ffffff; /* Real paper look */
    border-radius: 20px;
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.9), inset 0 0 0 1px rgba(255,255,255,0.5);
    color: #111827;
    overflow: hidden;
    position: relative;
    animation: ticketFlipIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: center center;
}

/* Hologram watermark */
.ticket-watermark {
    position: absolute;
    top: 50%; left: 50%;
    width: 300px; height: 300px;
    transform: translate(-50%, -50%) rotate(-15deg);
    color: rgba(229, 231, 235, 0.3); /* Subtle grey watermark */
    z-index: 0;
    pointer-events: none;
}

.ticket-header {
    background: var(--dark);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; z-index: 2;
    border-bottom: 2px solid var(--primary);
}

.ticket-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 1px; font-size: 1.1rem; }
.ticket-logo svg { width: 24px; height: 24px; color: var(--primary); }

.ticket-status {
    background: rgba(32, 201, 151, 0.15);
    color: #20c997;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(32, 201, 151, 0.3);
}
.ticket-status svg { width: 16px; height: 16px; }

.ticket-body { padding: 32px; position: relative; z-index: 2; }
.t-row { display: flex; justify-content: space-between; margin-bottom: 24px; }
.route-row { margin-bottom: 32px; }
.t-col { display: flex; flex-direction: column; gap: 6px; }
.t-col label { font-size: 0.75rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.t-col strong { font-size: 1.2rem; color: #111827; font-weight: 700; }
.text-right { text-align: right; align-items: flex-end; }
.text-center { text-align: center; align-items: center; }

/* Route Layout */
.t-route-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #f3f4f6;
}
.t-route-point { display: flex; flex-direction: column; gap: 4px; }
.t-route-point .t-time { font-size: 1.5rem; font-weight: 700; color: #111827; }
.t-route-point .t-airport { font-size: 1rem; font-weight: 600; color: var(--primary); letter-spacing: 1px; }
.t-route-point .t-terminal { font-size: 0.75rem; color: #6b7280; text-transform: uppercase; }

/* Premium Vector Route */
.t-route-vector {
    flex: 1;
    position: relative;
    height: 40px;
    margin: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flight-path {
    width: 100%; height: 100%; position: absolute;
}
.path-progress {
    stroke-dasharray: 145;
    stroke-dashoffset: 145;
    animation: drawPath 1.5s ease-out forwards;
    animation-delay: 0.5s;
}
.vector-plane {
    position: absolute;
    width: 20px; height: 20px;
    /* initial start position on the arc */
    top: 5px; left: 10px;
    opacity: 0;
    animation: flyPlane 1.5s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes drawPath { to { stroke-dashoffset: 0; } }
@keyframes flyPlane {
    0% { opacity: 0; transform: translate(0, 0) rotate(10deg); }
    10% { opacity: 1; transform: translate(10px, -4px) rotate(20deg); }
    50% { transform: translate(65px, -12px) rotate(45deg); }
    90% { opacity: 1; transform: translate(120px, -4px) rotate(70deg); }
    100% { opacity: 1; transform: translate(130px, 0) rotate(80deg); }
}

/* Ticket Perforation Divider */
.t-divider { position: relative; height: 2px; margin: 24px 0; display: flex; align-items: center; }
.dashed-line { flex: 1; border-bottom: 2px dashed #e5e7eb; }
.notch { position: absolute; width: 30px; height: 30px; background: var(--dark); border-radius: 50%; top: -15px; }
.notch.left { left: -47px; box-shadow: inset -3px 0 5px rgba(0,0,0,0.2); }
.notch.right { right: -47px; box-shadow: inset 3px 0 5px rgba(0,0,0,0.2); }

/* Real Barcode */
.t-barcode { display: flex; justify-content: center; padding-top: 4px; }
#real-barcode { width: 100%; max-height: 80px; }

/* Animations */
.animate-up { opacity: 0; transform: translateY(30px); animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.delay-1 { animation-delay: 0.1s; } .delay-2 { animation-delay: 0.2s; } .delay-3 { animation-delay: 0.3s; }

@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
@keyframes slideOut { to { opacity: 0; transform: translateY(-50px) scale(0.95); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes ticketFlipIn {
    0% { opacity: 0; transform: translateY(100px) rotateX(20deg) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) rotateX(0deg) scale(1); }
}

@media (max-width: 600px) {
    .minimal-header { padding: 20px; justify-content: center; }
    .logo-icon { width: 36px; height: 36px; }
    .brand { font-size: 1.1rem; }
    .sub-brand { font-size: 0.55rem; letter-spacing: 1.5px; }
    
    .main-content { flex-direction: column; justify-content: flex-start; padding-top: 20px; }
    
    .verification-card { padding: 32px 20px; border-radius: 20px; }
    .card-header h1 { font-size: 1.8rem; }
    .card-header p { font-size: 0.9rem; }
    
    .btn-return { top: 10px; left: 10px; padding: 10px 16px; font-size: 0.9rem; position: relative; margin: 0 auto 20px; }

    .ticket-wrapper { position: relative; margin: 20px auto 40px; }
    .ticket-result { border-radius: 16px; }
    .ticket-header { padding: 16px 20px; flex-wrap: wrap; gap: 12px; justify-content: center; text-align: center; }
    .ticket-logo { font-size: 0.95rem; justify-content: center; }
    .ticket-logo svg { width: 20px; height: 20px; }
    .ticket-status { font-size: 0.75rem; padding: 4px 10px; margin: 0 auto; }
    
    .ticket-body { padding: 20px; }
    .t-row { margin-bottom: 16px; }
    .t-col strong { font-size: 1rem; }
    
    /* Restore horizontal plane route for mobile */
    .t-route-container { padding: 16px; margin-bottom: 20px; flex-direction: row; gap: 10px; }
    .t-route-point { align-items: flex-start; text-align: left; }
    .text-right .t-route-point { align-items: flex-end; text-align: right; }
    .t-route-point .t-time { font-size: 1.25rem; }
    .t-route-point .t-airport { font-size: 0.9rem; }
    
    .t-route-vector { height: 30px; margin: 0 10px; flex: 1; }
    .flight-path { display: block; }
    .vector-plane { opacity: 0; animation: flyPlane 1.5s ease-out forwards; animation-delay: 0.5s; transform: none; top: 0; left: 0; margin: 0; color: inherit; }
    
    .notch.left { left: -35px; top: -15px; } 
    .notch.right { right: -35px; top: -15px; }
    
    #real-barcode { max-height: 50px; }
}
