/*_________________ General style settings___________ */

*{
    margin:0;
    padding:0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --second: #1B4332;
    --second-highlight: #23513e;
    --third-highlight: #ebad66;
    --third: #DDA15E;
    --primary: #F8F5F0;
    --container-bg: hsl(0, 0%, 98%);
    --header-text: hsl(155, 43%, 18%);
    --body-text: hsl(155, 43%, 18%,0.83);
    --sub-text: hsl(155, 43%, 18%,0.5);
    --nav-text: #F8F5F0;
    --accent: #3A86FF;
}

body {
    height:100%;
    background-color: var(--primary);
    font-family:Arial, Helvetica, sans-serif;
    color: var(--body-text);
    margin-top: min(15vw,5rem);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* full viewport height */
}

.content{
    flex: 1;  /* this pushes footer to the bottom if content is short */
}

p {
    margin-top: 0;
    margin-bottom: 30px;
}

/* navigation bar on top */

nav {
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    align-items: center;
    background-color: var(--second);
    box-shadow: 0px 5px 5px rgba(0,0,0,0.01);
    z-index: 100;

}

nav ul {
    width: 100%;
    list-style: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

nav li {
    height: 50px;
    font-weight: bold;
}

nav a{
    height: 100%;
    padding: 0 30px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-text);
}

nav a:hover{
    background-color:var(--second-highlight); 
    transition: 100ms;
    box-shadow: inset 2px 2px 3px rgba(0,0,0,0.1);
}


nav li:first-child{
    margin-right: auto;
}


/* navigation on side (for mobile) */
.sidebar{
    position: fixed;
    top: 0px;
    right: 0;
    width: 250px;
    z-index: 999;
    background-color: var(--second);
    transform: translateX(100%); /* start off-screen to the right */
    transition: transform 0.3s ease-in-out; /* smooth animation */
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-bottom-left-radius: 0.5rem;
}

.sidebar.show {
    transform: translateX(0); /* slide in */
    box-shadow: 0px 0.2rem 0.75rem rgba(0,0,0,0.5);

}

.sidebar li{
    width: 100%;
}

.sidebar a{
    width: 100%;
    padding: 0 0;

}

.sidebar .close-icon-button{
    width: 100%;
    display: flex;}

.sidebar .close-icon-button img{
    margin-left: auto;  /* push to the right */
    padding: 10px 20px; /* optional padding for click area */
    cursor: pointer;    /* makes it clear it's clickable */
    transition: background 0.2s; /* optional hover transition */}

.sidebar .close-icon-button img:hover {
    background-color: var(--second-highlight);     
    transition: 200ms;
    box-shadow: inset 2px 2px 3px rgba(0,0,0,0.1);

}

.menu-button{
    display: none;
}

body.menu-open .content { 
    filter: blur(10px);
}

/* buttons, hyperlinks and highlight styles */
.highlight{
    color: var(--third);
    font-weight: bold;
}

.hyperlink{
    color: var(--accent);
    text-decoration: none;
}

.hyperlink:hover{
    text-decoration: underline;
}

.buttons{
    text-align: left;
}

.cta-blue,
.cta-blue2 {
    display: inline-block;
    color: var(--accent);
    border-style: solid;
    border-width: 0.15rem;
    border-color: var(--accent);
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s;
    font-size: smaller;
    margin-left: 20px;
    background-color: var(--primary);
    cursor: pointer;    /* makes it clear it's clickable */
}

.cta-blue:hover,
.cta-blue2:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;  /* 👈 change 0.6s to whatever you want */
    box-shadow: 0 0 0.3rem var(--accent);

}

.cta-blue2 {
    color: white;
    background-color: var(--accent);
    margin-left: 0px;
    padding: 0.75rem 1.5rem;
}

/* footer */
.footer{
    margin-top:80px;padding:1rem;background:var(--second);color:var(--nav-text);text-align:center;font-size:0.7rem;
}

/* headers */

.h1-parent{
    display: flex;
    flex-direction: row;
    justify-content: center;
}

h1 {
    font-size: clamp(20px,8vw,70px);
    text-align: center;
    color: var(--header-text);
    display: block;
    background-color: var(--primary);
    padding: 20px;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: min(4vw,2rem);
    position: relative;
    max-width: fit-content;
}

h1::after{
    content: "";
    background: var(--third);
    height: 5px;
    width: 100%;
    position: absolute;
    bottom: 0;
    right: 0;
    box-shadow: 0px 3px 5px rgba(0,0,0,0.05);
    border-radius: 1rem;

}



/*_________________ Site specific settings___________ */



h3{
    text-align: center;
    color: var(--header-text);
    display: block; 
    padding-bottom: 10px;
}

h2{
    margin-top: 50px;
    margin-bottom: 10px;
    text-align: center;
}


