/* ======================== */
/* COMMON STYLES - All Pages */
/* ======================== */

body {
    background-color: #2e313a;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    height: 100vh;
    font-family: Arial, sans-serif;
}

form {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 450px;
    display: grid;
    gap: 20px;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.star {
    color: red;
}

.input-error {
    border: 2px solid red !important;
}

input[type="text"],
input[type="file"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}

input[type="submit"],
button {
    padding: 12px 20px;
    background-color: #656598;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 105px;
    font-size: 15px;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover,
button:hover {
    background-color: #000000;
}

a {
    color: #7474a3;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #000000;
}

a>button {
    width: 100%;
}

/* ======================== */
/* LOGIN PAGE STYLES        */
/* ======================== */

.container_login {
    display: grid;
    place-items: center;
    width: 100%;
}

.login {
    display: grid;
    gap: 20px;
}

.submit_login {
    display: grid;
    justify-content: center;
}

.p_login {
    text-align: center;
}

.p_login a {
    color: red;
}

/* ======================== */
/* SIGNUP PAGE STYLES       */
/* ======================== */

.container_signup {
    display: grid;
    place-items: center;
    width: 100%;
}

.singup {
    display: grid;
    gap: 20px;
}

.submit_signup {
    display: grid;
    justify-content: center;
}

.p_signup {
    text-align: center;
}

.p_signup a {
    color: red;
}

/* ================================ */
/* CREATE RECIPE PAGE STYLES       */
/* ================================ */

.container_create_recipe {
    display: grid;
    place-items: center;
    width: 100%;
}

.create_recipe {
    display: grid;
    gap: 20px;
}

.create_recipe h3 {
    margin-bottom: 10px;
    text-align: center;
}

.input-with-counter {
    position: relative;
    display: inline-block;
    width: 100%;
}

.input-with-counter input {
    width: 100%;
    padding-right: 90px;
    box-sizing: border-box;
}

.char-counter-inside {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.75em;
    color: rgb(113, 113, 113);
    pointer-events: none;
    background-color: white;
    padding-left: 4px;
}

.submit_create {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  gap: 16px;
  width: 100%;
}

.form-button {
    width: 160px;
    padding: 12px 30px;
    background-color: #625e99;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    box-sizing: border-box;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.form-button:hover,
.form-button:focus {
    background-color: #000;
    transform: translateY(-2px);
}

.form-button:active {
    background-color: #000;
    transform: translateY(-1px);
}




/* ================================ */
/* MANAGE RECIPE PAGE STYLES       */
/* ================================ */

.container_manage_recipe {
    display: grid;
    place-items: center;
    width: 100%;
}

.manage_recipe {
    display: grid;
    gap: 15px;
}

.manage_recipe h2,
.manage_recipe h4 {
    text-align: center;
    margin: 0;
}

.manage_recipe .user {
    display: grid;
    grid-template-columns: 0.9fr auto;
    justify-content: space-between;
    align-items: center;
}

.submit_allow,
.sumbit_cancel {
    text-align: center;
    margin: 0 10px;
}

/* ============================ */
/* RECIPE LIST PAGE STYLES     */
/* ============================ */

.container_recipe_list {
    width: 96%;
    display: grid;
    gap: 30px;
    padding: 20px;
    height: 95%;
    grid-template-rows: auto 1fr auto;
}

.container_recipe_list .header {
    display: grid;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
    gap: 20px;
    grid-template-columns: 9fr 1fr;
}

.container_recipe_list .header .recipe_description {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.logout_icon img {
    height: 20px;
    width: 20px;
    vertical-align: middle;
}

.container_recipe_list .user_name {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    gap: 2px;
}

.user_icon {
    font-size: 18px;
    line-height: 1;
}

.user_text {
    font-size: 16px;
}


.container_recipe_list .body {
    background-color: #fff;
    padding: 20px;
    gap: 30px;
    border-radius: 8px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
}

.my_recipe,
.shared_recipe {
    display: grid;
}

.my_recipe .recipe_notes,
.shared_recipe .recipe_notes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    max-width: 95%;
    gap: 20px;
}

.my_recipe .recipe_card,
.shared_recipe .recipe_card {
    background-color: #ffffff;
    border: 1px solid black;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
    display: grid;
    gap: 10px;
    margin: 5px;
    width: 260px;
    justify-self: center;
}

.recipe_card:hover {
    transform: scale(1.05);
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.578);
    transition: all 0.5s ease;
}

.recipe_title {
    display: grid;
    grid-template-columns: auto auto;
}

.recipe_info {
    justify-items: end;
}

.recipe_info p {
    margin: 2px 0;
    font-size: 10px;
    color: #555;
}

.recipe_text {
    font-size: 12px;
    color: #333;
}

.button {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: space-evenly;
    gap: 10px;
}

.submit_create_recipe {
    padding: 20px 20px;
    background-color: #101010;
    color: white;
    border-radius: 10px;
    width: fit-content;
    position: fixed;
    bottom: 40px;
    margin: 10px 20px;
    right: 45px;
    float: right;
    cursor: pointer;
    box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.5);
    transition: all 0.5s ease;
}

.submit_create_recipe:hover {
    background-color: #292929;
    transform: scale(1.05);
    box-shadow: 8px 10px 30px rgba(0, 0, 0, 0.4);
}

/* ============================ */
/* VIEW RECIPE PAGE STYLES     */
/* ============================ */

.container_view_recipe {
    width: 96%;
    gap: 30px;
    padding: 20px;
    height: 95%;
}

.container_view_recipe .header {
    display: grid;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 15px 20px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
    grid-template-columns: 9fr 1fr;
    gap: 20px;
}

.container_view_recipe .header .recipe_description {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.container_view_recipe .body {
    display: grid;
    grid-template-columns: 1fr 4fr;
    gap: 15px;
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
}

.container_view_recipe .body .left {
    background-color: #ffffff;
    margin: 10px;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgb(89, 82, 170);
    max-width: 260px;
}

.container_view_recipe .body .left h2 {
    margin-top: 0;
    border-bottom: 1px solid #000000;
    padding-bottom: 5px;
}

.container_view_recipe .body .left p {
    margin: 10px 0;
}

.container_view_recipe .body .left a {
    cursor: pointer;
}

.container_view_recipe .body .right {
    display: grid;
    background-color: #ffffff;
    padding: 15px;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
    gap: 10px;
}

.container_view_recipe .body .right .recipe_header {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: auto auto;
}

.container_view_recipe .body .right .recipe_header .recipe_description {
    justify-items: end;
}

.container_view_recipe .body .right .recipe_header .recipe_description p {
    font-size: 10px;
}

.container_view_recipe .body .right .recipe_body {
    gap: 15px;
}

.container_view_recipe .body .right .recipe_card {
    background-color: #fff;
    margin: 15px;
    padding: 15px;
    border-left: 5px solid #454444;
    border-radius: 6px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
}

.container_view_recipe .body .recipe_card p {
    margin: 5px 0;
}

.recipe_content p {
    color: #333;
    font-size: 14px;
}

.logout_icon img {
    height: 20px;
    width: 20px;
    vertical-align: middle;
}

.container_view_recipe .user_name {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    gap: 2px;
}

.user_icon {
    font-size: 18px;
    line-height: 1;
}

.user_text {
    font-size: 16px;
}
.add_recipe_note {
  width: 100%;
  display: block;
  margin-top: 20px;
}

.add_recipe_note label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}


.note_input_grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  width: 100%;
}


.input-with-counter {
  position: relative;
  width: 100%;
}

.input-with-counter input {
  width: 100%;
  padding: 10px;
  padding-right: 90px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}


.char-counter-inside {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.75em;
  color: #555;
  background-color: white;
  pointer-events: none;
}

.char-counter-inside.limit-exceeded {
  color: red;
}

.add_note_button {
  padding: 10px 20px;
  background-color: #5b5e95;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: background-color 0.3s ease-in-out;
  height: 100%;
}

.add_note_button:hover {
  background-color: #000;
}


/* ============================ */
/* js classes                   */
/* ============================ */

input[type="text"].invalid,
input[type="email"].invalid,
input[type="password"].invalid {
  border: 2px solid red;
  outline: none;
}


.error-text {
    color: red;
    font-size: 14px;
    margin-top: 5px;                             
}

.hidden {
    display: none;
}

.limit-exceeded {
    color: red;
    font-weight: bold;
}

#error-addnote {
  color: red;
  font-size: 14px;
  margin-top: 10px;
}
