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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
}

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

.hidden {
    display: none !important;
}

/* Login styles */
#login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

#login-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: #0056b3;
}

/* Cards container styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

#cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.card img {
    max-width: 100px;
    height: auto;
    margin-bottom: 1rem;
}

.card .badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #28a745;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    width: 90%;
    max-width: 500px;
}

.modal-content.large {
    max-width: 800px;
}

.card-display-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 2rem;
}

#card-qr {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#card-qr img, 
#card-qr canvas {
    max-width: 100%;
    height: auto;
}

.card-code {
    font-family: monospace;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border-radius: 4px;
    word-break: break-all;
    text-align: center;
    max-width: 100%;
}

.button-danger {
    background-color: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    width: auto;
    margin-top: 1rem;
}

.button-danger:hover {
    background-color: #c82333;
}

.button-secondary {
    background-color: #6c757d;
}

.button-secondary:hover {
    background-color: #5a6268;
}

/* Store list styles */
#store-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 1rem 0;
}

.store-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid #ddd;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.store-item:hover {
    background-color: #f0f0f0;
}

.store-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 1rem;
}

.no-stores {
    text-align: center;
    padding: 1rem;
    color: #666;
    background: #f5f5f5;
    border-radius: 4px;
    margin: 1rem 0;
}

.close-button {
    position: absolute;
    right: 1rem;
    top: 1rem;
    width: auto;
    background: none;
    color: #333;
    font-size: 1.5rem;
    padding: 0.2rem 0.5rem;
}

.close-button:hover {
    background: none;
    color: #000;
}

/* Scanner styles */
.scanner-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0,0,0,0.8);
    z-index: 1001;
}

#reader {
    flex: 1;
    position: relative;
    background: #000;
}

/* Responsive styles */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
        padding: 1rem;
    }
    
    .card-display-content {
        padding: 1rem;
    }
}