:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --error-color: #dc2626;
    --success-color: #16a34a;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --background-color: #f3f4f6;
    --card-background: #ffffff;
    --input-focus: #eef2ff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* List Container Styles */
.list-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Button Styles */
.header-buttons {
    display: flex;
    gap: 0.5rem;
}

.header-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

.secondary-button {
    background: var(--background-color);
    color: var(--text-color);
}

.secondary-button:hover {
    background: var(--border-color);
}

/* Search Box Styles */
.search-box {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Table Styles */
.qr-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.qr-list th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
    padding: 1rem;
    white-space: nowrap;
}

.qr-list td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.qr-list tr:last-child td {
    border-bottom: none;
}

/* Status Styles */
.toggle-button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.toggle-button.active {
    background: #dcfce7;
    color: #166534;
}

.toggle-button.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.toggle-button.expired {
    background: #fee2e2;
    color: #991b1b;
}

.toggle-button.used_up {
    background: #fef3c7;
    color: #92400e;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
    background: var(--background-color);
}

.action-button:hover {
    background: var(--border-color);
}

.delete-button {
    color: #991b1b;
    background: #fee2e2;
}

.delete-button:hover {
    background: #fecaca;
}

/* Time Remaining */
.time-remaining {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.time-remaining i {
    color: var(--text-light);
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.form-wrapper {
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.qr-logo {
    display: inline-block;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: var(--background-color);
    margin-bottom: 1.5rem;
}

.qr-logo img {
    display: block;
    width: 64px;
    height: auto;
    object-fit: contain;
}

.header-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

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

label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

label i {
    color: var(--primary-color);
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--card-background);
}

input::placeholder {
    color: var(--text-light);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--card-background);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

select.invalid {
    border-color: var(--error-color);
}

select.invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

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

.phone-prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-color);
    font-weight: 500;
    pointer-events: none;
}

input[name="phone"] {
    padding-left: 3.5rem;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

button {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.tertiary-button {
    background-color: var(--background-color);
    color: var(--text-color);
    border: none;
    margin-top: 1rem;
}

.tertiary-button:hover {
    background-color: var(--border-color);
}

#result {
    text-align: center;
}

#result h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--success-color);
    margin-bottom: 2rem;
}

.qr-wrapper {
    margin: 2rem auto;
    max-width: 300px;
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.qr-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.qr-overlay i {
    font-size: 2rem;
    color: white;
}

.qr-wrapper:hover .qr-overlay {
    opacity: 1;
}

.info-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-light);
    margin: 1rem 0;
    font-size: 0.875rem;
}

/* Admin Panel Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.qr-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.qr-list th,
.qr-list td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.qr-list th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-color);
}

.qr-list tr:hover {
    background: var(--background-color);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-button {
    background: #fee2e2;
    color: #991b1b;
}

.delete-button:hover {
    background: #fecaca;
}

@media (max-width: 640px) {
    body {
        padding: 0.5rem;
        background: var(--card-background);
    }

    .container {
        max-width: 100%;
        padding: 0.5rem;
        margin: 0;
    }

    .form-wrapper {
        padding: 1rem;
        border-radius: 0;
        box-shadow: none;
    }

    .admin-container {
        padding: 1rem;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .qr-list-wrapper {
        margin: 0 -0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .qr-list {
        font-size: 0.875rem;
        white-space: nowrap;
    }

    .qr-list th,
    .qr-list td {
        padding: 0.75rem 0.5rem;
    }

    .status-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .action-buttons {
        flex-wrap: nowrap;
    }

    .action-button {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    .header-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .header-button {
        width: 100%;
        justify-content: center;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-box {
        flex-direction: column;
        padding: 0.75rem;
    }

    .search-box input {
        width: 100%;
    }
} 