:root {
    --primary-color: #452571;
    --secondary-color: #6a3ab2;
    --accent-color: #ffcc00;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

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

body {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.glass-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(69, 37, 113, 0.05) 0%, rgba(248, 249, 250, 1) 70%);
    z-index: -1;
}

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

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

.logo img {
    width: 120px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header p {
    font-size: 0.95rem;
    color: #666;
}

.gate-notification {
    margin-top: 10px;
    background: rgba(69, 37, 113, 0.1);
    color: var(--primary-color);
    padding: 6px 16px;
    display: inline-block;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

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

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.input-group input, 
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus, 
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(69, 37, 113, 0.1);
}

/* Search Auto-complete */
.search-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    list-style: none;
    margin-top: 5px;
}

.search-results li {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f8f8;
}

.search-results li:hover {
    background-color: #f0ebf7;
}

.search-results .staff-name {
    font-weight: 600;
    display: block;
}

.search-results .staff-info {
    font-size: 0.8rem;
    color: #777;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(69, 37, 113, 0.3);
}

/* Success Card */
.success-card {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.details-box {
    background: #f0f4f8;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.detail-row {
    margin-bottom: 1rem;
    border-bottom: 1px solid #e0e6ed;
    padding-bottom: 0.5rem;
}

.detail-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row strong {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.detail-row span {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary-color);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 0.8rem;
}

.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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