#recipeForm{
    justify-self: center;
    align-items: center;     /* vertically align label + input */
    width: 90%;            /* default width on small screens */
    max-width: 600px;      /* never wider than 600px even on huge screens */
    min-width: 300px;      /* never too narrow */
    /* background-color: white; */
    background-color: var(--primary);
    margin-bottom: 1rem;
}


  .inforow {
    display: flex;           /* side-by-side layout */
    align-items: center;     /* vertically align label + input */
    justify-content: flex-start;

    margin: 10px auto;       /* center horizontally with top/bottom spacing */
    padding: 0 20px;         /* 20px padding on left/right */
    box-sizing: border-box;  /* padding included in width */
  }

  .inforow label {
    width: 40%;             /* label takes 40% of the row */
    text-align: left;       /* left-align label text */
    font-weight: bold;
    margin-right: 10px;     /* spacing between label and input */
    color: var(--body-text);

  }

  .inforow input {
    width: 60%;             /* input takes remaining 60% */
    padding: 5px;           /* inner padding for text box */
    box-sizing: border-box;
  }
  
  #ingredients {
    display: flex;
    flex-direction: column;   /* stack ingredient rows vertically */
    align-items: center;      /* center rows horizontally */
    margin: 10px auto;        /* center horizontally with spacing */
    padding: 0 20px;          /* 20px padding on sides */
    box-sizing: border-box;
  }

  #instructions {
    display: flex;
    flex-direction: column;   /* stack ingredient rows vertically */
    align-items: center;      /* center rows horizontally */
    margin: 10px auto;        /* center horizontally with spacing */
    padding: 0 20px;          /* 20px padding on sides */
    box-sizing: border-box;
  }



hr {
  border: none;           /* remove default border */
  height: 1px;            /* thickness */
  background-color: var(--third); /* color */
  margin: 20px 0px;         /* spacing above/below */
}

.jsonbuttonparent{
    text-align: center;
}



  .addbutton:hover, .jsonbutton:hover {
    /* #background-color:#d9feae; */
    transition: 200ms;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transform: scale(1.1);


    /* box-shadow: inset 5px 5px 3px rgba(0,0,0,0.15); */
}



  /* Each ingredient row */
  .ingredient {
    display: flex;
    gap: 5px;                 /* spacing between inputs */
    margin-bottom: 5px;
    flex-wrap: nowrap;         /* always stay in one row */
    width: 100%;               /* take full width of container */
    box-sizing: border-box;
  }

  /* Name input grows to fill remaining space */
  .ingredient .ing-name {
    flex: 1 1 auto;
    min-width: 50px;
    padding: 5px;
    box-sizing: border-box;
  }

  /* Amount and Unit have reasonable widths but shrink if needed */
  .ingredient .ing-amount {
    flex: 0 1 70px;
    min-width: 40px;
    padding: 5px;
    box-sizing: border-box;
  }

  .ingredient .ing-unit {
    flex: 0 1 80px;
    min-width: 40px;
    padding: 5px;
    box-sizing: border-box;
  }

  /* Remove button fixed size */
  .ingredient button,
  .step button {
    background-color: var(--primary);
    border-style: none;
    cursor: pointer; 
    margin-left: 0.2rem;
}

  .ingredient button:hover,
  .step button:hover {
    transform: scale(1.2);
    transition: all 0.2s ease;  
}










  /* Each ingredient row */
  .step {
    display: flex;
    gap: 5px;                 /* spacing between inputs */
    margin-bottom: 5px;
    flex-wrap: nowrap;         /* always stay in one row */
    width: 100%;               /* take full width of container */
    box-sizing: border-box;
  }

  /* Name input grows to fill remaining space */
  .step .step-text {
    flex: 1 1 auto;
    min-width: 50px;
    height: 30px;
    padding: 5px;
    box-sizing: border-box;
  }

  /* Amount and Unit have reasonable widths but shrink if needed */
  .step .ing-amount {
    flex: 0 1 70px;
    min-width: 40px;
    padding: 5px;
    box-sizing: border-box;
  }

  .step .ing-unit {
    flex: 0 1 80px;
    min-width: 40px;
    padding: 5px;
    box-sizing: border-box;
  }


.ing-name,
.ing-amount,
.ing-unit,
.step-text,
.inforow input{
    background-color: var(--container-bg);
    border-style: SOLID;
    border-width: 1px;
    color: var(--body-text);
}

/* _________________ dark mode settings_________________ */

@media (prefers-color-scheme: dark) {
  :root {
    --primary: hsl(120, 0%, 12%);             /* main background */
    --second: #2c2c2c;              /* nav bar / sections monochrome */
    --second-highlight: #3a3a3a;    /* hover / active */
    --third: #DDB571;               /* buttons / highlights */
    --third-highlight: #F0C27A;     /* button hover */
    
    --header-text: hsl(0, 0%, 92%);                /* main text */
    --container-bg: hsl(0, 0%, 17%);

    --body-text: hsl(0, 0%, 80%,0.83);                /* main text */
    --sub-text: hsl(0, 0%, 80%,0.5);                /* main text */

    --nav-text: #EAEAEA;            /* nav text */
    --accent: #5AAEFF;              /* interactive accent */
  }
  .ingredient button,
  .step button{
    color: var(--nav-text);
  }
.ing-name,
.ing-amount,
.ing-unit,
.step-text,
.inforow input{
    background-color: var(--container-bg);
    border-style: SOLID;
    border-width: 1px;
    color: var(--body-text);
    border-color: hsl(0, 0%, 25%);
}
}




@media(max-width: 800px){
    .hideOnMobile{
        display: none;
    }
    .menu-button{
        display: block;
    }
    .sidebar{
        width:100%;
        border-radius: 0;
    }
}

@media(max-width: 400px) {
    .sidebar{
        width:100%;
        border-radius: 0;
    }
}


