/* Custom Styles for AdminLTE 4 Kanban Board */

:root {
  --kanban-bg: #eceff1;
  --kanban-list-bg: #f4f6f9;
  --card-hover-border: #007bff;
  --transition-speed: 0.25s;
}

body {
  font-family: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  background-color: var(--kanban-bg);
  color: #374151;
  letter-spacing: -0.01em;
}

/* Kanban Board Container */
.kanban-board-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 57px); /* Subtract Header height */
  overflow: hidden;
}

/* Board Header Panel */
.board-header {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Columns Scroll Wrapper */
.kanban-columns-wrapper {
  display: flex;
  flex-direction: row;
  flex-grow: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1.25rem;
  gap: 1.25rem;
  align-items: flex-start;
}

/* Kanban List (Column) */
.kanban-list {
  width: 320px;
  min-width: 320px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--kanban-list-bg);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.kanban-list:hover {
  box-shadow: 0 8px 12px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* List Header */
.kanban-list-header {
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
}

.kanban-list-header .list-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: #374151;
  margin: 0;
}

/* Cards Wrapper inside List */
.kanban-cards-container {
  overflow-y: auto;
  flex-grow: 1;
  padding: 0.25rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 50px; /* Crucial for drop zone */
}

/* Kanban Card (Task) */
.kanban-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  border-left: 4px solid #6c757d;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  user-select: none;
  position: relative;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
  border-left-color: var(--card-hover-border);
}

.kanban-card-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: #1f2937;
  margin-bottom: 0.3rem;
  word-break: break-word;
  line-height: 1.4;
}

.kanban-card-desc {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.5;
}

/* Attachment indicator on card */
.kanban-card-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid #f3f4f6;
}

.kanban-card-attachment i {
  color: #ef4444;
  font-size: 0.7rem;
}

.kanban-card-attachment span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Priority Indicator Colors */
.kanban-card.priority-high { border-left-color: #dc3545; }
.kanban-card.priority-medium { border-left-color: #ffc107; }
.kanban-card.priority-low { border-left-color: #28a745; }

/* Custom Scrollbars */
.kanban-columns-wrapper::-webkit-scrollbar,
.kanban-cards-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.kanban-columns-wrapper::-webkit-scrollbar-track,
.kanban-cards-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.kanban-columns-wrapper::-webkit-scrollbar-thumb,
.kanban-cards-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.kanban-columns-wrapper::-webkit-scrollbar-thumb:hover,
.kanban-cards-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Setup Overlay / Setup Alert */
#setup-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Spinner Overlay for Loading States */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  border-radius: 10px;
}

/* Drag and Drop Visual Cues */
.kanban-card.dragging {
  opacity: 0.4;
  border: 2px dashed #007bff;
}

.kanban-cards-container.drag-over {
  background-color: rgba(0, 123, 255, 0.05);
  border-radius: 8px;
}

.kanban-list.column-dragging {
  opacity: 0.4;
  border: 2px dashed #007bff;
}

.kanban-list.column-drag-over {
  border: 2px dashed #007bff;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.15);
}

/* Mobile Responsiveness */
@media (max-width: 767.98px) {
  .kanban-columns-wrapper {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem;
    gap: 1.5rem;
    height: 100%;
  }

  .kanban-list {
    width: 100%;
    min-width: 100%;
    max-height: 450px;
  }
}

/* Auth Loading State to prevent layout flashing */
body.auth-loading .app-wrapper,
body.auth-loading .login-box {
  display: none !important;
}
body.auth-loading::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3rem;
  height: 3rem;
  border: 0.3rem solid rgba(0, 123, 255, 0.2);
  border-right-color: #007bff;
  border-radius: 50%;
  animation: auth-spinner-border .75s linear infinite;
  z-index: 9999;
}
@keyframes auth-spinner-border {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================
   DASHBOARD SEARCH STYLES
   ============================ */

/* Card container */
.dashboard-search-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06) !important;
}

/* Icon wrap on the left */
.dashboard-search-icon-wrap {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-search-icon-wrap i {
  color: #fff;
  font-size: 1rem;
}

/* Input field */
.dashboard-search-input {
  border: 1px solid #e5e7eb;
  border-radius: 10px !important;
  background: #f9fafb;
  font-size: 0.88rem;
  padding-right: 2.5rem;
  height: 42px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dashboard-search-input:focus {
  background: #fff;
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.dashboard-search-input::placeholder {
  color: #adb5bd;
  font-size: 0.85rem;
}

/* Floating clear button inside input */
.dashboard-search-clear-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  padding: 2px 6px;
  line-height: 1;
  z-index: 5;
}

.dashboard-search-clear-btn:hover {
  color: #374151;
}

/* Results area scrollable */
#sidebar-search-results {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
  border-top: 1px solid #f0f0f0;
  padding-top: 0.25rem;
}

#sidebar-search-results::-webkit-scrollbar {
  width: 4px;
}
#sidebar-search-results::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 3px;
}

