body {
    font-family: Arial, sans-serif;
    margin: 30px;
    background-color: white;
}

h1 {
    text-align: center;
}

div {
    width: 200px;
    height: 60px;
    margin: 30px;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}


/* =========================
   1. TRANSITIONS
   ========================= */

/* Transition 1 - Border */
.transition1 {
    background-color: lightgray;
    border: 3px solid transparent;
    transition: border 1s;
}

.transition1:hover {
    border: 3px solid black;
}


/* Transition 2 - Size */
.transition2 {
    background-color: lightblue;
    transition: width 1s, height 1s;
}

.transition2:hover {
    width: 300px;
    height: 100px;
}


/* Transition 3 - Color and text size */
.transition3 {
    background-color: lightgreen;
    font-size: 16px;
    transition: background-color 1s, font-size 1s;
}

.transition3:hover {
    background-color: orange;
    font-size: 24px;
}


/* =========================
   2. TIMED ANIMATIONS
   ========================= */

/* Animation 1 - Starts automatically */
.animation1 {
    background-color: pink;
    position: relative;

    animation-name: moveBox;
    animation-duration: 4s;
    animation-iteration-count: infinite;
}

@keyframes moveBox {
    0% {
        left: 0px;
    }

    50% {
        left: 300px;
    }

    100% {
        left: 0px;
    }
}


/* Animation 2 - Starts when hovered */
.animation2 {
    background-color: lightyellow;
}

.animation2:hover {
    animation-name: spinBox;
    animation-duration: 2s;
    animation-iteration-count: 2;
}

@keyframes spinBox {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* =========================
   3. GRADIENT BACKGROUND
   ========================= */

.gradient {
    background: linear-gradient(to right, blue, purple);
    color: white;
}