:root {
    --primary: #008080; /* Teal */
    --primary-dark: #005959;
    --primary-light: #4db3b3;
    --secondary: #f4a261;
    --success: #2a9d8f;
    --warning: #e9c46a;
    --danger: #e76f51;
    --dark: #264653;
    --light: #f8f9fa;
    --gray: #6c757d;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Container for mobile-first layout */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Login Page specific */
.login-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    opacity: 0.8;
    font-size: 14px;
}

.login-form {
    padding: 0 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.2);
}

.btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

/* Main App Page specific */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--white);
    border-bottom: 1px solid #eee;
}

.user-info h2 {
    font-size: 18px;
    color: var(--dark);
}

.user-info p {
    font-size: 12px;
    color: var(--gray);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.time-card {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    margin: 20px;
    padding: 30px 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 128, 128, 0.2);
}

.time-card .date {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.time-card .time {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.gps-status {
    padding: 10px 20px;
    margin: 0 20px 20px;
    background-color: #f8f9fa;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    font-size: 14px;
}

.gps-status .icon {
    margin-right: 10px;
    font-size: 18px;
}

.action-area {
    padding: 0 20px 30px;
    flex-grow: 1;
}

.check-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.check-btn:active {
    transform: scale(0.95);
}

.check-btn.btn-checkin {
    background: linear-gradient(135deg, var(--success), #20756b);
}

.check-btn.btn-checkout {
    background: linear-gradient(135deg, var(--secondary), #d98a4e);
}

.check-btn i {
    font-size: 40px;
    margin-bottom: 10px;
}

.status-message {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: none;
    font-weight: 500;
}

.status-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
}

.status-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
}

.history-preview {
    margin: 0 20px;
}

.history-preview h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--dark);
}

.history-list {
    list-style: none;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

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

.history-item .type {
    font-weight: 600;
}

.history-item .time {
    color: var(--gray);
    font-size: 14px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }

/* Loader */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
