/* Copied from employee/styles/employee.css (slim) */
body.employee-auth { background: var(--gray-50); }

/* Logo header in top left corner */
.login-logo-header {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.login-logo-header .logo-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--secondary);
}

.login-logo-header .logo-row i {
  color: var(--secondary);
  font-size: 1.5rem;
}

.login-logo-header .logo-row h1 {
  color: var(--primary);
  font-size: 1.8rem;
  margin: 0;
  font-weight: 700;
}

.employee-auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.employee-auth-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px; width: 100%; max-width: 420px; padding: 2rem; box-shadow: var(--shadow-sm); }
.employee-auth-card .logo-row { display: flex; align-items: center; gap: .5rem; color: var(--secondary); }
.employee-auth-card .logo-row i { color: var(--secondary); }
.employee-auth-card .logo-row h1 { color: var(--primary); font-size: 1.5rem; margin: 0; }

/* Enhanced Navbar */
.employee-navbar { position: sticky; top: 0; z-index: 10; background: linear-gradient(135deg, var(--white) 0%, #f8f9fa 100%); border-bottom: 1px solid var(--gray-200); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.employee-navbar-content { height: 80px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; }
.employee-logo { color: var(--secondary); text-decoration: none; font-weight: 700; font-size: 1.3rem; transition: all 0.3s ease; }
.employee-logo:hover { transform: translateY(-1px); text-decoration: none; color: var(--secondary); }
.employee-logo span { color: var(--primary); }
.employee-logo i { font-size: 1.5rem; margin-right: 0.5rem; }

.employee-nav-right { display: flex; align-items: center; gap: 1rem; }
.employee-nav-right span { font-size: 1.1rem; color: var(--gray-700); font-weight: 500; }
.employee-nav-right .btn { font-size: 1rem; padding: 0.5rem 1rem; }

/* Main Layout */
.employee-main { padding: 1.5rem; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); min-height: calc(100vh - 80px); }

/* Dashboard Overview */
.dashboard-overview { margin-bottom: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }

.stat-card { 
  background: linear-gradient(135deg, var(--white) 0%, #f8f9fa 100%); 
  border: 1px solid var(--gray-200); 
  border-radius: 12px; 
  padding: 1.5rem; 
  display: flex; 
  align-items: center; 
  gap: 1rem; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.08); 
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.stat-card:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 25px rgba(0,0,0,0.15); 
}

.stat-icon { 
  background: var(--primary); 
  color: white; 
  width: 50px; 
  height: 50px; 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 1.2rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.stat-content { flex: 1; }
.stat-number { font-size: 2rem; font-weight: bold; color: var(--primary); margin-bottom: 0.25rem; }
.stat-label { color: var(--gray-600); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Enhanced Grid */
.employee-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
@media (min-width: 900px) { 
  .employee-grid { 
    grid-template-columns: 1fr 1fr; 
    align-items: start; 
  } 
}

/* Enhanced Cards */
.card { 
  border: 1px solid var(--gray-200); 
  border-radius: 12px; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.08); 
  background: var(--white);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-header { 
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); 
  border-bottom: 1px solid var(--gray-200); 
  padding: 1rem 1.25rem; 
  position: relative;
}

.card-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--secondary);
}

.card-body { padding: 1rem; }

/* Enhanced Task Cards */
.task-card { 
  background: var(--white); 
  border: 1px solid var(--gray-200); 
  border-radius: 10px; 
  padding: 1rem; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); 
  margin-bottom: 1rem; 
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.task-card:hover { 
  transform: translateX(5px); 
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); 
  border-color: var(--primary);
}

.task-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.task-card-header h4 { margin: 0; color: var(--primary); font-size: 1.1rem; }
.task-card-body { padding: 0.5rem 0; color: var(--gray-700); }
.task-card-footer { 
  display: flex; 
  justify-content: space-between; 
  color: var(--gray-600); 
  font-size: 0.85rem; 
  margin-top: 0.75rem; 
  padding-top: 0.75rem; 
  border-top: 1px solid var(--gray-100);
}

/* Enhanced Work Log */
.work-log-summary { 
  background: linear-gradient(135deg, #f8f9fa 0%, var(--white) 100%);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--gray-200);
}

/* Compact weekly progress */
.weekly-progress {
  margin-bottom: 1rem !important;
}

.weekly-progress .d-flex {
  margin-bottom: 0.5rem !important;
}

/* Compact work log form */
#workLogForm {
  margin-bottom: 1rem !important;
  padding: 0;
}

