/* ==========================================================================
   Suzuki Fronx Owners Club Sri Lanka - Membership Verification Portal
   ========================================================================== */

/* Custom Font Definition */
@font-face {
    font-family: 'FronxClubFont';
    src: url('../fonts/FE.ttf') format('truetype'),
         url('../fonts/FE.TTF') format('truetype'),
         url('../../FE.ttf') format('truetype'),
         url('../../FE.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: #f0f2f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f0f2f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.app-layout.scan-layout-bg {
    background: #ffffff;
}

.zoom-out {
    transform: scale(0.7);
    opacity: 0;
}

/* Header Styles */
.main-header {
    background: #fff;
    padding: 15px 30px;
    border-bottom: 4px solid #b00000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.header-logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header-logo {
    width: 50px;
    height: auto;
    margin-right: 15px;
    display: block;
}

.header-title {
    color: #333;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.8px;
    line-height: 1.3;
}

/* Footer Styles */
.main-footer {
    background: #f0f0f0;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.footer-text {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
}

.footer-small {
    display: none;
}

/* Main Content Container */
.main-content-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 15px;
}

.main-content-container.scanner-container {
    align-items: flex-start;
    padding-top: 40px;
}

/* Home Card */
.home-card {
    max-width: 500px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 35px 25px;
    text-align: center;
    border: 1px solid #ddd;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.1);
}

.card-title {
    color: #222;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 30px;
    margin-top: 0;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Option Buttons */
.option-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
}

.option-button .subtitle {
    font-size: 14px;
    font-weight: 400;
    margin-top: 5px;
    opacity: 0.9;
}

/* Highlighted Primary Button */
.primary-highlight {
    background: #b00000;
    color: #fff;
    box-shadow: 0 5px 20px rgba(176, 0, 0, 0.4);
}

.primary-highlight:hover {
    background: #9a0000;
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(176, 0, 0, 0.5);
}

/* Manual Option Box */
.manual-option-box {
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #fcfcfc;
    text-align: left;
}

.manual-title {
    font-size: 1.4rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 5px;
}

.manual-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.manual-form {
    display: flex;
    gap: 10px;
}

.id-input {
    flex-grow: 1;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.id-input:focus {
    outline: none;
    border-color: #b00000;
    box-shadow: 0 0 0 3px rgba(176, 0, 0, 0.2);
}

/* Standard Buttons */
.btn {
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.3s, transform 0.1s, box-shadow 0.3s;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    display: inline-block;
    cursor: pointer;
    text-align: center;
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #b00000;
    color: #fff;
    border: 1px solid #b00000;
}

.btn-primary:hover {
    background: #9a0000;
    border-color: #9a0000;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Scanner Styles */
.scanner-box-container {
    text-align: center;
    width: 100%;
}

.scanner-box {
    position: relative;
    width: min(330px, 86vw);
    height: min(330px, 86vw);
    border-radius: 18px;
    overflow: hidden;
    border: 3.5px solid #b00000;
    box-shadow: 0 0 28px rgba(176, 0, 0, 0.45);
    margin: 0 auto;
    background: #000;
}

.scanner-feed {
    width: 100%;
    height: 100%;
    background: black;
    overflow: hidden;
    position: relative;
}

.scanner-feed video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.glow-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 14px;
    box-shadow: 0 0 35px rgba(255, 0, 0, 0.7);
    z-index: 10;
}

.laser {
    position: absolute;
    top: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        transparent,
        #ff3b30 25%,
        #ffffff 50%,
        #ff3b30 75%,
        transparent
    );
    box-shadow: 0 0 14px #ff3b30, 0 0 4px #ffffff;
    animation: laserMove 2.2s infinite ease-in-out;
    z-index: 20;
    pointer-events: none;
}

@keyframes laserMove {
    0% { top: 0%; opacity: 0.6; }
    50% { top: 97%; opacity: 1; }
    100% { top: 0%; opacity: 0.6; }
}

.scan-hint {
    margin-top: 15px;
    color: #666;
    font-size: 15px;
}

.scanner-controls {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.camera-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #333;
    max-width: 250px;
}

.home-btn {
    max-width: 330px;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 0px;
    width: 100%;
    display: block;
    margin-top: 20px;
}

.scan-error-msg {
    margin: 15px auto 0;
    max-width: 330px;
    color: #d32f2f;
    font-size: 14px;
    background: #fde8e8;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f8b4b4;
    display: none;
}

/* Verify Card Styles */
.verify-card {
    max-width: 450px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 35px 25px;
    text-align: center;
    border: 1px solid #ddd;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.verify-card::before,
.verify-card::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 0;
}

.verify-card::before {
    top: 0;
    right: 0;
    background: linear-gradient(135deg, transparent 50%, rgba(176, 0, 0, 0.1) 50%);
}

