/* create-project.component.scss */

.wrapper {
  background-color: var(--color-nodes-sidepanel-bg);
  border-radius: 12px;
  width: 590px;
  max-height: 85vh;
  border: 1px solid var(--color-divider-subtle);
  display: flex;
  flex-direction: column;
  color: #fff;

  .dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--color-divider-subtle);

    .icon-and-title {
      display: flex;
      align-items: center;
      min-width: 0;

      i {
        font-size: 1.5rem;
        margin-right: 1.5rem;
        color: var(--accent-color);
      }

      .title {
        font-size: 1.125rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: opacity 0.3s ease;
      }
    }

    .header-actions {
      i {
        font-size: 1.25rem;
        cursor: pointer;
        transition: all 0.2s ease;
        opacity: 0.8;

        &:hover {
          opacity: 1;
          transform: scale(1.1);
          color: var(--accent-color);
        }
      }
    }
  }

  form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .dialog-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;

    .form-group {
      margin-bottom: 1rem;
      width: 100%;

      label {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
        color: #aaa;

        .required {
          color: #ff4444;
          margin-left: 4px;
        }
      }

      input[type="text"],
      input[type="number"],
      select,
      textarea {
        width: 100%;
        background-color: var(--color-nodes-input-bg);
        border: 1px solid var(--color-divider-subtle);
        border-radius: 6px;
        padding: 0.5rem 0.75rem;
        color: #fff;
        font-size: 0.875rem;
        outline: none;
        transition: border-color 0.2s ease;

        &:focus {
          border-color: var(--accent-color);
        }

        &::placeholder {
          color: rgba(255, 255, 255, 0.3);
        }
      }

      textarea {
        resize: vertical;
        min-height: 80px;
      }

      // Name with icon styling
      &.name-with-icon {
        .input-with-icon {
          display: flex;
          align-items: center;
          background-color: var(--color-nodes-input-bg);
          border: 1px solid var(--color-divider-subtle);
          border-radius: 6px;
          padding: 0.125rem 0.35rem;

          &:focus-within {
            border-color: var(--accent-color);
          }

          input {
            background-color: transparent;
            border: none;
            flex: 1;
            padding: 0.375rem 0.75rem;

            &:focus {
              border: none;
              background-color: transparent;
            }
          }
        }
      }

      .toggle-settings {
        background: transparent;
        border: none;
        color: var(--accent-color);
        font-weight: 500;
        cursor: pointer;
        text-align: left;
        padding: 0;
        font-size: 0.875rem;
        transition: color 0.2s ease;

        &:hover {
          text-decoration: underline;
        }
      }
    }

    .hierarchical-settings {
      margin-bottom: 1rem;
      padding: 1rem;
      border: 1px solid var(--color-divider-subtle);
      border-radius: 6px;
      background-color: rgba(255, 255, 255, 0.02);

      .info-message {
        font-size: 0.8125rem;
        color: #aaa;
        margin-bottom: 1rem;
        font-style: italic;
      }

      .form-group {
        margin-bottom: 1rem;

        &:last-child {
          margin-bottom: 0;
        }
      }
    }

    .advanced-settings {
      .toggle-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        margin-bottom: 1rem;

        .toggle-field {
          .toggle-label {
            font-size: 0.875rem;
            color: #aaa;
            margin-bottom: 0.5rem;
            display: block;
          }
        }
      }
    }
  }

  .actions {
    padding: 1rem;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-shrink: 0;

    button {
      padding: 0.5rem 1rem;
      border: none;
      border-radius: 6px;
      font-size: 0.875rem;
      cursor: pointer;
      transition: background-color 0.3s ease;

      &:first-of-type {
        background: transparent;
        color: #ccc;
        border: 1px solid #333;

        &:hover {
          background: #333;
          color: #fff;
        }
      }

      &:last-of-type {
        background-color: var(--accent-color);
        color: #202020;

        &:hover:enabled {
          filter: brightness(1.1);
        }

        &:disabled {
          background-color: #666;
          opacity: 0.5;
          cursor: not-allowed;
        }
      }
    }
  }
}

// Deep styles for child components
:host ::ng-deep {
  app-form-slider {
    .slider-container {
      margin-bottom: 0;
    }
  }

  app-llm-selector {
    select,
    input {
      background-color: var(--color-nodes-input-bg) !important;
      border: 1px solid var(--color-divider-subtle) !important;
      color: #fff !important;
    }
  }

  app-toggle-switch {
    .toggle-switch {
      background-color: var(--color-nodes-input-bg);
      border: 1px solid var(--color-divider-subtle);
    }
  }

  app-icon-picker {
    .icon-picker {
      background-color: var(--color-nodes-input-bg);
      border: 1px solid var(--color-divider-subtle);
    }
  }

  app-process-selector {
    .process-selector {
      background-color: var(--color-nodes-input-bg);
      border: 1px solid var(--color-divider-subtle);
    }
  }
}
