/* Project card styles - added to support Components/Project.html layout */

.card { background: #fff; border-radius: 0; padding: 12px; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08); color: #24303a; margin: 0; overflow: auto; }

.project-header { margin-bottom: 18px; }

.project-customer { color: #3b82f6; /* blue */ font-weight: 700; font-size: 12px; letter-spacing: 0.06em; margin-bottom: 6px; }

.project-title { font-size: 28px; margin: 0; color: #0f172a; line-height: 1.15; }

.project-body { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }

.project-main .section-label { margin: 0 0 8px 0; font-size: 14px; color: #6b7280; }

.project-description p { margin: 0 0 12px 0; color: #374151; font-size: 14px; }

.project-meta { background: transparent; }

.meta-block { margin-bottom: 18px; }

.meta-label { font-size: 13px; color: #6b7280; margin-bottom: 8px; }

.due-row { display: flex; align-items: center; gap: 8px; color: #374151; font-size: 14px; }

.due-date { font-weight: 600; }

.labels { display: flex; gap: 8px; flex-wrap: wrap; }

.label-chip { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #0f172a; }

.label { background: #e0f2ff; /* light blue */ color: #12428b; }

.trello-link { display: inline-flex; align-items: center; gap: 8px; color: #2563eb; text-decoration: none; font-weight: 600; }

    .trello-link .icon { color: inherit; }

.icon { display: inline-block; vertical-align: middle; }

/* Small responsive tweaks */
@media (max-width: 880px) {
    .project-body { grid-template-columns: 1fr; }

    .project-card { padding: 20px; }
}

.time-entry { display: flex; }

.time-entry-description { flex: 1; background: #f3f4f6; border: none; border-radius: var(--border-radius); padding: 18px 16px; font-size: 14px; color: var(--text-color-dark); resize: none; min-height: 130px; margin-right: 20px; font-family: var(--font-family); }

    .time-entry-description::placeholder { color: var(--text-color-light); font-size: 1.2em; }

    .time-entry-description:focus { outline: none; }

.time-entry-details { display: flex; flex-direction: column; gap: 12px; min-width: 200px; }
.time-entry-level { padding: 10px; border: 1px solid #d1d5db; background-color: transparent; border-radius: var(--border-radius); font-size: 14px; width: 100%; }

.time-entry-billable { display: flex; justify-content: space-between; }

.time-entry-button { padding: 8px 12px; border: none; border-radius: var(--border-radius); font-size: 1.3rem; color: #fff; }
.start-button { background-color: #3c81ff; cursor: pointer; }
.start-button:hover { background-color: #2e78ff; }

.project-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background-color: #3b82f6; color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: "Quicksand", sans-serif; font-size: 0.95rem; overflow: hidden; }

.time-entry { display: flex; align-items: center; gap: 20px; }
.time-entry-info p { margin: 4px 0; }

.light-text { color: var(--text-color-light); }

.time-entry-meta { display: flex; gap: 24px; align-items: center; margin-left: auto; align-self: flex-end; }
.time-entry-actions { display: flex; }
.recent-time-entries { display: flex; gap: 8px; flex-direction: column; }

/* Validation styles for CreateTimeEntry */
.invalid-field {
    border: 1px solid #ef4444 !important; /* red border */
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.06);
}

.invalid-field:focus {
    outline: none;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12);
}

.field-error {
    color: #ef4444; /* red */
    font-size: 0.9rem;
    margin-top: 6px;
}

/* Ensure the left column holds textarea and its error message */
.time-entry { display: flex; align-items: flex-start; gap: 20px; }
.time-entry-left { flex: 1; display: flex; flex-direction: column; }
.time-entry-description { width: 100%; }

/* Keep details column aligned at top */
.time-entry-details { display: flex; flex-direction: column; gap: 12px; min-width: 200px; align-items: stretch; }


/* --- Appended global Projects page styles (from Projects.razor.css) --- */
:root{
  --bg:#f8fafc;
  --card-bg:#ffffff;
  --muted:#6b7280;
  --primary:#2563eb;
  --accent:#3b82f6;
  --danger:#ef4444;
  --radius:8px;
}

.page-projects{
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:16px;
  min-height:100vh;
  background:linear-gradient(180deg,var(--bg),#ffffff 60%);
}

.filters{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  background:transparent;
}

.filters label{ font-weight:600; color:var(--muted); margin-right:6px; }

.table-projects{
  background:var(--card-bg);
  border-radius:var(--radius);
  padding:12px;
  box-shadow:0 6px 20px rgba(2,6,23,0.06);
  overflow:auto;
  max-height: calc(100vh - 220px); /* leave room for header, filters and padding */
}

/* Constrain the projects table card so it fits the viewport and scrolls when content is large */
.table-projects {
  max-height: calc(100vh - 220px); /* leave room for header, filters and padding */
  overflow: auto;
  padding: 0 12px 8px; /* remove top padding so sticky header is flush with top */
}

/* Ensure the table uses full width and doesn't overflow container */
.table-projects table { width: 100%; border-collapse: separate; }

/* Keep table header sticky so column titles remain visible while scrolling */
.table-projects thead th {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 5;
}

.table-projects td{ padding:12px 16px; vertical-align:middle; border-bottom:1px solid #f1f5f9; color:#0f172a; }

.table-projects tr:last-child td{ border-bottom:0; }

/* Fix button alignment and text centering */
.btn-sm{ 
  padding: 6px 12px; 
  font-size: 0.85rem; 
  border-radius: 6px; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: normal;
}

.btn-primary{ background:var(--primary); color:#fff; border:none; }
.btn-primary:hover{ background:#1e4fd6; }

.btn-secondary{ background:#f3f4f6; color:#0f172a; border:none; }

.edit-project-form{ width:100%; max-width:none; padding:0; box-sizing:border-box; }
.edit-project-form .mb-2{ margin-bottom:14px; }
.edit-project-form label{ display:block; font-weight:600; margin-bottom:6px; color:var(--muted); }
.edit-project-form input.form-control,
.edit-project-form textarea.form-control,
.edit-project-form select.form-select{
  width:100%; padding:10px 12px; border-radius:6px; border:1px solid #e6edf3; background:#fff; color:#0f172a; box-sizing:border-box;
}

/* Modal tweaks using existing ModalDialog classes (align with app.css) */
.modal-backdrop{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(2,6,23,0.45); z-index:2000; padding:24px; box-sizing:border-box;
}
.modal{
  background:var(--card-bg); border-radius:var(--border-radius); padding:20px; width:100%; max-width:920px; box-shadow:0 20px 40px rgba(2,6,23,0.2); outline:none; color:var(--text-color-dark);
}
.modal h4{ margin:0 0 14px 0; font-size:1.05rem; font-weight:700; color:#0f172a; }
.modal-body{ padding:0; width:100%; }
.modal-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }

@media (max-width:880px){
  .filters{ flex-direction:column; align-items:stretch; }
  .table-projects td, .table-projects th{ padding:10px 12px; }
  .modal{ margin:12px; }
}

/* Ensure modal actions layout horizontally and buttons are inline */
.modal-actions,
.modal .modal-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px;
}

/* Reset block spacing and ensure buttons sit next to each other */
.modal-actions > * {
  margin: 0;
}

/* Small spacing for adjacent buttons */
.modal-actions button + button {
  margin-left: 8px;
}

/* Ensure modal buttons don't expand to full width */
.modal-actions .btn {
  min-width: auto;
}

/* Make selects and buttons match global app/modal styles */
.page-projects .form-select,
.page-projects select,
.page-projects .form-control {
  height: 40px;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  border: 1px solid #e6edf3;
  background: #fff;
  font-family: var(--font-family);
  color: #0f172a;
  box-sizing: border-box;
}

.page-projects .form-select:focus,
.page-projects .form-control:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
  border-color: #c7defc;
}

.page-projects .btn {
  padding: 8px 12px;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.page-projects .btn.btn-primary {
  background: var(--primary);
  color: #fff;
}

.page-projects .btn.btn-primary:hover { background: #1e4fd6; }

.page-projects .btn.btn-secondary {
  background: #f3f4f6;
  color: #0f172a;
}

.page-projects .btn.btn-secondary:hover { background: #e6e9ec; }

/* Ensure small buttons stay compact */
.page-projects .btn-sm { padding: 6px 8px; font-size: 0.85rem; }
/* Modal adjustments to match global app modal layout and ensure form fields span full width */
.modal {
  padding: 20px; /* match app.css */
  max-width: 920px;
  width: 100%;
}

.modal-body {
  padding-top: 8px; /* match app.css */
  width: 100%;
}

/* Ensure the edit form uses the full width available inside the modal */
.modal .edit-project-form {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Make sure each form row stretches the full width and inputs take all space */
.modal .edit-project-form .mb-2 {
  width: 100%;
  margin: 0 0 14px 0;
}

.modal .edit-project-form label {
  margin-bottom: 8px;
}

.modal .edit-project-form input.form-control,
.modal .edit-project-form textarea.form-control,
.modal .edit-project-form select.form-select {
  width: 100%;
  display: block;
  box-sizing: border-box;
}

/* Ensure checkbox line doesn't create large indentation */
.modal .form-check {
  margin: 6px 0 0 0;
}

/* Footer buttons: don't force large min-width */
.modal-actions .btn {
  min-width: auto;
}

/* minor: ensure modal body content aligns with title (no unintended left offset) */
.modal h4 { margin-left: 0; }
/* Make table rows look clickable */
.table-projects tbody tr { cursor: pointer; transition: background-color 0.12s ease; }
.table-projects tbody tr:hover { background-color: #f8fafc; }

/* Keep cells' hover behaviour subtle */
.table-projects tbody tr:hover td { background-color: transparent; }
/* Delete button style used for time entries and now projects */
.btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #0f172a; /* default icon color (dark) */
  cursor: pointer;
}

/* Hover effect only when button is not disabled */
.btn-delete:not(:disabled):hover {
  background: rgba(239,68,68,0.08);
  color: var(--danger); /* make icon red on hover */
}

.btn-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  color: #0f172a; /* keep icon dark when disabled */
  background: transparent;
}

/* Ensure icon does not capture pointer events */
.btn-delete i { pointer-events: none; }

:root { --bg: #f8fafc; --card-bg: #ffffff; --muted: #6b7280; --primary: #2563eb; --accent: #3b82f6; --danger: #ef4444; --radius: 8px; }

.page-projects { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-height: 100vh; background: linear-gradient(180deg,var(--bg),#ffffff 60%); }

/* Fix status alignment in the filters section */
.filters { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  flex-wrap: wrap; 
  background: transparent; 
  justify-content: space-between; /* push status to far right */ 
}

.filters-left { display: flex; gap: 12px; align-items: center; }
.filters-right { display: flex; gap: 12px; align-items: center; } /* Added align-items: center */

.filters label { 
  font-weight: 600; 
  color: var(--muted); 
  margin-right: 6px; 
  display: inline-flex; 
  align-items: center;
}

.table-projects { background: var(--card-bg); border-radius: var(--radius); padding: 12px; box-shadow: 0 6px 20px rgba(2,6,23,0.06); overflow: auto; }

    .table-projects table { border-collapse: separate; border-spacing: 0; width: 100%; }
    .table-projects th { text-align: center; padding: 12px 16px; color: var(--muted); font-size: 13px; font-weight: 700; border-bottom: 1px solid #eef2f7; }
    .table-projects td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; color: #0f172a; text-align: center; }

    .table-projects tr:last-child td { border-bottom: 0; }

.btn-sm { 
  padding: 6px 10px; 
  font-size: 0.85rem; 
  border-radius: 6px; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px; /* Fixed height to ensure consistent button sizing */
}

.btn-primary { background: var(--primary); color: #fff; border: none; }
    .btn-primary:hover { background: #1e4fd6; }

.btn-secondary { background: #f3f4f6; color: #0f172a; border: none; }

.edit-project-form { max-width: 720px; min-width: 300px; }
    .edit-project-form .mb-2 { margin-bottom: 12px; }
    .edit-project-form label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
    .edit-project-form input.form-control,
    .edit-project-form textarea.form-control,
    .edit-project-form select.form-select { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid #e6edf3; background: #fff; color: #0f172a; }

/* Modal tweaks using existing ModalDialog classes */
.modal-backdrop { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(2,6,23,0.45); z-index: 2000; }
.modal { background: var(--card-bg); border-radius: 10px; padding: 18px; width: 100%; max-width: 820px; box-shadow: 0 20px 40px rgba(2,6,23,0.2); outline: none; }
    .modal h4 { margin: 0 0 12px 0; font-size: 18px; color: #0f172a; }
.modal-body { padding: 6px 0 0 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

@media (max-width:880px) {
    .filters { flex-direction: column; align-items: stretch; }
    .filters-left { justify-content: stretch; }
    .filters-right { justify-content: stretch; }
    .table-projects td, .table-projects th { padding: 10px 12px; }
    .modal { margin: 12px; }
}

/* Skeleton loading styles */
.skeleton .table { opacity:0.98; }
.skeleton-row { pointer-events: none; }
.skeleton-line {
 height:14px;
 background: linear-gradient(90deg, rgba(240,240,240,1)8%, rgba(230,230,230,1)18%, rgba(240,240,240,1)33%);
 background-size:200%100%;
 border-radius:6px;
 animation: shimmer 1.2s linear infinite;
}
.skeleton-short { width:80px; height:12px; }
.skeleton-medium { width:160px; height:12px; }
.skeleton-long { width:100%; height:12px; }
.skeleton-title { width:50%; height:26px; margin-top:8px; }
.skeleton-block { width:100%; height:48px; border-radius:8px; background: linear-gradient(90deg, rgba(240,240,240,1)8%, rgba(230,230,230,1)18%, rgba(240,240,240,1)33%); background-size:200%100%; animation: shimmer 1.2s linear infinite; }
.skeleton-action { width:32px; height:32px; border-radius:6px; background: linear-gradient(90deg, rgba(240,240,240,1)8%, rgba(230,230,230,1)18%, rgba(240,240,240,1)33%); background-size:200%100%; animation: shimmer 1.2s linear infinite; margin:6px auto; }

@keyframes shimmer {
0% { background-position: -150%0; }
100% { background-position:150%0; }
}

/* Provide subtle spacing to match real rows */
.skeleton-row td { padding:12px16px; }

/* Reduce table header emphasis during loading */
.table-projects.skeleton thead th { color: rgba(107,114,128,0.5); }

/* Ensure the skeleton doesn't show hover effects */
.table-projects.skeleton tbody tr:hover { background: transparent; }

/* Selected project skeleton spacing */
.skeleton-project { background: transparent; padding:8px016px0; }
.skeleton-project .project-header { display:flex; flex-direction:column; gap:8px; }
.skeleton-project .project-description p { display:flex; flex-direction:column; gap:8px; }
.skeleton-project .project-meta { display:flex; flex-direction:column; gap:12px; }

/* Project description text styling - looks like regular text but preserves line breaks */
.description-text {
  white-space: pre-wrap; /* Preserves line breaks and wraps text */
  word-wrap: break-word; /* Breaks long words to prevent overflow */
  color: var(--text-color-dark); /* Uses theme-aware color variable */
  font-size: 14px; /* Match paragraph font size */
  line-height: 1.5; /* Comfortable reading line height */
  margin: 0;
  padding: 0;
  font-family: inherit;
  max-height: 200px; /* Limit vertical space */
  overflow-y: auto; /* Add scroll if content is too long */
}

/* Optional: Add scrollbar styling for dark theme */
.description-text::-webkit-scrollbar {
  width: 6px;
}

.description-text::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .description-text::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.description-text::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

[data-theme="dark"] .description-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.description-text::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .description-text::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
