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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --disabled-bg: #f1f5f9;
    --disabled-text: #94a3b8;
    --selected-bg: #dbeafe;
    --selected-border: #2563eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

#app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 100%;
    animation: fadeIn 0.3s ease-in;
}

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

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

input[type="email"],
input[type="password"],
input[type="date"],
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    background: var(--surface);
    color: var(--text-primary);
}

input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-control:disabled {
    background-color: var(--disabled-bg);
    color: var(--disabled-text);
    cursor: not-allowed;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-link {
    background: transparent;
    color: var(--primary-color);
    padding: 8px 12px;
    font-size: 14px;
}

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

.btn-large {
    padding: 16px 24px;
    font-size: 18px;
    margin-top: 24px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error Message */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger-color);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    animation: slideDown 0.3s ease-out;
    max-width: 90%;
    text-align: center;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Attendance Info */
.attendance-info {
    background: var(--background);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.attendance-info p {
    margin-bottom: 8px;
    font-size: 14px;
}

.attendance-info p:last-child {
    margin-bottom: 0;
}

/* Attendance Controls */
.attendance-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.attendance-controls .btn {
    flex: 1;
}

/* People List */
.people-list {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.person-item {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.person-item:last-child {
    border-bottom: none;
}

.person-item:hover {
    background: var(--background);
}

.person-item.selected {
    background: var(--selected-bg);
    border-left: 4px solid var(--selected-border);
    padding-left: 12px;
}

.person-item.disabled {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    cursor: not-allowed;
}

.person-item.disabled:hover {
    background: var(--disabled-bg);
}

.person-item.non-attending {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
    padding-left: 12px;
}

.person-item.non-attending:hover {
    background: #fee2e2;
}

.person-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.person-item.selected .person-indicator {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.person-item.selected .person-indicator::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.person-item.disabled .person-indicator,
.person-item.non-attending .person-indicator {
    background: transparent;
    border-color: var(--disabled-text);
}

.person-name {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-message h2 {
    color: var(--success-color);
    font-size: 48px;
    margin-bottom: 16px;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 32px;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 24px;
    }

    h1 {
        font-size: 24px;
    }

    .attendance-controls {
        flex-direction: column;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header h1,
    .header h2 {
        margin-bottom: 0;
    }
}

/* Scrollbar Styling */
.people-list::-webkit-scrollbar {
    width: 8px;
}

.people-list::-webkit-scrollbar-track {
    background: var(--background);
}

.people-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.people-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
