/*
COLORS:

Light green: #7ed56f
Medium green: #55c57a
Dark green: #28b485

*/
/* this are the hex codes for the colours used in this project */

/*lets perform some basic reset- jonas calls it normalizing the css 
sometimes browser dont render css the way we wanted to 
so we simply tell it to reset everything so no faulty behaviour comes up */

/* we are using the universal selector * to apply to everything in the document 
*/

/*browsers basically have a default margin for heading and various such elements so we use 
the universal selector to reset it to the way we wanted it */

/*margin comes after the border and border comes after the padding and padding
comes after the content*/

/* what the heck is box sizing ? 
in html everything is inside a box 
so if we say border box 
it might mean that while measuring the total size of an element 
we are including the border too .. that means 
h1 might have a padding and border 
just like gadern takes up the space of the permises 
making the house look smaller 

jonas explained incorrectly because the box sizing for an element is content-box 
in default which only includes the content height and not the height padding and margin 
so the total size will increase if we add the margin and padding size

but here we made it to border box which means the total height of an element will include 
the height of padding and margin so if we define the width of any element 
and there are padding and margins defined as well the content has to become small 


*/

*{ 
    margin:0;
    padding:0;
    box-sizing: border-box;

}

/*now we are defining the font properties for all the elements and we will use 
the body element and not the universal selector because font is applied on the body of the page.

properties related to font are usually inherited (he will explain inheritance )
body is parent of every element inside it and childrens will inherit from their parent element 
*/

/*lato is from google font*/
/*font weight ? 400 ? for all the child elements ?*/



body{
    font-family: "lato", sans-serif; /* this will apply to all the text in webpage*/
    font-weight:400; /* normal font weight */
    font-size:16px;
    line-height: 1.7; /*1.7 times bigger than predefined*/ /* like each text is on a different line and each line which the text is on has a height */
    color : #777;
    padding:30px; /*here the paddding is not the case of inheritance and why did it make header element smaller ? because the padding had nowhere to show but inside. 
 */
}
/*we want nice green gradient over the element*/
.header{
    position: relative; /*relative means relative to original positioning of the element. original positioning is default- static and dependent on the document flow  */
    height: 95vh; /*height of the header will be 95% of viewport */
    background-image: linear-gradient(
        to right,
        rgba(126, 213, 111, 0.8),
        rgb(40, 180, 133,0.8)),
     url(/Natours/starter/img/hero.jpg);
     
     /*we put the linear gradient before the  background image (we put two colors inside it) and also defining the direction of colors, which can go to all the 8 directions(rb,lb,tr,tl(top,right,left,bottom))*/
    background-size:cover; /* it will always fit the element inside the viewport*/
    background-position: top; /*needs explanation*/
    clip-path:polygon(0 0, 100% 0, 100% 75vh,0 100%)

    
    /* failed - clip-path:polygon(0 0, 100% 0, 100% 200px, 0 350px)*/ /* this can actually make a triangle - clip-path: polygon(50% 0, 100% 100%,0 100%);
    now basically top left is (0,0) and bottom-right color is (100%,100%)     top-right is (100%,0)*/

}

.logo-box{
    position:absolute; /* it means it provides a fixed reference point which is indeed relative to the closest element */
    top:40px;
    left:40px; /*relative to header element*/



}

.logo{
    height:35px;
}


/* style for the header text */

.heading-primary{
    color:#fff; 
    text-transform:uppercase;

    backface-visibility:hidden; /* this will remove the animation errors */
    /* he says animations have backside as well so since the back side is not animated we have to remove visibility. fix the shaking   */

    margin-bottom:60px; /* well to create white space between button and text*/
}

/*how to make sub heading come under main heading ?
display both the headings as block level elements 
block level elements - characteristics - 1. take up entire width available 
2. create line breaks */

