@import url("https://fonts.googleapis.com/css2?family=Poppins");
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.2/font/bootstrap-icons.css");

:root {
    --box-shadow: rgba(16, 9, 9, 0.946) 0px 2px 5px;

    --background-color-page: #223046;
    --netflix: #e50914;
    --youtube: #ff0000;
    --prime: #00a8e1;
    --crunchyroll: #f47521;
    --other: rgb(151, 153, 140);
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    list-style: none;
    transition: all .3s ease;
}

/* body & theme color */
#theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--white);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all .3s ease;
}

#theme-toggle:hover {
    background: #2666CF;
    color: var(--white);
    transform: rotate(20deg);
}

body.dark-mode {
    background-color: #121212;
    color: #e2e2e2;
}

body.dark-mode .card {
    background-color: #1f1f1f;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.05);
}

body.dark-mode .create {
    background: #2a2a2a;
}

body.dark-mode .add input,
body.dark-mode .add select, body.dark-mode .bookmark span {
    background-color: #2a2a2a;
    border-color: #444;
    color: var(--white);
}

body.dark-mode .add input[type="submit"] {
    background-color: #4e4e4e;
}

body.dark-mode #theme-toggle {
    background: #333;
    color: var(--white);
}

body.dark-mode #theme-toggle:hover {
    background: gold;
    color: #333;
}

body.dark-mode .card .sub-information i {
    color: var(--white);
}

/* Wrap */
.outer-wrap {
    width: 100%;
    min-height: 100vh;
    background-color: var(--background-color-page);
    padding: 30px;
}

.inner-wrap {
    max-width: 1200px;
    margin: auto;
}

/* heading */
.heading {
    margin: 30px auto;
}

.heading .title {
    font-size: 30px;
    color: var(--white);
    font-weight: 800;
    text-align: center;
}

.heading .subtitle {
    font-size: 20px;
    color: var(--white);
    font-weight: 500;
    text-align: center;
}

/* section create */
.create {
    background-color: var(--white);
    padding: 20px;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
}

.create .add {
    display: flex;
    /* justify-content: space-between; */
    flex-wrap: wrap;
    gap: 20px;
}

.create .add input#link {
    flex-grow: 1;
}

.create form input, .create form select {
    font-size: 18px;
    border-radius: 7px;
    border: 1px solid #d1d1d1;
    padding: 10px;
} 

.create form option {
    font-size: 15px;
}

.create form.add input#bookmark {
    border: 0px;
    border-radius: 3px;
    background-color: #2666CF;
    color: var(--white);
    padding: 10px 20px;
}

.create form.add input#bookmark:hover {
    background-color: rgb(20, 67, 138);
    cursor: pointer;
}

.create #search, .create input#search {
    width: 100%;
    margin-top: 15px;
    font-size: 18px;
    padding: 10px;
    border-radius: 7px;
    border: 1px solid #d1d1d1;
}

.create input#bookmark[value="Update"] {
    background-color: #FFA500;
}


input:focus, select:focus {
    outline: 2px solid #2666CF;
    outline-offset: 2px;
}

/* section category */
.category-list {
    margin: 40px 0px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.category-list span {
    padding: 10px;
    border-radius: 3px;
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    cursor: pointer;
    margin: 5px;
}

.category-list span:hover {
    background-color: #cdcfd9;
}

.category-list .active {
    background-color: #2666CF !important;
    color: var(--white);
}

.category-list span.active {
    background-color: #2666CF;
    color: var(--white);
    transform: scale(1.05);
}

/* section Cards */
.cards {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 10px;
    margin: 25px 0px;
}

.card {
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    padding: 10px;
    border-radius: 5px;
    width: 350px;
    margin: 7px 0px;
    transition: transform .3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background-color: #e1e3e9;
}

.card .sub-information {
    display: flex;
    margin-top: 10px;
    cursor: pointer;
}

.card .sub-information p {
    flex-grow: 1;
}

.card .sub-information .category {
    background-color: #2666CF;
    border-radius: 3px;
    padding: 3.5px 7px;
    color: var(--white);
}

.card .sub-information .category.netflix {
    background-color: var(--netflix);
}

.card .sub-information .category.youtube {
    background-color: var(--youtube);
}

.card .sub-information .category.prime {
    background-color: var(--prime);
}

.card .sub-information .category.crunchyroll {
    background-color: var(--crunchyroll);
}

.card .sub-information .category.other {
    background-color: var(--other);
}

.card .sub-information i {
    margin: 5px;
    font-size: 18px;
}

.card .sub-information i:hover {
  transform: scale(1.2);
}

.card .sub-information .website {
    color: #393e46;
}

.card .sub-information .search {
    color: #2666CF;
}

.card .sub-information .delete {
    color: #5a2a31;
    cursor: pointer;
}

.card .sub-information .edit {
    color: #da1208;
    cursor: pointer;
}

/* media tag */
@media (max-width: 800px) {
    .create .add {
        flex-direction: column;
    }

    .card {
        flex-grow: 1;
    }
}

@media (max-width: 500px) {
    .card {
        width: 100%;
    }

    .create form input, .create form select {
        font-size: 16px;
    }
}

/* Keyframe */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp .4s ease forwards;
    transition: transform .3s ease, box-shadow .3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
}

/* plus spécifique : cible direct par id + classe */
#bookmark.update,
.add input[type="submit"].update {
    background-color: #ff9f43 !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(255, 159, 67, 0.5);
    transform: translateZ(0);
}

/* hover pour le mode update */
#bookmark.update:hover,
.add input[type="submit"].update:hover {
    background-color: #ff7f00 !important;
    transform: scale(1.05);
}