/* Premium Coffee Shop Loyalty Platform Style Sheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,500&display=swap');

:root {
    /* Light Mode Variables (Default) */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    
    --bg-gradient: linear-gradient(135deg, #f7f1eb 0%, #eddcd2 100%);
    --card-bg: rgba(255, 255, 255, 0.5);
    --card-border: rgba(255, 255, 255, 0.35);
    --card-shadow: 0 8px 32px 0 rgba(139, 94, 60, 0.15);
    
    --text-primary: #3d2417;
    --text-secondary: #6e5445;
    --text-light: #ab8e7e;
    
    --accent: #bc8a5f;
    --accent-hover: #a07148;
    --accent-light: rgba(188, 138, 95, 0.15);
    --accent-glow: rgba(188, 138, 95, 0.3);
    
    --glass-blur: blur(16px);
    
    --gold: #d4a373;
    --success: #606c38;
    --error: #b7094c;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Card design specific */
    --loyalty-card-bg: linear-gradient(135deg, #2b1810 0%, #4a281a 100%);
    --loyalty-card-text: #f5ebe0;
    --loyalty-card-border: rgba(212, 163, 115, 0.3);
    --loyalty-card-shadow: 0 15px 35px 0 rgba(43, 24, 16, 0.3);
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-gradient: linear-gradient(135deg, #0d0604 0%, #1c0e09 100%);
    --card-bg: rgba(28, 14, 9, 0.45);
    --card-border: rgba(212, 163, 115, 0.12);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --text-primary: #f5ebe0;
    --text-secondary: #d5c3b3;
    --text-light: #8e7668;
    
    --accent: #d4a373;
    --accent-hover: #e6b98d;
    --accent-light: rgba(212, 163, 115, 0.15);
    --accent-glow: rgba(212, 163, 115, 0.4);
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    overflow-x: hidden;
}

/* Background Animated Coffee Coffee Beans / Elements */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: floatBlob 12s infinite alternate ease-in-out;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: -50px;
    right: -50px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #4a281a;
    bottom: -100px;
    left: -100px;
    animation-delay: 2s;
}

@keyframes floatBlob {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.1); }
}

/* Header & Theme Switcher */
header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 5px var(--accent-glow));
    animation: brewCoffee 4s infinite alternate ease-in-out;
}

@keyframes brewCoffee {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(-5deg) scale(1.05); }
    100% { transform: rotate(5deg) scale(1); }
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
    border-color: var(--accent);
    color: var(--accent);
}

/* Containers & Auth Forms */
main {
    flex-grow: 1;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Glassmorphism Containers */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: var(--card-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: var(--transition);
}

.glass-panel:hover {
    box-shadow: 0 12px 40px 0 rgba(139, 94, 60, 0.22);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
    transition: var(--transition);
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    background: rgba(255, 255, 255, 0.3);
    border: 1.5px solid var(--card-border);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

[data-theme="dark"] .form-input {
    background: rgba(0, 0, 0, 0.2);
}

.form-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 12px var(--accent-glow);
}

[data-theme="dark"] .form-input:focus {
    background: rgba(0, 0, 0, 0.35);
}

.form-input:focus + .input-icon {
    color: var(--accent);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.95rem;
    border-radius: 12px;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: var(--accent); }

/* Loyalty Card (Premium design) */
.loyalty-card {
    background: var(--loyalty-card-bg);
    border: 1.5px solid var(--loyalty-card-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--loyalty-card-shadow);
    color: var(--loyalty-card-text);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.loyalty-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 163, 115, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.loyalty-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.loyalty-card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loyalty-card-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #e6c594 0%, #b89156 100%);
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.4);
}

.customer-meta {
    margin-bottom: 2rem;
}

.customer-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.membership-status {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    margin-top: 0.25rem;
}

/* Stamps Grid container */
.stamps-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 1.5rem;
}

.stamp-slot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1.5px dashed rgba(212, 163, 115, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.stamp-slot.active {
    background: linear-gradient(135deg, var(--gold) 0%, #a3704c 100%);
    border-style: solid;
    border-color: var(--gold);
    animation: popStamp 0.4s ease-out;
    box-shadow: 0 0 15px rgba(212, 163, 115, 0.5);
}

.stamp-slot.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--gold);
    animation: ripple 0.8s ease-out;
    opacity: 0;
}

@keyframes popStamp {
    0% { transform: scale(0.6); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

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

.loyalty-summary {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-group {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Dashboard QR and Actions Section */
.card-details-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.qr-section {
    background: white;
    padding: 1.25rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--card-border);
}

.qr-placeholder {
    width: 180px;
    height: 180px;
    background: #fbfbfb;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.qr-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-code-text {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    color: #4a281a;
    letter-spacing: 1.5px;
}

/* Wallet buttons styling */
.wallet-buttons-container {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
}

.wallet-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid rgba(0, 0, 0, 0.85);
    background: #000;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: var(--transition);
}

[data-theme="dark"] .wallet-btn {
    border-color: rgba(255,255,255,0.1);
}

.wallet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    filter: brightness(1.1);
}

.wallet-icon {
    width: 20px;
    height: 20px;
}

/* History Logs */
.history-section {
    margin-top: 2rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

.history-item {
    background: rgba(255,255,255,0.2);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

[data-theme="dark"] .history-item {
    background: rgba(0,0,0,0.15);
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.history-action {
    font-weight: 600;
    font-size: 0.95rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-qty {
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
}

.qty-positive {
    background: rgba(96, 108, 56, 0.15);
    color: var(--success);
}

.qty-negative {
    background: rgba(183, 9, 76, 0.15);
    color: var(--error);
}

.qty-neutral {
    background: var(--accent-light);
    color: var(--accent);
}

/* Log out and back buttons */
.nav-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 1.5rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.btn-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ==========================================
   ADMIN SPECIFIC STYLES
   ========================================== */
.admin-card {
    border-left: 5px solid var(--accent);
}

/* Camera Scanner Container */
.scanner-container {
    width: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
    border: 1px solid var(--card-border);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    margin-bottom: 1.5rem;
}

#reader {
    width: 100% !important;
    border: none !important;
}

#reader video {
    object-fit: cover !important;
}

/* Customize html5-qrcode library styles */
#reader__dashboard_section_csr {
    padding: 10px !important;
}
#reader__dashboard_section_csr button {
    background: var(--accent) !important;
    border: none !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 20px solid rgba(0, 0, 0, 0.4);
    pointer-events: none;
    box-sizing: border-box;
}

.scanner-laser {
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: laserScan 2s infinite linear;
}

@keyframes laserScan {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

/* Scanned Customer Panel */
.scanned-customer-info {
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: none;
    animation: slideDown 0.3s ease-out;
}

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

.admin-action-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.stamp-adder-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.stamp-qty-input {
    width: 80px;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1.5px solid var(--card-border);
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    outline: none;
}

[data-theme="dark"] .stamp-qty-input {
    background: rgba(0, 0, 0, 0.2);
}

.stamp-qty-input:focus {
    border-color: var(--accent);
}

/* Footer layout info */
footer {
    width: 100%;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(139, 94, 60, 0.05);
}

/* Responsive Scaling */
@media (max-width: 480px) {
    .glass-panel {
        padding: 1.75rem 1.25rem;
    }
    
    .loyalty-card {
        padding: 1.5rem 1.25rem;
    }
    
    .stamp-slot {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }
}
