/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Natural Summer Colors - Optimized for Rural Canada Background */
    --primary-yellow: #F4D03F;
    --primary-green: #52BE80;
    --primary-blue: #5DADE2;
    --accent-orange: #F39C12;
    --accent-red: #E74C3C;
    --accent-purple: #BB8FCE;
    --background-cream: #FEF9E7;
    --text-dark: #1B2631;
    --text-light: #566573;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.2);
    --shadow-hover: rgba(0, 0, 0, 0.3);
    --overlay: rgba(255, 255, 255, 0.85);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Landing Page Styles */
.header {
    text-align: center;
    padding: 3rem 0;
    background: var(--overlay);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-yellow), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px var(--shadow);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-light);
    font-weight: 300;
    margin-bottom: 1.5rem;
}

.description {
    background: var(--overlay);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.how-it-works {
    background: var(--overlay);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(82, 190, 128, 0.9), rgba(93, 173, 226, 0.9));
    backdrop-filter: blur(10px);
    border-radius: 15px;
    color: var(--white);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-hover);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--white);
    color: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.step-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step-content p {
    font-size: 1rem;
    opacity: 0.9;
}

.login-section {
    text-align: center;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-yellow), var(--accent-orange));
    color: var(--text-dark);
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--text-dark);
}

.btn-secondary:hover {
    background: var(--text-dark);
    color: var(--white);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--overlay);
    backdrop-filter: blur(15px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow);
    max-width: 400px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-dark);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--primary-blue);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-yellow);
}

.form-hint {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-style: italic;
}

.error-message {
    color: var(--accent-red);
    text-align: center;
    margin-top: 1rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--overlay);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dashboard-header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-yellow), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.rewards-summary {
    background: var(--overlay);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.summary-card {
    text-align: center;
}

.summary-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.big-number {
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-yellow), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0;
}