/* Individual result item */
.dashboard-search-result-item {
  border-left: 3px solid transparent;
  background: #f9fafb;
  transition: all 0.18s ease;
}

.dashboard-search-result-item:hover {
  border-left-color: #0d6efd !important;
  background: rgba(13, 110, 253, 0.06) !important;
}

/* Description snippet in results */
.dashboard-search-result-item .text-muted {
  font-size: 0.78rem;
}

/* Multi-file attachment list in card modal */
#card-files-list .alert,
#card-existing-attachments .alert {
  margin-bottom: 0.35rem !important;
  font-size: 0.85rem;
  animation: fadeSlideIn 0.2s ease;
}

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

/* ============================
   BLOG / CATATAN STYLES
   ============================ */

/* Blog list card */
.blog-list-card {
  border-left: 4px solid #198754 !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
  animation: fadeSlideIn 0.25s ease;
}

.blog-list-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1) !important;
  border-left-color: #0d6efd !important;
}

/* Blog card title */
.blog-card-title {
  font-size: 1rem;
  max-width: 100%;
}

/* Blog content preview text */
.blog-content-preview {
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Blog read modal content formatting */
.blog-read-content p {
  line-height: 1.8;
  margin-bottom: 1rem;
  color: #374151;
  font-size: 0.95rem;
}

/* Blog form textarea */
#blog-content-input {
  font-family: inherit;
  line-height: 1.7;
  resize: vertical;
  min-height: 250px;
}

/* Blog drop zone hover state */
#blog-drop-zone:hover {
  border-color: #198754 !important;
  background-color: #f0fdf4;
}

/* Toast notification */
.toast {
  animation: slideInRight 0.3s ease;
}

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

/* Blog attachment list in form */
#blog-files-list .alert,
#blog-existing-attachments .alert {
  margin-bottom: 0.35rem !important;
  font-size: 0.85rem;
  animation: fadeSlideIn 0.2s ease;
}

/* ============================
   DASHBOARD PANEL STYLES
   ============================ */

/* Visually Premium Stat Cards with linear gradients */
.stat-card-blue {
  background: linear-gradient(135deg, #0d6efd 0%, #00b4db 100%);
  color: #ffffff;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.stat-card-purple {
  background: linear-gradient(135deg, #6f42c1 0%, #9061f9 100%);
  color: #ffffff;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.stat-card-green {
  background: linear-gradient(135deg, #198754 0%, #2ecc71 100%);
  color: #ffffff;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.stat-card-rose {
  background: linear-gradient(135deg, #d63384 0%, #ff758c 100%);
  color: #ffffff;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.stat-card-blue:hover,
.stat-card-purple:hover,
.stat-card-green:hover,
.stat-card-rose:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Stat Card Icon Box - glass effect square */
.stat-card-icon-box {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  flex-shrink: 0;
  margin-bottom: 0.25rem;
}

.stat-card-icon-box i {
  font-size: 1.15rem;
  color: #fff;
}

/* Stat card value - large number */
.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* Stat card label - title */
.stat-card-label-new {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.9);
}

/* Stat card sub-label */
.stat-card-sub {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

/* Decorative background circles */
.stat-deco-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.stat-deco-1 {
  width: 100px;
  height: 100px;
  bottom: -30px;
  right: -25px;
}

.stat-deco-2 {
  width: 55px;
  height: 55px;
  bottom: 20px;
  right: 55px;
  background: rgba(255, 255, 255, 0.07);
}

@media (max-width: 575.98px) {
  .stat-card-value {
    font-size: 1.55rem;
  }
  .stat-card-icon-box {
    width: 36px;
    height: 36px;
  }
  .stat-card-icon-box i {
    font-size: 0.95rem;
  }
  .stat-card-label-new {
    font-size: 0.63rem;
  }
  .stat-card-sub {
    font-size: 0.6rem;
  }
  .stat-deco-1 {
    width: 75px;
    height: 75px;
    bottom: -20px;
    right: -18px;
  }
  .stat-deco-2 {
    width: 38px;
    height: 38px;
    right: 38px;
    bottom: 14px;
  }
}

/* Dashboard panel wrapper - responsive padding and custom scrollbar */
.dashboard-panel-wrapper {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.dashboard-panel-wrapper::-webkit-scrollbar {
  width: 6px;
}

.dashboard-panel-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

.dashboard-inner-content {
  padding: 1rem 1.25rem 1.5rem;
}

@media (max-width: 575.98px) {
  .dashboard-inner-content {
    padding: 0.75rem 0.75rem 1.25rem;
  }
}

/* Dashboard Table customization */
#dashboard-tasks-table-container table tbody tr {
  transition: background-color var(--transition-speed) ease;
}

#dashboard-tasks-table-container table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.04) !important;
}

/* Blog list items on the Dashboard */
.dashboard-blog-item {
  border-left: 4px solid #198754 !important;
  border-radius: 10px;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.dashboard-blog-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08) !important;
  border-left-color: #0d6efd !important;
}

.dashboard-blog-item .style-blog-title {
  font-size: 0.88rem;
  color: #2c3e50;
}

.dashboard-blog-item .small-text-meta {
  font-size: 0.72rem;
}

.dashboard-blog-item .text-muted.text-xs {
  font-size: 0.7rem;
}

/* Card Meta and Due Date Badge Styling */
.kanban-card-meta {
  font-size: 0.72rem;
  color: #6b7280;
  border-top: 1px solid #f3f4f6;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
}

.kanban-card-meta span {
  display: inline-flex;
  align-items: center;
}

.kanban-card-meta .badge {
  font-weight: 500;
  padding: 0.25em 0.6em;
  border-radius: 4px;
}

/* ============================================================
   MODERNIZED SIDEBAR STYLE OVERRIDES
   ============================================================ */

/* Main Sidebar Container Override */
.app-sidebar {
  background: linear-gradient(185deg, #111827 0%, #0f172a 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(20px);
  transition: transform 0.3s ease, width 0.3s ease !important;
  height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Sidebar Scrollable Area */
.app-sidebar .sidebar-wrapper {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Brand Section Style */
.app-sidebar .sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  padding: 1.15rem 1rem !important;
}

.app-sidebar .sidebar-brand .brand-text {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 650 !important;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header Text (Categories like Workspaces) */
.app-sidebar .nav-header {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.09em !important;
  color: rgba(255, 255, 255, 0.35) !important;
  padding: 1.25rem 1.4rem 0.45rem !important;
  text-transform: uppercase;
}

/* General Menu Link Styles */
.app-sidebar .nav-link {
  border-radius: 10px !important;
  margin: 0.22rem 0.65rem !important;
  padding: 0.65rem 0.95rem !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.65) !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Link Hover State */
.app-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
  transform: translateX(4px);
}

/* Active Link Gradients based on current color themes */
.app-sidebar .nav-link.active.bg-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38) !important;
  transform: translateX(4px);
}

.app-sidebar .nav-link.active.bg-secondary {
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.35) !important;
  transform: translateX(4px);
}

.app-sidebar .nav-link.active.bg-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35) !important;
  transform: translateX(4px);
}

