<template>
  <div class="driver-card" :style="{ background: color }">
    <img :src="image" alt="driver photo">
    <div class="driver-info">
      <h2>{{ name }}</h2>
      <p>{{ team }}</p>
      <p>{{ nation }}</p>
      <p><span style="font-weight: bolder;">#</span>{{ num }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
interface props {
  name: string;
  nation: string;
  team: string;
  num: number;
  image: string;
  color: string;
}

defineProps<props>()
</script>

<style lang="scss" scoped>
.driver-card {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  max-height: 200px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.driver-card:hover {
  transform: scale(1.025);
}

.driver-card img {
  height: 500px;
  margin-top: 300px;
  margin-right: 50px;
}

.driver-info {
  padding-left: 100px;
  margin: 0;
  color: #fff;
}

.driver-info h2 {
  font-size: 30px;
}

.driver-info p {
  font-size: 20px;
  margin-top: -20px;
}

.driver-info p:nth-of-type(3) {
  margin-top: 20px;
  font-size: 30px;
  font-weight: bold;
}
</style>