:root {
    --popup-color: rgb(117, 163, 231);
    --popup-error: rgb(240, 98, 98);
    --nav-backround:#333;
    --body-background: #ddd;
    --button-color: rgb(47, 130, 253);
    --button-hover: rgb(87, 154, 255);;
}


html,
body {
    background-color: var(--body-background);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
    height: auto;
}

* {
    box-sizing: border-box;
}


h1 {
    margin: 0;
    margin-top: 0.3em;  
}


#nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2rem;
    padding: 0 1rem;
    background-color: var(--nav-backround);
    color: white;
}

#nav a {
    flex: 1;
    color: inherit;
    text-decoration: none;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

#site-name {
    font-size: 2rem;
}

#nav #nav-items {
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
    list-style: none;
    flex: 1;
}

#nav #nav-items a {
    justify-content: center;
    text-align: center;
    width: 10rem;
    justify-self: center;
    align-self: center;
}

#nav-items.hidden {
    display: none !important;
}

#nav li.active {
    background-color: #555;
}

#nav li:hover {
    background-color: #777;
}

#nav-profile {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

#nav-profile.hidden {
    display: none;
}

#profile {
    all: unset;
    height: 2rem;
    width: 2rem;
    border-radius: 50%;
}

#profile:hover {
    cursor: pointer;
}

#profile-pic:active {
    outline: 1px solid rgb(0, 174, 255);
}

#profile-pic {
    height: 2rem;
    width: 2rem;
    border-radius: 50%;
}

#profile-expand {
    display: none;
    padding: 0.3em;
    flex-direction: column;
    justify-content: space-between;
    color: black;
    position: absolute;
    top: 4em;
    right: 5px;
    width: 10em;
    height: 10em;
    background-color: white;
}

#profile-expand.visible {
    display: flex;
}

#profile-expand p {
    margin: 0;
}

#profile-username span {
    font-weight: bold;
}

#view {
    margin-left: 2.5em;
    margin-right: 2.5em;
}

#popup {
    display: none; 
    position: fixed;
    z-index: 1; /* Sit on top */
    padding-top: 200px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    background-color: rgb(0, 0, 0); /* Fallback color */
    background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
}
#popup #content {
    position: relative;
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    width: 25em;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    border-radius: 10px !important;
    overflow: hidden;
}

#popup #close {
    color: white;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

#popup #close:hover,
#popup #close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}
#popup #header {
    padding: 2px 16px;
    background-color: var(--popup-color);
    color: white;
}
#popup #body {
    padding: 2px 16px;
}
#popup.visible {
    display: block;
}

#popup.error #header {
    background-color: var(--popup-error);
}

#wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}


#form-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50%;
    margin-top: 4em;
    border: 1px solid black;
    border-radius: 5px;
    padding: 1em;
    min-width: 275px;
}

#user-form {
    display: flex;
    flex-direction: column;
    width: 70%;
}

#user-form button[type=submit]{
    margin: .5em;
    padding: 0.35em 1.2em 0.35em 1.2em;
    border: 1px solid black;
    background-color: var(--button-color);
    color: white;
    text-align: center;
    align-self: center;
    border-radius: 5px;
}

#user-form button[type=submit]:hover{
    background-color: var(--button-hover);
    cursor: pointer;
}

#user-form button[type=submit]:active{
    border: 1px solid white;

}


#info {
    align-self: flex-start;
    font-size: small;
    color: black;
}

#info.error {
    color: red;
}

#sales,
#shop,
#garage {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2em;
    margin-top: 1em;
}


.car-card {
    width: 20em;
    border: 1px solid black;
    border-radius: 5px;
    text-transform: capitalize;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.car-card div {
    margin-left: 0.7em;
    margin-right: 0.7em;
    margin-bottom: 0.7em;
}

.car-card img {
    width: 100%;
    max-height: 12em;
    object-fit: cover;
    overflow: hidden;
}
.car-card .car-name {
    font-weight: bold;
}

.car-card .car-owner {
    text-transform: none;
}

.car-card button {
    all: unset;
    padding: 0.35em 0.8em 0.35em 0.8em;
    width: 4em;
    border: 1px solid black;
    background-color: var(--button-color);
    color: white;
    text-align: center;
    align-self: center;
    border-radius: 5px;
}
.car-card button:hover {
    background-color: var(--button-hover);
    cursor: pointer;
}

.car-card button:active {
    border: 1px solid white;
}


.car-card div p span {
    font-weight: bold;
}



.car-card button:disabled {
    background-color: rgb(121, 190, 255);
    border-color: #4e4e4e;
}

.car-card .car-input-price {
    width: 10em;
}

