﻿.background {
    min-height: 100vh;
    background-image: url("../images/bg_03.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    position: sticky; /* optional: keep it visible while scrolling */
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.store-badge {
    height: 16px;
    width: auto;
    display: block;
    margin-right: 10px;
}

.app-main {
    flex: 1; /* pushes footer down */
    /* IMPORTANT: background image is set per-page via an inline style or CSS class */
    background-color: rgba(11, 18, 32, 0.35);
    padding: 24px 16px;
    min-height: calc(100vh - 120px); /* rough: header+footer */
}


.app-footer {
    flex: 0 0 auto; /* footer takes only its content height */
    padding: 16px;
    background: rgba(0,0,0,0.04);
    border-top: 1px solid rgba(0,0,0,0.06);
}

/*.app-footer {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(0,0,0,0.04);
    border-top: 1px solid rgba(0,0,0,0.06);
}*/

    .app-footer a {
        margin-left: 12px;
        text-decoration: none;
        color: inherit;
    }

        .app-footer a:hover {
            text-decoration: underline;
        }

/* Content card with semi-transparent background for text visibility */
.content-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2rem;
    margin: 1rem auto;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Text inside content cards should be dark for readability */
.content-card,
.content-card * {
    color: #333;
    text-shadow: none !important;
}

/* Buttons inside content cards must keep white text */
.content-card .btn-primary,
.content-card .btn-primary *,
.content-card .btn-secondary,
.content-card .btn-secondary *,
.content-card .btn-success,
.content-card .btn-success * {
    color: #fff !important;
}

.content-card h1,
.content-card h2,
.content-card h3,
.content-card h4,
.content-card h5,
.content-card h6 {
    background: transparent;
    padding: 0;
    display: block;
}

.content-card .text-muted {
    color: #666 !important;
}

.content-card .alert {
    color: inherit;
}

.pack-info {
    background: rgba(240, 240, 240, 0.8);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.pack-info p {
    margin: 0.5rem 0;
    color: #333;
}

/* Login prompt styling */
.login-prompt {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    margin: 1rem 0;
}

/* All text in login prompt should be dark */
.login-prompt,
.login-prompt * {
    color: #333;
    text-shadow: none !important;
}

.login-icon {
    color: #666;
    margin-bottom: 1rem;
}

.login-prompt h3 {
    margin-bottom: 0.5rem;
}

.login-prompt p {
    color: #555;
    margin-bottom: 1.5rem;
}

/* Card images - single card per row, centered */
.card-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.card-image {
    width: 100%;
    max-width: 350px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: block;
    margin: 0 auto;
}

/* Card placeholders - single placeholder per row, centered */
.card-placeholders {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.card-placeholder {
    width: 100%;
    max-width: 350px;
    height: 350px;
    min-height: 350px;
    background-color: rgba(224, 224, 224, 0.8);
    border: 2px dashed rgba(170, 170, 170, 0.8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Loading spinner for cards */
.card-loading-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(170, 170, 170, 0.3);
    border-top-color: #555;
    border-radius: 50%;
    animation: card-spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes card-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Card loading state - replaces card image while loading */
.card-loading {
    width: 100%;
    max-width: 350px;
    height: 350px;
    min-height: 350px;
    background: linear-gradient(135deg, rgba(240, 240, 240, 0.95) 0%, rgba(220, 220, 220, 0.95) 100%);
    border: 2px dashed rgba(150, 150, 150, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Card image wrapper - simple layout */
.card-image-wrapper {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    padding: 2px;
    box-sizing: border-box;
}

.card-image-wrapper .card-image {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: block;
}

/* Make main content centered */
.main-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
}

/* Text over background image needs white color with strong shadow */
.main-content h1,
.main-content h2,
.main-content h3 {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 4px 20px rgba(0, 0, 0, 0.7);
    display: inline-block;
}

/* Text inside content cards uses dark colors */
.content-card h1,
.content-card h2,
.content-card h3 {
    color: #333;
    text-shadow: none;
    background: transparent;
    padding: 0;
}

.main-content .content {
    width: 100%;
    max-width: 800px;
}

/* Improve footer transparency */
.app-footer {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(6px);
}

/* Make it nice when we apply per-page backgrounds */
.page-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Text overlay with strong shadow for visibility on images */
.text-overlay {
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 4px 20px rgba(0, 0, 0, 0.7) !important;
    display: inline-block;
    margin: 1rem 0;
}

/* Button row - centered buttons in a row */
.button-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
}

/* Centered card display - ensures full centering */
.card-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 1.5rem;
}

/* Content card centering fix */
.content-card {
    text-align: center;
}

.content-card .qr-scanner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Ensure card containers are centered */
.content-card .card-placeholders,
.content-card .card-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Pack info should also be centered */
.content-card .pack-info {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 500px;
}

/* Loading spinner component */
.loading-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(170, 170, 170, 0.3);
    border-top-color: #555;
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.text-bg {
    color: #fff;
    display: inline-block;
    margin: 1rem 0;
}

.text-bg h1 {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 4px 20px rgba(0, 0, 0, 0.7);
}

.text-bg p {
    font-weight: bold;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.row-text {
    display: block;
    margin-bottom: 0.75rem;
}

/* Login form */
.login-card {
    max-width: 440px;
}

.login-heading {
    color: #1a2a4a;
}

.login-center {
    display: flex;
    justify-content: center;
}

.login-email-input {
    max-width: 320px;
    width: 100%;
}

.login-continue-btn {
    max-width: 320px;
    width: 100%;
}

.login-code-input {
    max-width: 200px;
    width: 100%;
}

.login-confirm-btn {
    max-width: 200px;
    width: 100%;
}

.login-code-sent {
    font-size: 0.9rem;
}

.login-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.login-email-display {
    font-size: 0.85rem;
}

/* Gray back button for login flow */
.btn-back-gray {
    color: #fff !important;
    background-color: #6c757d;
    border-color: #5a6268;
}

.btn-back-gray:hover,
.btn-back-gray:focus {
    background-color: #5a6268;
    border-color: #4e555b;
    color: #fff !important;
}

/* Button group (Redeem + Scan Another) */
.button-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* QR scanner scan button with icon */
.scan-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* QR scanner error alert */
.scan-error {
    color: #fff;
    background-color: rgba(220, 53, 69, 0.9);
    border: none;
    display: inline-block;
}

.loading-error {
    color: red;
    text-align: center;
    margin-top: 1rem;
}