/* Active and Hover Submenu Link overrides */
.app-sidebar .nav-treeview .nav-link {
  margin-left: 1.15rem !important;
  padding: 0.5rem 0.85rem !important;
  font-size: 0.82rem !important;
  opacity: 0.82;
}

.app-sidebar .nav-treeview .nav-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05) !important;
}

.app-sidebar .nav-treeview .nav-link.active {
  background: rgba(255, 255, 255, 0.1) !important;
  opacity: 1;
  transform: translateX(4px);
}

/* Add Board Button Style Adjustment */
.app-sidebar .sidebar-wrapper .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
  border: none !important;
  font-weight: 600 !important;
  font-size: 0.8rem;
  border-radius: 9px !important;
  padding: 0.55rem 0.9rem !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28) !important;
  transition: all 0.22s ease !important;
}

.app-sidebar .sidebar-wrapper .btn-primary:hover {
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.38) !important;
}

/* Dynamic Sidebar Board Menu Links */
#sidebar-boards-list a {
  border-radius: 10px !important;
  margin: 0.25rem 0.65rem !important;
  padding: 0.6rem 0.95rem !important;
  color: rgba(255, 255, 255, 0.65) !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#sidebar-boards-list a:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  transform: translateX(4px);
}

#sidebar-boards-list a.active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
  transform: translateX(4px);
}

/* Sidebar Thin Customized Scrollbar */
.app-sidebar .sidebar-wrapper::-webkit-scrollbar {
  width: 4px;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ============================
   FILE GRID VIEW STYLES
   ============================ */

/* Grid container wrapping */
#files-grid-body,
#berkaszul-files-grid-body {
  align-content: flex-start;
}

/* Each grid card */
.file-grid-card {
  border-radius: 12px !important;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
}

/* Thumbnail area */
.file-grid-thumb {
  display: block;
  width: 100%;
  background-color: #f8f9fa;
  flex-shrink: 0;
}

/* Info area below thumbnail */
.file-grid-card .p-2 {
  flex: 1;
  min-width: 0;
}

/* Truncated name */
.file-grid-card .text-truncate {
  max-width: 100%;
}

/* Video thumbnail styling */
.file-grid-card video.file-grid-thumb {
  pointer-events: none;
}

/* Size slider thumb appearance */
#files-grid-size-slider,
#berkaszul-grid-size-slider {
  cursor: pointer;
  accent-color: #0d6efd;
}

/* View toggle button group active state */
#files-view-toggle .btn.active,
#berkaszul-view-toggle .btn.active {
  background-color: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