/* Reduce empty space when no logs */
#workLogsList:empty {
  display: none;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-slide-in { animation: slideIn 0.6s ease-out; }
.animate-fade-in { animation: fadeIn 0.8s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }

/* Enhanced Buttons */
.btn { transition: all 0.3s ease; border-radius: 6px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-primary { background: var(--primary); border: none; }
.btn-success { background: var(--secondary); border: none; }

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive Improvements */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .employee-main { padding: 1rem; }
  
  /* Keep form elements horizontal on mobile */
  .form-inline {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  
  .form-inline .form-control {
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
  }
  
  .log-attachment-group {
    width: 100%;
    margin-bottom: 0.5rem;
    justify-content: flex-start;
  }

  .attachment-info {
    max-width: 100%;
  }

  .form-inline #logNotes {
    min-width: 150px;
    flex: 1;
  }
  
  /* Task controls responsive */
  .task-controls {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .card-header .d-flex {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* Progress Bar Enhancements */
.weekly-progress .progress {
  border-radius: 10px;
  background-color: #e9ecef;
  overflow: hidden;
}

.weekly-progress .progress-bar {
  border-radius: 10px;
  transition: width 1s ease-in-out;
  background: var(--primary);
}

/* Form Enhancements */
.form-control {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  transform: translateY(-1px);
}

/* Ensure action buttons stay horizontal */
.form-inline {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.form-inline .form-control {
  display: inline-block;
  width: auto;
  vertical-align: middle;
}

.form-inline .btn {
  white-space: nowrap;
}

.log-attachment-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 260px;
}

.log-attachment-group .btn {
  min-width: 90px;
}

.attachment-info {
  font-size: 0.75rem;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card header button alignment */
.card-header .d-flex {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-header .d-flex > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Task controls horizontal layout */
.task-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.task-controls select,
.task-controls button {
  flex-shrink: 0;
}

.form-control.is-valid {
  border-color: #28a745;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 2.94 2.94 2.94-2.94.94.94-3.88 3.88z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4 1.4-1.4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Enhanced Interactive Elements */
.task-card-header h4 {
  transition: color 0.3s ease;
}

.task-card:hover .task-card-header h4 {
  color: var(--secondary);
}

/* Notification Styles */
.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  background: linear-gradient(135deg, var(--white) 0%, #f8f9fa 100%);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Improved select styling */
select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 8px 10px;
  padding-right: 2rem;
}

/* Attachment Styles */
.task-attachments {
  border-top: 1px solid var(--gray-200);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.attachments-header {
  color: var(--gray-700);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.attachment-item {
  display: inline-block;
  margin-right: 0.5rem;
}

.attachment-item .btn {
  font-size: 0.8rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Attachment Modal */
.attachment-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.attachment-modal.show {
  opacity: 1;
}

.attachment-modal-content {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.attachment-modal.show .attachment-modal-content {
  transform: scale(1);
}

.attachment-modal-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.attachment-modal-header h5 {
  margin: 0;
  color: var(--primary);
  font-size: 1.1rem;
}

.attachment-modal-body {
  padding: 1.5rem;
  max-height: calc(90vh - 100px);
  overflow-y: auto;
}

.attachment-actions {
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 1rem;
}

.attachment-preview {
  text-align: center;
}

/* Responsive attachment modal */
@media (max-width: 768px) {
  .attachment-modal-content {
    width: 95vw;
    margin: 0.5rem;
  }
  
  .attachment-modal-header {
    padding: 0.75rem 1rem;
  }
  
  .attachment-modal-body {
    padding: 1rem;
  }
  
  .attachment-actions {
    text-align: center;
  }
  
  .attachment-actions .btn {
    display: block;
    width: 100%;
    margin: 0.25rem 0;
  }
}

/* Work Log Comments Styles */
.log-entry { 
  border: 1px solid var(--gray-200); 
  border-radius: 8px; 
  margin-bottom: 1rem; 
  background: var(--white); 
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.log-entry:hover { 
  box-shadow: var(--shadow-md); 
}

.log-entry .log-row { 
  display: grid; 
  grid-template-columns: 110px 90px 1fr; 
  gap: 0.75rem; 
  padding: 0.75rem 1rem; 
  align-items: center; 
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  margin: 0;
}

.log-entry .log-row > div {
  white-space: nowrap;
}

.log-notes-cell { 
  display: flex; 
  align-items: center; 
  overflow: hidden;
  min-width: 0;
}

.notes-text { 
  flex: 1; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  min-width: 0;
}

.log-comments { 
  padding: 0; 
  background: var(--white);
}

.comment-item { 
  padding: 0.75rem 1rem; 
  border-bottom: 1px solid var(--gray-100); 
  transition: background-color 0.2s ease;
}

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

.comment-item:hover { 
  background: var(--gray-50); 
}

.comment-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 0.5rem; 
}

.comment-author { 
  font-weight: 600; 
  color: var(--primary); 
  font-size: 0.9rem;
}

.comment-author i { 
  margin-right: 0.5rem; 
  color: var(--secondary);
}

.comment-date { 
  color: var(--gray-500); 
  font-size: 0.8rem; 
}

.comment-text { 
  color: var(--gray-700); 
  line-height: 1.4; 
  font-size: 0.9rem;
  padding-left: 1.5rem;
}

/* Enhanced log row when comments are present */
.log-entry .log-row { 
  border-bottom: 2px solid var(--primary); 
}

/* Task History Styles */
.breadcrumb {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--gray-600);
}

.breadcrumb-item i {
  margin-right: 0.4rem;
  vertical-align: baseline;
  font-size: 0.9em;
}

.breadcrumb-item a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb-item.active {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-card.small {
  padding: 1rem;
  margin-bottom: 0;
}

.stat-card.small .stat-icon {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.stat-card.small .stat-number {
  font-size: 1.5rem;
}

.stat-card.small .stat-label {
  font-size: 0.8rem;
}

.stat-icon.completed {
  background: var(--success);
}

.stat-icon.time {
  background: var(--info);
}

.stat-icon.performance {
  background: var(--warning);
}

.task-history-container {
  max-height: 600px;
  overflow-y: auto;
}

.task-history-item {
  margin-bottom: 1rem;
}

.task-history-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.task-history-card:hover {
  box-shadow: var(--shadow-md);
}

.task-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.task-title {
  color: var(--gray-900);
  margin: 0;
  font-size: 1.1rem;
}

.task-completion-info {
  text-align: right;
}

.completion-date {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.completion-time-ago {
  font-size: 0.8rem;
}

.task-history-body {
  border-top: 1px solid var(--gray-100);
  padding-top: 1rem;
}

.task-description {
  color: var(--gray-700);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.task-details {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.task-detail {
  color: var(--gray-600);
  font-size: 0.9rem;
}

/* Responsive log entries */
@media (max-width: 768px) {
  .log-entry .log-row { 
    grid-template-columns: 1fr; 
    gap: 0.5rem; 
    text-align: left;
    padding: 1rem;
  }
  
  .log-notes-cell { 
    justify-content: flex-start; 
    text-align: left; 
  }
  
  .comment-header { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 0.25rem; 
  }
  
  .comment-text { 
    padding-left: 0; 
  }

  /* Task history responsive */
  .task-history-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .task-completion-info {
    text-align: left;
  }

  .task-details {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Work Logs History Styles */
.work-logs-history-list {
  max-height: none;
}

.work-logs-date-group {
  margin-bottom: 2rem;
}

.work-logs-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
}

.date-title {
  margin: 0;
  color: var(--secondary);
  font-size: 1.1rem;
}

.logs-count {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.work-log-history-item {
  margin-bottom: 0.75rem;
}

.work-log-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.work-log-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(224, 94, 26, 0.1);
}

.work-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.work-log-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.time-separator {
  color: var(--gray-400);
  font-weight: normal;
}

.work-log-duration {
  margin-left: auto;
}

.duration-badge {
  background: var(--success);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.work-description {
  margin: 0 0 0.5rem 0;
  color: var(--gray-700);
  line-height: 1.5;
}

.work-log-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.work-log-controls {
  display: flex;
  align-items: center;
}

.work-log-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.work-log-content .work-description {
  margin: 0;
  flex: 1;
}

.work-log-content .log-timestamp {
  white-space: nowrap;
  font-size: 0.8rem;
}

/* Inline Attachment Links */
.attachment-link {
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.2);
  transition: all 0.2s ease;
  display: inline-block;
}

.attachment-link:hover {
  background: rgba(0, 123, 255, 0.2);
  border-color: rgba(0, 123, 255, 0.4);
  text-decoration: none;
}

/* Past Due Task Styles */
.task-card-past-due {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%) !important;
  border-left: 4px solid #e53e3e !important;
  border-color: #fc8181 !important;
}

.task-card-past-due .task-card-header h4 {
  color: #c53030;
}

.past-due-indicator {
  background: #e53e3e;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0%, 100% { 
    background: #e53e3e;
    transform: scale(1);
  }
  50% { 
    background: #c53030;
    transform: scale(1.02);
  }
}
}
