/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login page styles */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.error {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

.demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 12px;
}

.demo-credentials h4 {
    margin-bottom: 5px;
    color: #666;
}

/* Container and layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 28px;
}

.user-info {
    color: #666;
}

.user-info a {
    color: #667eea;
    text-decoration: none;
    margin-left: 10px;
}

.user-info a:hover {
    text-decoration: underline;
}

/* Admin navigation */
.admin-nav {
    background: white;
    padding: 0;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
}

.nav-link {
    flex: 1;
    padding: 15px 20px;
    text-decoration: none;
    color: #666;
    text-align: center;
    border-right: 1px solid #eee;
    transition: background-color 0.3s;
}

.nav-link:last-child {
    border-right: none;
}

.nav-link:first-child {
    border-radius: 10px 0 0 10px;
}

.nav-link:last-child {
    border-radius: 0 10px 10px 0;
}

.nav-link:hover {
    background-color: #f8f9fa;
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Main content */
.main-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Attendance section */
.attendance-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

.current-time {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.btn-large {
    padding: 20px 40px;
    font-size: 18px;
    border-radius: 10px;
}

.attendance-marked {
    background: #d4edda;
    color: #155724;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #c3e6cb;
}

.attendance-marked h3 {
    margin-bottom: 10px;
}

.location-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
}

.location-status.getting-location {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.location-status.location-found {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.location-status.location-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}

.result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

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

.stat-number {
    font-size: 32px;
    font-weight: bold;
}

/* Tables */
.attendance-table,
.employees-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.attendance-table th,
.employees-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #dee2e6;
}

.attendance-table td,
.employees-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.attendance-table tr:hover,
.employees-table tr:hover {
    background-color: #f8f9fa;
}

.location-cell {
    max-width: 200px;
    word-wrap: break-word;
    font-size: 12px;
}

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-disabled {
    background: #f8d7da;
    color: #721c24;
}

.status-absent {
    background: #fff3cd;
    color: #856404;
}

/* Form styles */
.form-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.employee-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.employee-form .form-group {
    margin-bottom: 0;
}

/* Button styles */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s;
}

.btn-small:hover {
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.actions {
    white-space: nowrap;
}

/* Message styles */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Filter section */
.filter-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-filter label {
    font-weight: 500;
    color: #555;
}

.date-filter input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.date-filter input:focus {
    outline: none;
    border-color: #667eea;
}

/* Attendance summary */
.attendance-summary {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-value.present {
    color: #28a745;
}

.stat-value.absent {
    color: #dc3545;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .admin-nav {
        flex-direction: column;
    }
    
    .nav-link {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .nav-link:first-child {
        border-radius: 10px 10px 0 0;
    }
    
    .nav-link:last-child {
        border-radius: 0 0 10px 10px;
        border-bottom: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .employee-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .summary-stats {
        flex-direction: column;
    }
    
    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .attendance-table,
    .employees-table {
        font-size: 12px;
    }
    
    .attendance-table th,
    .employees-table th,
    .attendance-table td,
    .employees-table td {
        padding: 8px;
    }
}