.verify-card::after {
    bottom: 0;
    left: 0;
    background: linear-gradient(315deg, transparent 50%, rgba(0, 0, 0, 0.05) 50%);
}

.verify-card .card-title {
    color: #222;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: 0.8px;
    border-bottom: 2px solid #ff4444;
    display: inline-block;
    padding-bottom: 5px;
    margin-top: 0;
}

.card-subtitle {
    color: #555;
    margin-bottom: 25px;
    font-size: 15px;
    margin-top: 20px;
}

.id-display {
    font-size: 28px;
    color: #d32f2f;
    font-weight: bold;
    letter-spacing: 2px;
}

.vehicle-font {
    font-family: 'FronxClubFont', monospace, sans-serif;
    font-size: 32px;
    font-weight: normal;
}

.id-display.vehicle-font {
    font-size: 28px;
    letter-spacing: 1px;
}

.status-section {
    padding: 10px 0;
    border-top: 1px dashed #e0e0e0;
    margin-top: 15px;
    position: relative;
    z-index: 1;
}

.status-section.hidden {
    display: none !important;
}

/* Luxury Automotive Verification Loader Screen */
.qr-scan-box {
    width: 170px;
    height: 170px;
    margin: 22px auto;
    border: 2px solid rgba(176, 0, 0, 0.4);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8), 0 8px 24px rgba(176, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Futuristic grid pattern background */
.qr-scan-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 15px 15px;
    pointer-events: none;
}

/* Corner bracket HUD markers */
.qr-scan-box::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(239, 68, 68, 0.35);
    border-radius: 8px;
    pointer-events: none;
}

.scan-animation {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ef4444 30%, #ffffff 50%, #ef4444 70%, transparent);
    box-shadow: 0 0 14px #ef4444, 0 0 4px #ffffff;
    animation: scanMove 1.6s infinite ease-in-out;
    z-index: 2;
}

@keyframes scanMove {
    0% { top: 6px; opacity: 0.6; }
    50% { top: 158px; opacity: 1; }
    100% { top: 6px; opacity: 0.6; }
}

.loading-text {
    color: #b00000;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Result Badges */
.badge-icon {
    display: block;
    line-height: 1;
}

.verified-badge {
    font-size: 60px;
    color: #28a745;
    animation: pulse 1.5s infinite;
    margin: 10px 0;
}

.verified-text {
    color: #28a745;
    font-weight: 800;
    font-size: 24px;
    margin-top: 5px;
}

.notfound-badge {
    font-size: 60px;
    color: #dc3545;
    margin: 10px 0;
}

.notfound-text {
    color: #dc3545;
    font-weight: 800;
    font-size: 24px;
    margin-top: 5px;
}

.error-badge {
    font-size: 60px;
    color: #ff8c00;
    margin: 10px 0;
}

.error-text {
    color: #ff8c00;
    font-weight: 800;
    font-size: 24px;
    margin-top: 5px;
}

.verification-details {
    margin-top: 20px;
    padding: 16px 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.detail-label {
    color: #64748b;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vehicle-plate-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2.5px solid #1e293b;
    border-radius: 8px;
    padding: 8px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 0 4px rgba(0, 0, 0, 0.04);
    margin: 6px auto 0;
    max-width: 100%;
}

.vehicle-highlight {
    color: #b00000;
    font-size: clamp(22px, 6.5vw, 34px);
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1.15;
}

.btn-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 35px;
    z-index: 1;
}

.btn-row .btn {
    width: auto;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.95; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive Media Queries */
@media (max-width: 600px) {
    .header-title {
        font-size: 1.1rem;
    }
    .main-header {
        padding: 10px 15px;
    }
    .header-logo {
        width: 40px;
    }
    .home-card,
    .verify-card {
        padding: 25px 15px;
    }
    .card-title,
    .verify-card .card-title {
        font-size: 22px;
    }
    .id-display {
        font-size: 24px;
    }
    .id-display.vehicle-font {
        font-size: 24px;
    }
    .manual-form {
        flex-direction: column;
    }
    .id-input,
    .manual-submit-btn {
        width: 100%;
    }
    .btn-row {
        width: 100%;
        flex-direction: column;
        gap: 10px;
        margin-top: 30px;
    }
    .btn-row .btn {
        width: 100%;
        padding: 12px 0px;
    }
    .footer-small {
        display: inline;
    }
}

@media (max-width: 400px) {
    .scanner-box {
        width: 270px;
        height: 270px;
    }
    @keyframes laserMove {
        0% { top: 0px; }
        50% { top: 260px; }
        100% { top: 0px; }
    }
}

/* ==========================================================================
   Top Luxury Glowing Progress Line (YouTube / Linear luxury sweep)
   ========================================================================== */
.top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    opacity: 0;
    background: linear-gradient(90deg, #b00000 0%, #ef4444 35%, #ffffff 65%, #ef4444 85%, #b00000 100%);
    background-size: 200% 100%;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 4px rgba(176, 0, 0, 1);
    z-index: 999999;
    pointer-events: none;
    transition: width 0.22s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.3s ease;
    animation: progressGlowSweep 1.8s linear infinite;
}

@keyframes progressGlowSweep {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ==========================================================================
   Premium Automotive Modern Page Loader Screen
   ========================================================================== */
.app-page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    pointer-events: auto;
}

.app-page-loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(28, 30, 36, 0.88) 0%, rgba(10, 11, 14, 0.97) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.loader-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.loader-visual-wrapper {
    position: relative;
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

/* Pulsing radar wave */
.loader-pulse-ring {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(176, 0, 0, 0.3) 0%, rgba(176, 0, 0, 0) 70%);
    animation: radarPulse 2s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
}

/* Outer rotating tachometer bezel */
.loader-tach-outer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: #b00000;
    border-right-color: #ef4444;
    animation: tachSpin 1.1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    box-shadow: 0 0 18px rgba(176, 0, 0, 0.4);
}

/* Inner counter-rotating speed ring */
.loader-tach-inner {
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.22);
    border-bottom-color: #ffffff;
    animation: tachSpinReverse 1.8s linear infinite;
}

