:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #1a1a1b;
    --text-muted: #65676b;
    --accent-color: #007bff;
    --border-radius: 20px;
    --shadow-soft: 0 8px 30px rgba(0,0,0,0.05);
    --shadow-strong: 0 12px 40px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Header - Floating style */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

header .logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.btn-add {
    background: var(--text-main);
    color: #fff;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-add:active {
    transform: scale(0.95);
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* About Section - "Message card" style */
.about-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0 2rem;
    box-shadow: var(--shadow-soft);
}

.about-section h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.about-section p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.support-links {
    display: flex;
    gap: 0.8rem;
}

.btn-contact, .btn-kofi {
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-contact { background: #f0f2f5; color: var(--text-main); }
.btn-kofi { background: #ff5e5b; color: #fff; }

/* Categories */
.category-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 2rem 0 1rem 0.5rem;
    letter-spacing: -0.5px;
}

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

/* Store Card - Modern "App" look */
.store-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.02);
}

.store-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.store-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #f8f9fa;
    overflow: hidden;
    padding: 8px;
}

.store-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.store-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.store-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.discount { 
    background: #fff0f0; 
    color: #e63946; 
}

.badge.points { 
    background: #f0fff4; 
    color: #2ecc71; 
}

.count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #f0f2f5;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
}

/* Modal / Popup - Premium Blur */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    background: #fff;
    margin: 10vh auto;
    padding: 2rem;
    border-radius: 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalShow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalShow {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 32px;
    color: #ccc;
    cursor: pointer;
}

.display-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    object-fit: contain;
}

.creator-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.barcode-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid #f0f2f5;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.card-note {
    background: #fff3cd;
    color: #856404;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 0 auto 1.5rem;
    display: inline-block;
    border: 1px solid #ffeeba;
}

.contributor-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 1rem 0 2rem;
}

.type-pill {
    background: #f0f2f5;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    color: var(--text-main);
    display: inline-block;
    margin-left: 0.3rem;
}

.voting-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f2f5;
}

.vote-buttons {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.btn-vote {
    flex: 1;
    border: none;
    padding: 0.8rem;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-vote.up { background: #e8f5e9; color: #2e7d32; }
.btn-vote.down { background: #ffebee; color: #c62828; }

.btn-reload {
    background: var(--text-main);
    color: #fff;
    width: 100%;
    padding: 1rem;
    border-radius: 16px;
    font-weight: 700;
    border: none;
    margin-top: 1.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.disclaimer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 2rem;
}

/* Form Styling */
.form-container {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #f0f2f5;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.btn-submit {
    background: var(--text-main);
    color: #fff;
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    font-size: 1rem;
    margin-top: 1rem;
}

#qrcode img { margin: 0 auto; }
#barcode { max-width: 100%; height: auto; }

/* Responsive adjustments */
@media (max-width: 480px) {
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
