.dashboard {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #f5f7fa;

  .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background-image: url("/assets/images/image.png");
    background-size: cover;

    .content-header {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 12px;
      padding: 16px 24px;
      z-index: 10;

      .back-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        border-radius: 10px;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.2s ease;
        margin-right: auto;

        &:hover {
          background: #f3f4f6;
          border-color: #d1d5db;
          color: #1f2937;
        }

        fa-icon {
          font-size: 18px;
        }
      }

      .header-spacer {
        flex: 1;
      }

      .share-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        border-radius: 10px;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
          background: #f3f4f6;
          border-color: #d1d5db;
          color: #1f2937;
        }

        fa-icon {
          font-size: 18px;
        }
      }

      .login-button {
        padding: 10px 20px;
        background: #ffffff;
        border-radius: 10px;
        border: none;

        color: #1f2937;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
          background: #f9fafb;
          border-color: #d1d5db;
        }
      }

    }

    .content-body {
      flex: 1;
      overflow: hidden;
      position: relative;
      display: flex;
      flex-direction: column;

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

      &::-webkit-scrollbar-track {
        background: #f1f1f1;
      }

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

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

      // Welcome Screen
      .welcome-screen {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 40px 24px;
        opacity: 1;
        transition: opacity 0.3s ease;
        overflow-y: auto;

        &.fade-out {
          opacity: 0;
          pointer-events: none;
        }

        .welcome-header {
          text-align: center;
          margin-bottom: 40px;
          animation: fadeInDown 0.6s ease;

          .welcome-title {
            font-size: 60px;
            font-weight: 700;
            color: #1f2937;
            margin: 0 0 12px 0;
            line-height: 1.2;

            @media (max-width: 768px) {
              font-size: 36px;
            }
          }

          .welcome-subtitle {
            font-size: 40px;
            color: #6b7280;
            margin: 0;
            font-weight: 400;

            @media (max-width: 768px) {
              font-size: 18px;
            }
          }
        }

        .center-input-wrapper {
          width: 100%;
          max-width: 800px;
          margin-bottom: 48px;
          animation: fadeInUp 0.6s ease 0.2s both;
          position: relative;
          z-index: 5;

          &.animate-down {
            animation: slideDown 0.6s ease forwards;
          }
        }

        .agents-grid {
          width: 100%;
          max-width: 1000px;
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
          gap: 16px;
          animation: fadeInUp 0.6s ease 0.4s both;

          @media (max-width: 768px) {
            grid-template-columns: 1fr;
          }
        }
      }

      // Le chat-view prend tout l'espace quand actif
      app-chat-view {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }

      &.chat-active {
        .welcome-screen {
          display: none;
        }
      }
    }
  }
}

// Animations
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(calc(100vh - 200px));
    opacity: 0;
  }
}

// Responsive
@media (max-width: 768px) {
  .dashboard {
    .main-content {
      .content-header {
        padding: 12px 16px;

        .share-button {
          width: 36px;
          height: 36px;

          fa-icon {
            font-size: 16px;
          }
        }

        .login-button {
          padding: 8px 16px;
          font-size: 13px;
        }
      }

      .content-body {
        .welcome-screen {
          padding: 24px 16px;

          .welcome-header {
            margin-bottom: 32px;
          }

          .center-input-wrapper {
            margin-bottom: 32px;
          }
        }
      }
    }
  }
}
