:root {
    --primary-color: #185a85;
    --secondary-color: #ef8f00;
    --danger-color: #ea1717;
    --background-color: #f5fbfe;
    --border-color: #cfcfcf;
    --plus-jakarta-sans: 'Plus Jakarta Sans', sans-serif;
}

* {
    font-family: var(--plus-jakarta-sans);
}

body {
    background: var(--background-color);
}

button {
    cursor: pointer;
    font-size: initial;
    font-weight: bold;

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

    &:active {
        transform: scale(0.95);
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: initial;
}

input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: initial;

    &:focus {
        border: 1px solid var(--primary-color);
        outline: none;
    }
}

.container {
    padding: 2rem;
}

#title {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #ffffff44;
    backdrop-filter: blur(12px);
}

#createContactButton {
    padding: 0.5rem 1rem;
    font-size: x-large;
    border: none;
    border-bottom: 2px solid #000000;
    border-radius: 8px;
    background: var(--primary-color);
    color: #ffffff;
}

#contactList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    word-break: break-all;
}

#updateContact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--secondary-color);
    color: #ffffff;
}

#deleteContact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background-color: transparent;
    border: 1px solid var(--danger-color) !important;
    color: var(--danger-color);
}

.info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #ffffff;

    & .actions {
        display: flex;
        justify-content: center;
        gap: 0.75rem;

        & button {
            width: 100%;
            border: none;
            padding: 0.5rem;
            border-radius: 8px;
        }
    }
}

.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    width: 100%;
    height: 100%;
    background: #00000080;
    backdrop-filter: blur(4px);

    &.hidden {
        display: none;
    }
}

.modal-content {
    width: 80vw;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 16px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1rem;

    & button[type="submit"] {
        padding: 0.7rem;
        border: none;
        border-radius: 8px;
        background: var(--primary-color);
        color: #ffffff;
    }
}

#contactForm {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.close-button {
    display: block;
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    font-size: x-large;
    border: 1px solid #000000;
    border-radius: 8px;
    background-color: transparent;
}

/* Tablet */
@media (768px <=width <=1024px) {
    #contactList {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */
@media (width < 768px) {
    .container {
        padding: 1rem;
    }

    #title {
        padding: 1rem;
    }

    #contactList {
        grid-template-columns: 1fr;
    }

    .card {
        & .actions {
            flex-direction: column;
        }
    }
}