:root {
    --primary-red: #e74c3c;
    --primary-blue: #3498db;
    --primary-teal: #1abc9c;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 auto;
}

/* Login Screen */
.login-card {
    background: white;
    padding: 40px 30px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-top: 10vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: slideUp 0.8s ease;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-left: 5px;
}

.input-field input {
    padding: 15px 20px;
    border-radius: 15px;
    border: 2px solid #edf2f7;
    outline: none;
    font-size: 1rem;
    transition: var(--transition);
}

.input-field input:focus {
    border-color: var(--primary-blue);
    background: #f8fbff;
}

.btn-login {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 16px;
    border-radius: 15px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.2);
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* App Header (After Login) */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 5px;
    margin-bottom: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.user-info .name {
    font-weight: 700;
    font-size: 1rem;
    display: block;
}

.user-info .id {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-logout {
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: #ffeaea;
    color: #e74c3c;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Warning Banner */
.warning-banner {
    background: #dc3545;
    color: white;
    padding: 12px 18px;
    border-radius: 15px;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 5px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.warning-banner strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

/* Check-in/Out Section */
.check-section {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-left: 5px solid var(--primary-blue);
}

.check-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.check-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-off { background: #f1f1f1; color: #7f8c8d; }
.status-on { background: #e8f8f5; color: #1abc9c; }

.check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-check {
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-in { background: #e8f8f5; color: #1abc9c; border: 2px solid #1abc9c; }
.btn-out { background: #fef9e7; color: #f1c40f; border: 2px solid #f1c40f; }

.btn-check:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-check:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.time-display {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 5px;
}

/* Camera & Modal */
.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;
    padding: 20px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 25px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#camera-preview {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: #000;
}

.modal-footer {
    padding: 20px;
    display: flex;
    gap: 10px;
}

.btn-capture {
    flex: 2;
    background: var(--primary-teal);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
}

.btn-cancel {
    flex: 1;
    background: #f1f1f1;
    color: #7f8c8d;
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* Admin Login Button on Home */
.admin-link {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
}

/* Main Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
}

.btn-red {
    background: linear-gradient(135deg, #ff5f6d, #ffc371);
    background: #e74c3c; /* Fixed color to match image exactly but with depth */
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-blue {
    background: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-teal {
    background: #1abc9c;
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3);
}

.action-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

.action-btn:active {
    transform: translateY(0);
}

/* Hotline Card */
.hotline-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border-top: 5px solid var(--primary-teal);
}

.hotline-header {
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.hotline-header h2 {
    font-size: 1.25rem;
    color: #2c3e50;
    font-weight: 800;
    text-transform: uppercase;
}

.hotline-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hotline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f1f1;
}

.hotline-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.item-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.icon {
    font-size: 1.2rem;
    color: var(--primary-teal);
    margin-top: 2px;
}

.label-group {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #34495e;
}

.note {
    font-size: 0.75rem;
    font-style: italic;
    color: #e67e22;
    margin-top: 4px;
    max-width: 250px;
    line-height: 1.4;
}

.phone {
    font-weight: 700;
    color: var(--primary-teal);
    font-size: 1rem;
    white-space: nowrap;
}

.call-btn {
    background: #f0f7f6;
    color: var(--primary-teal);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

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

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.container > * {
    animation: slideUp 0.6s ease forwards;
}

.hidden {
    display: none !important;
}

.container > *:nth-child(2) { animation-delay: 0.1s; }
.container > *:nth-child(3) { animation-delay: 0.2s; }
