/* Employee Interface CSS - Mobile First */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.5;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.login-header p {
    color: #718096;
    font-size: 16px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    background: white;
}

.login-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(66, 153, 225, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #e53e3e;
    font-size: 14px;
    margin-top: 12px;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

.dashboard-header {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-header h1 {
    font-size: 24px;
    color: #2d3748;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.user-info span {
    color: #718096;
    font-weight: 500;
}

.logout-btn {
    padding: 8px 16px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #cbd5e0;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-card,
.actions-card,
.history-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.status-card h2,
.history-card h3 {
    font-size: 20px;
    color: #2d3748;
    margin-bottom: 16px;
    font-weight: 600;
}

.status-info {
    text-align: center;
}

.status-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.status-text.status-in {
    color: #38a169;
}

.status-text.status-out {
    color: #3182ce;
}

.time-text {
    color: #718096;
    font-size: 16px;
}

.clock-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.clock-btn {
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clock-btn.clock-in {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.clock-btn.clock-in:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.3);
}

.clock-btn.clock-out {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.clock-btn.clock-out:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.3);
}

.reason-section {
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.reason-section label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.reason-section textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.reason-section textarea:focus {
    outline: none;
    border-color: #4299e1;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.history-times {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.history-times span {
    color: #718096;
    font-size: 14px;
}

.history-times .incomplete {
    color: #e53e3e;
    font-style: italic;
}

.history-reason {
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #4a5568;
    border-left: 3px solid #4299e1;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 20px;
    color: #2d3748;
}

.modal-content p {
    margin-bottom: 24px;
    color: #718096;
    line-height: 1.6;
}

.modal-btn {
    padding: 12px 32px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn:hover {
    background: #3182ce;
}

.dashboard-header {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f7fafc;
    border-radius: 8px;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.home-btn:hover {
    background: #48bb78;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.reason-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.cancel-clock-btn {
    padding: 8px 16px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-clock-btn:hover {
    background: #cbd5e0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .clock-btn {
        font-size: 16px;
        padding: 14px 20px;
    }
    
    .dashboard-container {
        padding: 12px;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Today's Stats */
.today-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 20px;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

/* Timeline Card */
.timeline-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.timeline-card h3 {
    margin: 0 0 20px 0;
    color: #1f2937;
    font-size: 1.2rem;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timeline-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.timeline-item.active {
    background: #eef2ff;
    border-left-color: #10b981;
}

.timeline-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.timeline-item.active .timeline-number {
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-times {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.timeline-in, .timeline-out {
    font-weight: 500;
}

.timeline-out.pending {
    color: #f59e0b;
}

.timeline-separator {
    color: #9ca3af;
}

.duration {
    display: inline-block;
    padding: 4px 12px;
    background: #e0e7ff;
    color: #667eea;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.duration.active {
    background: #d1fae5;
    color: #10b981;
}

.timeline-reason {
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
    padding-top: 5px;
    border-top: 1px solid #e5e7eb;
}

.no-sessions {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
    font-style: italic;
}