.main-heading{
    display:block;
    font-size:60px; /*larger*/
    font-weight:400; /*thinner*/
    letter-spacing: 35px;
    animation-name: moveToleft;
    animation-duration: 2s; /* you can also delay the animation with animation-delay property*/ /*animation-iteration-count:1,2,3 repeatation of the animation */
    animation-timing-function: ease-out;
    /* animation-timing-function could be ease in(slow to fast) and ease out(fast to slow) */
    /* cubic bezier function . custom timing function (0.1,0.4, 0.5) */
}
.sub-heading{
    display:block;
    font-size:20px;
    font-weight:700; /* this is available lato font (check link)*/
    letter-spacing:17.4px;
    animation-name:moveToRight;
    animation-duration:2s;
    animation-timing-function :ease-out;
    /* animation: moveInRight 1s ease-out */


}

/* now we will move the text-box inside of header element to center of the 
page and it has to responsive */

.text-box{
    position:absolute; /*if you define top 50% it will look at the start of header element and start after 50% of the header */
    top:40%;
    left:50%;
    transform:translate(-50%, -50%); /* now since it shifts to whole of 50% we wanna make the element's center touch 50%
    so to do that we shift the elements width to -50% of its own size . both horizontally and vertically */

    text-align:center/*we made button into inline-block element and it would be treated as text */


}



/* this is the animation formula that we created that we can use in other elements by just adding the name as the value . below is for main heading */
@keyframes moveToleft{
    0%{
        opacity:0;
        transform: translateX(-100px)   /* it will be horizontally(x) 100px to the left of its original position*/
    } 

    /* 20%{
        transform:rotate(120deg);
    }  this animation made the rotation slow because the animation started early. if you put define rotation at 90% it will end very quickly  */

    80%{
        transform:translatex(10px);  /* positively move towards x axis //this will make the animation go little bit more towards right then its original position . but will do a uturn and return back to original position */
    }

    /* 90%{
        transform:rotate(90deg);
    }  with this animation the rotation happened quickly in the last  */

    100%{
        opacity:1; /*make it fully visible*/
        transform:translate(0); /* this will make it go back to the original state */
    }
}

@keyframes moveToRight{
    0%{
        opacity:0;
        transform: translateX(100px) /* it will be horizontally(x) 100px to the left of its original position*/
    }

    80%{
        transform:translatex(-10px);  /* positively move towards x axis //this will make the animation go little bit more towards right then its original position . but will do a uturn and return back to original position */
    }

    100%{
        opacity:1; /*make it fully visible*/
        transform:translate(0); /* this will make it go back to the original state */
    }
/*you can add many transform properties in the same line */
}


/* .logo:hover {
    animation-name: logo; // moveToleft was not working so i created another keyframe for logof
    animation-duration: 2s;
}

@keyframes logo{
    0%{
        transform:translateX(-10px);
    }
    50%{
        transform:rotate(180deg);
    }
    100%{
        transform:translate(0)
    }
} */


/* :link is a pseudo class - it is a special state of an element, like when a user hovers over an element, //checkbox is clicked// summary -style for a special condition
pseudo class is also used to select the last child .. how ? */

/*here we want the animation of the link that has been already animated to be of the same styling as when it is clicked */
/*default link is blue in color and when clicked it becomes purple */
.btn:link,
.btn:visited { 
    text-transform:uppercase;
    text-decoration:none; /*links have lines below them it removes it */
    padding: 15px 40px;
    display: inline-block; /* this made the button shift downwards making a space for itself its not just that. without inline block the the button element padding and stuff will cover the whole heading and sub heading above it if it was large enough */
    /* it turns out that inline elements dont accept with and height they are introverts takes up less space */

    border-radius:100px; /*making the border radius of high pixel size will gurantee the same shape . its probably related to height and width of the element */

    transition: all .1s; /* since this is the initial state of the button it will apply the same transitions to all of the other special states . like hover transform will slow down */

    position:relative; /* this is the main state of the button and its gonna have a position right ? relative to the original postioning to the element , if we add top and left it will change relative to original positioning of the button element */


}