/* Center core emblem */
.loader-core-badge {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #18191d;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 3px 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.loader-core-logo {
    width: 32px;
    height: auto;
    object-fit: contain;
}

.loader-core-fallback {
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    letter-spacing: 1px;
}

.loader-caption-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-brand-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2.8px;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.loader-shimmer-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: #e2e8f0;
}

.loader-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: dotBlink 1s ease-in-out infinite;
}

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

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

@keyframes radarPulse {
    0% { transform: scale(0.85); opacity: 0.85; }
    50% { transform: scale(1.35); opacity: 0.35; }
    100% { transform: scale(1.65); opacity: 0; }
}

@keyframes dotBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.65); }
}

/* ==========================================================================
   Button Loading Micro-Interactions
   ========================================================================== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.88;
}

.inline-btn-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tachSpin 0.65s linear infinite;
    margin-right: 7px;
    vertical-align: middle;
}

.btn-secondary .inline-btn-spinner {
    border-color: rgba(50, 50, 50, 0.2);
    border-top-color: #222;
}

/* ==========================================================================
   Mobile-First & Ultra Touch-Friendly Optimization
   ========================================================================== */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    overflow-x: hidden;
}

/* Prevent mobile iOS zoom on input focus */
input, select, textarea {
    font-size: 16px !important;
}

/* Smooth Touch Feedback */
.btn, .option-button, .period-pill, .quick-nav-box, .banner-link {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:active, .option-button:active, .quick-nav-box:active {
    transform: scale(0.98);
}

/* Mobile Screens (< 768px) */
@media (max-width: 768px) {
    .main-header {
        padding: 12px 16px;
    }
    .header-logo {
        width: 44px;
        margin-right: 12px;
    }
    .header-title {
        font-size: 1.05rem;
        line-height: 1.25;
    }
    .main-content-container {
        padding: 16px 12px 28px;
    }
    .home-card, .login-card, .verify-card {
        padding: 24px 18px;
        border-radius: 12px;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }
    .btn {
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Small Smartphone Screens (< 480px) */
@media (max-width: 480px) {
    .main-header {
        padding: 10px 12px;
    }
    .header-logo {
        width: 38px;
        margin-right: 10px;
    }
    .header-title {
        font-size: 0.95rem;
        letter-spacing: 0.3px;
    }
    .card-title {
        font-size: 20px;
        margin-bottom: 18px;
    }
    .card-subtitle {
        font-size: 13.5px;
        margin-bottom: 18px;
    }
    .option-button {
        padding: 18px 14px;
    }
    .option-button span {
        font-size: 16px;
    }
    .option-button .subtitle {
        font-size: 12px;
    }
    .manual-option-box {
        padding: 16px 14px;
    }
    .id-input {
        min-height: 48px;
        padding: 11px 14px;
        border-radius: 8px;
    }
    .vehicle-highlight {
        font-size: clamp(22px, 6.5vw, 32px);
        letter-spacing: 1.5px;
        word-break: break-all;
    }
    .id-display.vehicle-font {
        font-size: clamp(22px, 6.5vw, 32px);
    }
    .logged-in-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
    }
    .banner-links {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 12px;
    }
}


/* ==========================================================================
   Premium Vector Icon & Micro-Interaction Styling
   ========================================================================== */
.svg-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.dash-btn-with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-svg-icon {
    flex-shrink: 0;
}
