/* ===== SCANBACK PAGES/SCREENS SPECIFIC STYLES ===== */

/* ===== URL BAR HIDING ===== */
html, body {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
}

body {
    position: fixed;
    width: 100%;
    top: 0;
}

/* ===== SCANNER SCREEN ===== */
.scanner-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.scanner-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.scanner-card {
    background: #2C2C2C;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.scanner-instructions {
    text-align: center;
    margin-bottom: 0.75rem;
}

.scanner-instructions.hidden {
    display: none;
}

.scanner-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 0.5rem;
}

.scanner-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

#reader {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.75rem;
}

/* Product Info Card */
.product-info {
    background: #2C2C2C;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.product-points {
    display: inline-block;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.05) 100%);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
}

.product-points-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4CAF50;
}

/* Scanner viewport - smaller for mobile fit */
.scanner-viewport {
    min-height: 200px;
}

#reader {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.75rem;
    min-height: 200px;
}

/* Scanner controls */
.scanner-controls {
    display: flex;
    gap: 0.5rem;
}

.scanner-controls button {
    flex: 1;
}

/* ===== HISTORY SCREEN ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: #2C2C2C;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-info {
    flex: 1;
}

.history-product {
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.history-time {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.history-item-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.history-points {
    font-weight: 700;
    color: #FDB813;
    font-size: 1.1rem;
}

.history-location {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.history-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== VOUCHERS SCREEN ===== */
.vouchers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.voucher-card {
    background: #2C2C2C;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
}

.voucher-card.voucher-available {
    border-color: rgba(253, 184, 19, 0.3);
    background: rgba(253, 184, 19, 0.05);
}

.voucher-card.voucher-locked {
    opacity: 0.6;
}

.voucher-content {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1;
}

.voucher-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #FDB813 0%, #FFD400 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.voucher-logo-letter {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
}

.voucher-info {
    flex: 1;
}

.voucher-name {
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 0.25rem 0;
}

.voucher-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.voucher-action {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.voucher-points-needed {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.voucher-points-value {
    font-weight: 700;
    color: #FDB813;
    font-size: 1rem;
}

.voucher-points-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.voucher-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.voucher-btn-primary {
    background: linear-gradient(135deg, #FDB813 0%, #FFD400 100%);
    color: #111;
    font-weight: 600;
}

.voucher-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 184, 19, 0.3);
}

.voucher-btn-disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

/* ===== SETTINGS SCREEN ===== */
.settings-section {
    background: #2C2C2C;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.section-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    color: #FDB813;
}

.settings-content {
    flex: 1;
}

.settings-title {
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 0.5rem 0;
}

.settings-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 1rem 0;
}

.settings-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.settings-info.location-set {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.settings-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.settings-buttons button {
    flex: 1;
    min-width: 120px;
}

.account-section {
    background: rgba(253, 184, 19, 0.05);
    border: 1px solid rgba(253, 184, 19, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.account-status {
    margin-bottom: 1.5rem;
}

.auth-status-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.auth-status-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.auth-user-info {
    background: rgba(253, 184, 19, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #FDB813;
    margin-bottom: 1rem;
}

.auth-user-email {
    font-weight: 600;
    color: #FDB813;
    font-size: 0.9rem;
    word-break: break-all;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== DATA MANAGEMENT ===== */
.data-management-section {
    margin-bottom: 2rem;
}

.data-export-info {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.data-danger-zone {
    background: rgba(244, 67, 54, 0.05);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.data-danger-warning {
    color: #f44336;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.data-button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-button-group button {
    width: 100%;
}

/* ===== STATISTICS / ANALYTICS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #FDB813;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ===== FOOTER NAVIGATION ===== */
#app {
    padding-bottom: 70px; /* Space for fixed footer */
}

.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 70px;
    background: #111;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 90;
    gap: 0;
    padding: 0;
    margin: 0;
}

.footer-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 8px 4px;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    height: 100%;
    border-top: 3px solid transparent;
}

.footer-nav-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.footer-nav-btn.active {
    color: #FDB813;
    border-top-color: #FDB813;
}

.footer-nav-icon {
    width: 20px;
    height: 20px;
}

/* Adjust screen content to account for footer */
.screen-content {
    padding-bottom: 1rem;
}

@media (min-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .history-item-meta {
        justify-content: space-between;
    }
    
    .account-button-group {
        flex-direction: row;
    }
    
    .account-button-group button {
        flex: 1;
    }
    
    .footer-nav-btn span {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .footer-nav-btn span {
        font-size: 0.65rem;
    }
}
