@keyframes ppm-index-project-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.projects-page-modern {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  min-height: 100vh;

  .page-wrapper {
    max-width: 1920px;
    margin: 0 auto;
  }

  .stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .stat-card {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    &:hover {
      transform: translateY(-8px);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    }

    .stat-decoration {
      position: absolute;
      width: 120px;
      height: 120px;
      border-radius: 50%;
      opacity: 0.08;
      top: -30px;
      right: -30px;
    }

    .stat-icon-wrapper {
      width: 64px;
      height: 64px;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      z-index: 1;

      .stat-icon {
        font-size: 28px;
        color: white;
      }
    }

    .stat-content {
      flex: 1;
      z-index: 1;
    }

    .stat-value {
      font-size: 2.25rem;
      font-weight: 800;
      line-height: 1;
      margin-bottom: 0.5rem;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .stat-label {
      font-size: 0.9rem;
      font-weight: 600;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    &.completed {
      .stat-icon-wrapper {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
      }
      .stat-decoration {
        background: #10b981;
      }
    }

    &.not-started {
      .stat-icon-wrapper {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
      }
      .stat-decoration {
        background: #f59e0b;
      }
    }

    &.in-progress {
      .stat-icon-wrapper {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
      }
      .stat-decoration {
        background: #3b82f6;
      }
    }

    &.cancelled {
      .stat-icon-wrapper {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
      }
      .stat-decoration {
        background: #ef4444;
      }
    }
  }

  .control-bar {
    background: white;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
    gap: 1rem;
  }

  .control-left {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .view-switcher {
    position: relative;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0.35rem;
    display: flex;
    gap: 0.35rem;

    .view-btn {
      position: relative;
      z-index: 2;
      background: transparent;
      border: none;
      padding: 0.625rem 1.25rem;
      border-radius: 10px;
      font-weight: 600;
      font-size: 0.9rem;
      color: #64748b;
      cursor: pointer;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      gap: 0.5rem;

      i {
        font-size: 1.1rem;
      }

      &.active {
        color: #667eea;
      }

      &:hover {
        color: #667eea;
      }
    }

    .active-indicator {
      position: absolute;
      top: 0.35rem;
      left: 0.35rem;
      width: calc(50% - 0.35rem);
      height: calc(100% - 0.7rem);
      background: white;
      border-radius: 10px;
      box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 1;
    }
  }

  .control-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .action-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;

    i {
      font-size: 1rem;
    }

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    &.filter-btn:hover {
      border-color: #3b82f6;
      color: #3b82f6;
      background: #eff6ff;
    }

    &.pdf-btn:hover {
      border-color: #10b981;
      color: #10b981;
      background: #d1fae5;
    }

    &.excel-btn:hover {
      border-color: #ef4444;
      color: #ef4444;
      background: #fee2e2;
    }

    &.add-btn {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      border: none;

      &:hover {
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
      }
    }
  }

  .action-btn,
  .view-btn,
  .modern-btn,
  .action-icon,
  .card-action,
  button,
  a.action-btn {
    &:focus,
    &:focus-visible,
    &:active:focus {
      outline: none !important;
      box-shadow: none !important;
    }
  }

  .list-view-container {
    animation: ppm-index-project-fade-in 0.5s ease;
  }

  .table-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
  }

  .modern-table {
    .vgt-table {
        border: none;

        thead {
          background: #f8fafc;

          th {
            border: none;
            padding: 1rem;
            font-weight: 700;
            color: #334155;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.05em;
          }
        }

        tbody {
          tr {
            border-bottom: 1px solid #f1f5f9;
            transition: all 0.2s ease;

            &:hover {
              background: #f8fafc;
            }

            td {
              padding: 1rem;
              color: #475569;
              font-size: 0.9rem;
            }
          }
        }
    }
  }

  .action-buttons-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
  }

  .action-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;

    &.edit {
      color: #10b981;
      background: #d1fae5;

      &:hover {
        background: #10b981;
        color: white;
        transform: scale(1.1);
      }
    }

    &.delete {
      color: #ef4444;
      background: #fee2e2;

      &:hover {
        background: #ef4444;
        color: white;
        transform: scale(1.1);
      }
    }
  }

  .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;

    &.completed {
      background: #d1fae5;
      color: #065f46;
    }

    &.not-started {
      background: #fed7aa;
      color: #92400e;
    }

    &.in-progress {
      background: #dbeafe;
      color: #1e40af;
    }

    &.cancelled {
      background: #fee2e2;
      color: #991b1b;
    }

    &.on-hold {
      background: #e5e7eb;
      color: #374151;
    }
  }

  .kanban-container {
    animation: ppm-index-project-fade-in 0.5s ease;
  }

  .kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: start;
  }

  .kanban-column {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;

    &:hover {
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    }
  }

  .column-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;

    i {
      font-size: 1.4rem;
      color: white;
    }
  }

  .not-started-col .header-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  }

  .in-progress-col .header-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  }

  .on-hold-col .header-icon {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  }

  .completed-col .header-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  }

  .cancelled-col .header-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  }

  .header-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
  }

  .header-count {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #475569;
    font-size: 0.875rem;
  }

  .column-body {
    padding: 1rem;
    max-height: calc(100vh - 340px);
    overflow-y: auto;

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-track {
      background: #f1f5f9;
      border-radius: 3px;
    }

    &::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 3px;

      &:hover {
        background: #94a3b8;
      }
    }
  }

  .cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .project-card {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;

    &:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
      border-color: #cbd5e1;
    }
  }

  .card-top {
    padding: 1.25rem;
    background: white;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
  }

  .card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    flex: 1;
    overflow-wrap: break-word;
  }

  .card-menu {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;

    .project-card:hover & {
      opacity: 1;
    }
  }

  .card-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;

    i {
      font-size: 0.9rem;
    }

    &.edit {
      color: #10b981;
      background: #d1fae5;

      &:hover {
        background: #10b981;
        color: white;
      }
    }

    &.delete {
      color: #ef4444;
      background: #fee2e2;

      &:hover {
        background: #ef4444;
        color: white;
      }
    }
  }

  .card-body {
    padding: 1.25rem;
  }

  .info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;

    &:last-of-type {
      margin-bottom: 0;
    }
  }

  .info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    i {
      font-size: 0.9rem;
      opacity: 0.7;
    }
  }

  .info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
    overflow-wrap: break-word;
    max-width: 55%;
  }

  .date-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
  }

  .date-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;

    i {
      font-size: 0.85rem;
      opacity: 0.7;
    }

    &.start {
      flex: 1;
    }

    &.end {
      flex: 1;
    }
  }

  .date-separator {
    color: #cbd5e1;
    font-weight: 600;
  }

  .card-footer {
    padding: 1rem 1.25rem;
    background: white;
    border-top: 1px solid #f1f5f9;
  }

  .status-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;

    &.completed {
      background: #d1fae5;
      color: #065f46;
    }

    &.not-started {
      background: #fed7aa;
      color: #92400e;
    }

    &.in-progress {
      background: #dbeafe;
      color: #1e40af;
    }

    &.cancelled {
      background: #fee2e2;
      color: #991b1b;
    }

    &.on-hold {
      background: #e5e7eb;
      color: #374151;
    }
  }

  .empty-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #94a3b8;

    i {
      font-size: 3rem;
      margin-bottom: 1rem;
      opacity: 0.3;
    }

    p {
      margin: 0;
      font-size: 0.875rem;
      font-weight: 500;
    }
  }

  .fade-slide-enter-active,
  .fade-slide-leave-active {
    transition: all 0.4s ease;
  }

  .fade-slide-enter,
  .fade-slide-leave-to {
    opacity: 0;
    transform: translateY(20px);
  }

  .card-list-enter-active,
  .card-list-leave-active {
    transition: all 0.4s ease;
  }

  .card-list-enter,
  .card-list-leave-to {
    opacity: 0;
    transform: translateX(-20px);
  }

  .card-list-move {
    transition: transform 0.4s ease;
  }

  @media (max-width: 1400px) {
    .kanban-board {
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
  }

  @media (max-width: 991px) {
    .stats-dashboard {
      grid-template-columns: repeat(2, 1fr);
    }

    .control-bar {
      flex-direction: column;
      align-items: stretch;
    }

    .control-left,
    .control-right {
      width: 100%;
      justify-content: center;
    }

    .kanban-board {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 640px) {
    padding: 1rem;

    .stats-dashboard {
      grid-template-columns: 1fr;
      gap: 1rem;
    }

    .stat-card {
      padding: 1.25rem;

      .stat-value {
        font-size: 1.75rem;
      }
    }

    .view-switcher {
      width: 100%;

      .view-btn {
        flex: 1;
        justify-content: center;
      }
    }

    .control-right {
      width: 100%;
      flex-direction: column;

      .action-btn {
        width: 100%;
        justify-content: center;
      }
    }

    .card-menu {
      opacity: 1;
    }

    .info-value {
      max-width: 60%;
    }
  }
}

.modern-sidebar {
  .b-sidebar-header {
    padding: 1.5rem;
    border-bottom: 2px solid #f1f5f9;

    .close {
      font-size: 1.5rem;
      opacity: 0.5;
      transition: opacity 0.3s ease;

      &:hover {
        opacity: 1;
      }
    }
  }

  .btn:focus,
  .btn:active:focus,
  .btn.focus {
    outline: none !important;
    box-shadow: none !important;
  }

  .sidebar-content {
    padding: 1.5rem;
  }

  .modern-form-group {
    margin-bottom: 1.5rem;

    label {
      font-weight: 600;
      color: #334155;
      font-size: 0.875rem;
      margin-bottom: 0.5rem;
    }
  }

  .modern-input {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;

    &:focus {
      border-color: #667eea;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
  }

  .modern-select {
    .vs__dropdown-toggle {
      border-radius: 10px;
      border: 2px solid #e2e8f0;
      padding: 0.5rem 1rem;
    }

    .vs__search {
      padding: 0.25rem 0;
    }

    &.vs--open .vs__dropdown-toggle {
      border-color: #667eea;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
  }

  .modern-btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    i {
      margin-right: 0.5rem;
    }
  }
}
