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

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --success-color: #27ae60;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login Page */
.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow);
}

.logo i {
    font-size: 40px;
    color: white;
}

h1 {
    color: var(--dark-color);
    font-size: 28px;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 14px;
}

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

.form-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.form-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #95a5a6;
}

.btn-login, .btn-admin {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 20px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-admin {
    background: white;
    color: var(--dark-color);
    border: 2px solid #ecf0f1;
}

.btn-admin:hover {
    background: var(--light-color);
}

.divider {
    margin: 20px 0;
    color: #95a5a6;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ecf0f1;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
}

.success-message {
    background: #efe;
    color: var(--success-color);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
}

.footer {
    text-align: center;
    color: white;
    margin-top: 20px;
    opacity: 0.8;
    font-size: 14px;
}

/* Dashboard Styles */
.dashboard-container {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    background: white;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    box-shadow: var(--shadow);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

.user-details h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.user-details p {
    font-size: 14px;
    opacity: 0.9;
}

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

.current-time {
    font-size: 24px;
    font-weight: 600;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.main-content {
    padding: 20px;
}

.status-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.status-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.status-card .time {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.status-card .label {
    font-size: 14px;
    opacity: 0.8;
}

.checkin-methods {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.method-card {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.method-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.method-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.method-info h4 {
    color: var(--dark-color);
    margin-bottom: 5px;
    font-size: 18px;
}

.method-info p {
    color: #7f8c8d;
    font-size: 14px;
}

.history-section {
    margin-top: 30px;
}

.history-section h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 20px;
}

.history-item {
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info {
    flex: 1;
}

.history-info .date {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.history-info .time-range {
    color: #7f8c8d;
    font-size: 14px;
}

.history-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-in {
    background: #d5f4e6;
    color: var(--success-color);
}

.badge-out {
    background: #ffeaa7;
    color: #d63031;
}

/* QR Scanner */
.scanner-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.scanner-header {
    background: var(--dark-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-header h3 {
    font-size: 18px;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

#qr-reader {
    flex: 1;
    width: 100%;
}

.scanner-footer {
    background: var(--dark-color);
    color: white;
    padding: 20px;
    text-align: center;
}

/* GPS Check-in */
.gps-container {
    text-align: center;
    padding: 30px;
}

.gps-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 60px;
    color: white;
}

.location-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.location-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.location-info .info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #7f8c8d;
    font-size: 14px;
}

.info-value {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 14px;
}

.btn-checkin {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--success-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-checkin:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-checkin:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.btn-checkout {
    background: linear-gradient(135deg, var(--danger-color), var(--warning-color));
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .login-box {
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .dashboard-container {
        border-radius: 0;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.modal-icon.success {
    background: #d5f4e6;
    color: var(--success-color);
}

.modal-icon.error {
    background: #fee;
    color: var(--danger-color);
}
