:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --background-color: #1a1a1a;
    --surface-color: #262626;
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #404040;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --font-family: 'Inter', sans-serif;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    color: #fff;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.25rem;
}

/* Utilities */
.container {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

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

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
}

.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
    z-index: 100;
    font-size: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

input,
select {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    ring: 2px solid var(--primary-color);
}

/* Cards List */
.card-list {
    display: grid;
    gap: 1rem;
    padding-bottom: 5rem;
}

.loyalty-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.loyalty-card:active {
    transform: scale(0.98);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-name {
    font-weight: 600;
    font-size: 1.125rem;
}

.card-category {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}

.card-preview {
    height: 60px;
    background-color: #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.875rem;
}

/* Card Detail View */
.card-detail-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.barcode-container {
    background-color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.barcode-container img,
.barcode-container canvas {
    max-width: 100%;
    height: auto;
}

/* Navigation */
.navbar {
    background-color: var(--surface-color);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Search */
.search-container {
    width: 100%;
    padding: 0 1rem 1rem;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: none;
    animation: slideDown 0.2s ease-out;
}

.search-container.active {
    display: block;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Add Card Menu */
.add-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.option-card {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.option-card:hover {
    border-color: var(--primary-color);
}

.option-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
}

.toast {
    background-color: #333;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    margin-top: 0.5rem;
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Scanner */
#reader {
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
}