/* he said active state is related to button:link state and not hover state.*/


.btn:hover {

    transform:translateY(-3px); /* for y down is positive , for x right is positive*/ /* this will move up a little while cursor is on button */
    box-shadow: 0 10px 20px rgba(0,0,0,.2); /* shadow can only come in 3 directions here just */


}/* this is another pseudo class to select special state of element */

.btn-white{
    background-color: #fff;
    color:#777 /*grey 777*/
}

.btn:active{
    transform:translateY(-1px); /* so this is saying that once the button is clicked and active for a second it will go down a bit because y axis is minus */
    /* so during the hover button is already making the button go up by 3px.. but the active state will say but should go down 1 px from its original link state . so this will make the button shift down 4 px  */
    box-shadow: 0 5px 20px rgba(0,0,0,.2); /* when its active the shadow decreased to its away from user and deeper to screen visually*/
    
}



/* because button came down on the moment of clicking it and then box shadow decreased as its clicked it look actually realistic */
/* the last pixel of box shadow tells about bluriness or something */

/*here comes the super extra animation that we will do with the help of pseudo elements or something */

/* :after pseudo element -acts like a virtual element and then we can style that virtual element  */

/*so he is saying the virual element goes behind the element or something */
/*after pseudo element is treated as the child of button element here */
/* this is an element and not a state of element */
.btn::after{
    content:"";
    display:inline-block; /* we with inline- block we can change the height and width */ /* reasoning - button is also inline-block*/
    height:100%; /*100% of the width of the button */
    width: 100%;
    border-radius:100px;
    position:absolute; /*even though it is behind the element because of the positioning we can see its interjecting the actual element  refer -(after pseudo element confusion image)*/ 
    top:0; /*brings back to the orginal position of the button element */
    left:0; /*absolute positioning is gonna choose the first element with the relative positioning added to it .. relative is kinda like fixed   */
    z-index: -1;/*this will make sure this is behind the button */ /* as soon as i remove this it covered the whole button element because the position is all the same and shape is also the same*/
    transition: all .4s;
}

/*we just made the absolute copy of the button element without making any changes*/


.btn-white::after {
    background-color:white
}
/* i tried to remove this(above) and the button element did not show any visible changes when i tried to hover because we had made the secret element stay invisible 
the secret element will make copy of the original element and only make changes and let the remain part stay the same */




/*after is like a secret state that is hidden behind the element we are making it for
then we create many types of secret states that will depend upon the original secret state we made
*/



.btn:hover::after{
    transform: scaleX(1.4) scaleY(1.6); /*different expansion for updown, rightLeft*/                   /*transform:scale(1.5);*/ /*make the after state become 1.5 times bigger than original*/
    opacity:0; 
}
/* the reason why we are able to see the text of the button as it is because the secret element has not made any changes to it
and the reason why the */

/* another thing that happened is the transition property is set to all and that made the element go to the hover state in a real easy manner ..
1st it did not get bigger all of a sudden because of size 
2nd and since we made the opacity 0 but with .4s transition time it became invisible slowly*/
/*all this super special states will inherit the behaviour from its initial state */


/* now we want to create the button down to up transition animation */




@keyframes moveUpButton{
    0%{
        opacity: 0;
        transform:translateY(100px); /* it will start from 100px down*/
    }

    100%{
        opacity:1;
        transform:translate(0); /* go up to its original position*/
    }
}

.btn-up{  
    animation-name:moveUpButton;
    animation-duration: .7s;
    animation-timing-function: ease-out;
    animation-delay: 0.1s;
    animation-fill-mode:backwards; /*apply the style of 0% even before the animation starts */
    /*since we are using keyframes animation right ? so it says make the initial state of the element to be 0% mentioned 
    the term backawards means the initial state will be the 0% which is back to 100%*/

}