.progress-text {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Draw Section */
.draw-section {
    background: linear-gradient(135deg, rgba(244, 208, 63, 0.95), rgba(243, 156, 18, 0.95));
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    text-align: center;
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.draw-section.hidden {
    display: none;
}

.draw-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.draw-card p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.draw-card #submit-draw-btn {
    display: block;
    margin: 0 auto;
}

.success-message {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
}

.success-message.hidden {
    display: none;
}

/* Coupons Section */
.coupons-section {
    background: var(--overlay);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.coupons-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.coupons-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.coupon-card {
    background: linear-gradient(135deg, rgba(82, 190, 128, 0.9), rgba(93, 173, 226, 0.9));
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 10px;
    color: var(--white);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.coupon-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.coupon-card .discount {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.coupon-card .store-name {
    font-size: 1.1rem;
    opacity: 0.9;
}

.coupon-card .expiry {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Punch Card Styles */
.punch-card-section {
    background: var(--overlay);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.punch-card-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.punch-card {
    background: var(--background-cream);
    border: 3px solid var(--text-dark);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.punch-card-holes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.punch-hole {
    aspect-ratio: 1;
    min-height: 120px;
    border-radius: 50%;
    border: 4px solid var(--text-dark);
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem;
    box-sizing: border-box;
}

.punch-hole.punched {
    background: #f5f5dc; /* Light beige/cream paper color */
    border-color: #8B4513; /* Dark brown stamp border */
    border-width: 3px;
    box-shadow: 
        inset 0 0 20px rgba(139, 69, 19, 0.1),
        0 3px 10px rgba(0, 0, 0, 0.2);
    /* Inkpad stamp effect - darker ink color */
    position: relative;
    overflow: visible;
}

.punch-hole.punched::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 50% 50%, transparent 30%, rgba(139, 69, 19, 0.05) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 69, 19, 0.03) 2px,
            rgba(139, 69, 19, 0.03) 4px
        );
    pointer-events: none;
}

.punch-hole.punched .stamp-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.punch-hole.punched .stamp-store-name {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 900;
    fill: #1a1a1a; /* Very dark ink color */
    letter-spacing: 1px;
    text-transform: uppercase;
    /* Font size is set dynamically via inline style based on text length */
}

.punch-hole.punched .stamp-time {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: 700;
    fill: #2d2d2d; /* Dark ink color, slightly lighter than store name */
    letter-spacing: 0.5px;
    dominant-baseline: middle;
    text-anchor: middle;
}

.punch-hole.punched .stamp-number {
    font-family: 'Courier New', Courier, monospace;
    font-size: 48px;
    font-weight: 900;
    fill: #8B4513; /* Dark brown, matching border */
    text-anchor: middle;
    dominant-baseline: middle;
    opacity: 0.9;
}

.punch-hole:not(.punched) {
    background: var(--white);
}

.punch-hole:not(.punched)::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 2px dashed var(--text-light);
    opacity: 0.3;
}

.checkins-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.checkin-item {
    background: linear-gradient(135deg, rgba(93, 173, 226, 0.85), rgba(82, 190, 128, 0.85));
    backdrop-filter: blur(10px);
    padding: 0.6rem 1rem;
    border-radius: 0;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.checkin-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.checkin-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom: none;
}

.checkin-item:hover {
    background: linear-gradient(135deg, rgba(93, 173, 226, 0.95), rgba(82, 190, 128, 0.95));
}

.checkin-item .store-info {
    flex: 1;
}

.checkin-item .store-name {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.checkin-item .checkin-time {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.2;
}

.checkin-item .checkin-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 0.75rem;
}

/* Check-in Page Styles */
.checkin-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.checkin-result {
    background: var(--overlay);
    backdrop-filter: blur(15px);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.checkin-result.hidden {
    display: none;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(82, 190, 128, 0.95), rgba(93, 173, 226, 0.95));
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--white);
    margin: 0 auto 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.error-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.95), rgba(243, 156, 18, 0.95));
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--white);
    margin: 0 auto 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.checkin-result h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.checkin-result p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(93, 173, 226, 0.3);
    border-top-color: var(--primary-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .punch-card-section {
        padding: 1.5rem;
    }
    
    .punch-card {
        padding: 1.5rem;
    }
    
    .punch-card-holes {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .punch-hole {
        min-height: 120px;
        max-height: 120px;
        padding: 0.3rem;
        font-size: 1rem;
    }
    
    .punch-hole.punched {
        border-width: 2px;
    }
    
    .punch-hole.punched .stamp-svg {
        width: 100%;
        height: 100%;
    }
    
    .punch-hole.punched .stamp-store-name {
        letter-spacing: 0.5px;
        /* Font size is set dynamically via inline style */
    }
    
    .punch-hole.punched .stamp-time {
        font-size: 10px;
        letter-spacing: 0.3px;
    }
    
    .punch-hole.punched .stamp-number {
        font-size: 36px;
    }
    
    .checkin-item {
        flex-direction: row;
        text-align: left;
        padding: 0.5rem 0.75rem;
    }
    
    .checkin-item .store-name {
        font-size: 0.9rem;
        margin-bottom: 0.15rem;
    }
    
    .checkin-item .checkin-time {
        font-size: 0.75rem;
    }
    
    .checkin-item .checkin-number {
        margin-left: 0.5rem;
        margin-top: 0;
        font-size: 1.2rem;
    }
    
    .rewards-summary,
    .coupons-section,
    .draw-section {
        padding: 1.5rem;
    }
    
    .checkin-content {
        padding: 2rem 1rem;
    }
    
    .checkin-result {
        padding: 2rem 1.5rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .punch-hole {
        min-height: 100px;
        max-height: 100px;
    }
    
    .punch-hole.punched .stamp-store-name {
        /* Font size is set dynamically via inline style */
    }
    
    .punch-hole.punched .stamp-time {
        font-size: 8px;
    }
    
    .punch-hole.punched .stamp-number {
        font-size: 32px;
    }
    
    .punch-card-holes {
        gap: 0.5rem;
    }
    
    .punch-card {
        padding: 1rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

