html, body {
    height: 100%;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: #1a1919;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.btn-primary,
.btn-secondary,
.btn-success {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.2s;
    text-align: center;
}

.btn-primary {
    color: #f5f5f5;
    background-color: #E53935;
    border: 2px solid #E53935;
}

.btn-primary:hover {
    background-color: #e00906;
    border: 2px solid #1a1919;
}

.btn-secondary {
    background-color: transparent;
    color: #E53935;
    border: 2px solid #E53935;
}

.btn-secondary:hover {
    background-color: #E53935;
    color: #f5f5f5;
    border: 2px solid #1a1919;
}

.btn-success {
    background-color: #43a047;
    color: #fff;
    border: 2px solid #43a047;
}

.btn-success:hover {
    border: 2px solid #1a1919;
}

/*Navbar*/
header {
    position: relative;
}

.navbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #E53935;
    color: #f5f5f5;
    border-bottom: 1px solid #dddddd;
}

.logo {
    margin: 0 0 0 25px;
}

.nav-logo-link {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: Poppins, sans-serif;
}

.logo-image{
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 10px;
}
.logo a{
    font-size: 1.5rem;
    font-weight: 600;
    font-family: Poppins, sans-serif;
    color: #f5f5f5;
    text-decoration: none;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 5px;
    width: auto;
    height: auto;
    background-color: #E53935;
    cursor: pointer;
    border: none;
}

.menu-toggle:hover {
    border: none;
}

.menu-toggle:focus,
.menu-toggle:focus-visible {
    outline: none;
    border: none;
    box-shadow: none;
}

.menu-toggle i {
    color: #f5f5f5;
    font-size: 25px;
    transition: 0.3s ease;
    border-radius: 8px;
}

.nav-item {
    padding-top : 5px;
}

.navbar-links {
    position: absolute;
    list-style: none;
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 10px;
    width: 180px;
    background-color: #E53935;
    padding: 15px;
    border: 1px solid #1a1919;
    border-radius: 8px;
    gap: 20px;
    margin: 0;
    z-index: 1000;
}

.navbar-links.show{
    display: block;
}

.navbar-links a {
    color: #f5f5f5;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    display: block;
    padding: 5px 0;
    transition: 0.2s;
}

.navbar-links .btn-primary {
    color: #f5f5f5;
    background-color: #e9120e;
    border: 1px solid #1a1919;
    border-radius: 8px;
    margin: 5px;
    text-align: center;
}

.navbar-links .btn-secondary {
    color: #E53935;
    background-color: #fff;
    border: 1px solid #1a1919;
    border-radius: 8px;
    margin: 5px;
    text-align: center;
}

.navbar-links a:hover {
    color: #252424;
}

.divider {
    height: 1px;
    background-color: #dddddd;
    margin: 12px 0;
}

/*Footer*/

.footer {
    position: relative;
    background-color: #e6e6e6;
    color: #1a1919;
    margin-top: auto;
    overflow: visible;
}

.footer-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.footer-left a {
    color: #1a1919;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 600;
    font-family: Poppins, sans-serif;
}

.footer-logo {
    padding-top: 15px;
}

.footer-logo-image {
    max-width: 100%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

.footer-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex: 1;
    padding: 0;
    gap: 5px;
}

.footer-center ul {
    margin: 0;
}

.footer-center p {
    font-size: 0.9rem;
    color: #1a1919;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 20px;
}

.footer-links a {
    color: #1a1919;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
}

.footer-links a:hover {
    color: #E53935;
}

.footer-right {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
}

.social-icon {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-links a {
    color: #1a1919;
    font-size: 1.5rem;
    transition: 0.2s;
    text-decoration: none;
}

.social-links a:hover {
    color: #E53935;
}

.footer-bottom {
    margin-top: auto;
    padding-top: 5px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.9rem;
    color: #1a1919;
    margin: 0;
}

/*Flash Messages*/

.flash-messages-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 400px;
    max-width: 90vw;
}

.flash-message {
    padding: 10px 20px;
    border: 3px solid #1a1919;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    animation: slideIn 0.5s ease, flashGlow 1.5s ease 2s;
}

.flash-message.success {
    background-color: #43a047;
}

.flash-message.error {
    background-color: #E53935;
}

.flash-message.warning {
    background-color: #fbc02d;
    color: #1a1919;
}

.close-btn {
    margin-left: 10px;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
}

/*Index.html*/

.hero-section,
.dashboard-section {
    padding: 2rem 1rem 0 1rem;
    background-color: #fff;
}

.hero-container,
.register-container,
.login-container,
.add-recipe-container,
.dashboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    margin: 0 auto;
    max-width: 1200px;
}

.hero-text,
.register-text,
.login-text,
.add-recipe-text,
.dashboard-welcome-text{
    text-align: center;
}

.hero-text h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1f1f3d;
    margin-bottom: 1rem;
}

.hero-text p,
.dashboard--welcome-text p {
    font-size: 1rem;
    color: #1a1919;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.hero-buttons{
    display: flex;
    justify-content: center;
    flex-direction: row;
    gap: 0.3rem;
    width: 100%;
}

.hero-buttons a{
    width: 100%;
    text-align: center;
}

.hero-image{
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    overflow: hidden;
    padding-top: 2rem;
}

.hero-picture {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    display: block;
    transform: scale(1.5);
}

.feature-section {
    padding: 2rem 1rem 0 1rem;
    background-color: #f1f1f1;
}

.feature-section h2 {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    color: #1a1919;
}

.feature-section h2::before,
.feature-section h2::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #dddddd;
    margin: 0 0.5rem;
}

.feature-container {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    margin: 0 auto;
    max-width: 1200px;
    justify-items: center;
}

.feature-item {
    display: flex;
    padding:1rem 1rem;
    text-align: center;
    gap: 1.5rem;
    border-bottom: 1px solid #dddddd;
}

.feature-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    color: #E53935;
}

.feature-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.feature-item h3 {
    font-size: 1.3rem;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #1a1919;
    font-weight: 500;
}

.feature-item p {
    color: #1a1919;
    font-size: 1rem;
    line-height: 1.5;
}

.action-section {
    padding: 2rem 1rem;
    background-color: #fff;
    text-align: center;
}

.action-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1919;
}

.action-section p {
    color: #1a1919;
    line-height: 1.6;
}

/*register page*/

.register-section,
.login-section, 
.add-recipe-section {
    padding: 2rem 1rem 0 1rem;
}

.register-form,
.login-form,
.add-recipe-form {
    background-color: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 1.5rem;
    padding: 2rem 1rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: start;
}

.form-group label {
    font-size: 1rem;
    font-weight: 500;
    color: #1a1919;
    display: block;
    padding: 0 0.3rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    font-size: 1rem;
}

.password-lock {
   position: relative;
   width: 100%;
}

.password-lock i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #1a1919;
    font-size: 1rem;
}

.password-lock input {
    padding-left: 2.5rem;
}

.register-login-text {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #1a1919;
}

.register-login-text a {
    color: #E53935;
    text-decoration: none;
    font-weight: 700;
}

.register-image,
.login-image{
    display: none;
}

/*Login page*/

.login-container{
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.login-form{
    max-width: 420px;
}

/*Recipe page*/

.recipe-layout {
    display: block;
}

.add-recipe-form input,
.add-recipe-form textarea,
.add-recipe-form select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e3e3e3;
    border-radius: 8px;
    font-size: 1rem;
}

.add-recipe-form textarea {
    resize: vertical;
}

.add-recipe-form label {
    display: block;
    font-weight: 600;
    color: #1a1919;
}

.add-recipe-form input:focus,
.add-recipe-form textarea:focus,
.add-recipe-form select:focus {
    outline: none;
    border-color: #43a047;
}

.form-group .photo-upload-box {
    display: inline-flex;
    align-items: center;
    border: 2px solid #e6e6e6;
    background-color: #f1f1f1;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
}

.form-group .photo-upload-box:hover {
    border-color: #43a047;
}

.form-group .file-text{
    margin: 0;
}

.form-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

/*Dashboard*/

.dashboard-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.dashboard-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dashboard--welcome-text h1 {
    font-size: 2rem;
    margin-bottom: 0;
}

.dashboard--welcome-text p {
    font-size: 1.2rem;
    margin-top: 0;
}

.dashboard-image {
    width: 100%;
    display: flex;
    border-radius: 10px;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.dashboard-image .page-picture {
    width: 100%;
    max-width: 380px;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.empty-dashboard{
    width: 100%;
    text-align: center;
}

.dashboard-empty-text{
    color: #1a1919;
    font-weight: 700;
}

.dashboard-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-buttons a {
    width: 100%;
    max-width: 300px;
}

.dashboard-buttons a.btn-secondary {
    margin-bottom: 1rem;
}

.dashboard-or {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    font-weight: 600;
    color: #1a1919;
    margin: 1rem 0;
}

.dashboard-or::before,
.dashboard-or::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #dddddd;
    margin: 0 0.5rem;
}


/*Media Queries*/

@media (max-width: 768px) {
    .logo {
        margin: 0;
    }

    .hide-link {
        display: none;
    }

    .dashboard-image .page-picture {
        transform: scale(1.4);
        transform-origin: center;
    }
}

/*Tablet*/

@media (min-width: 768px) {
    .logo a {
        font-size: 1.8rem;
    }

    .social-links a {
    font-size: 1.8rem;
    }

    .hero-section {
        padding: 3rem 1rem 0 1rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-text p{
        font-size: 1.2rem;
    }

    .hero-buttons {
        gap: 4rem;
    }

    .feature-item {
        justify-content: center;
    }

    .form-actions {
        flex-direction: row;
        justify-content: center;
    }

    #save-recipe-button,
    #cancel-button {
        width: auto;
        min-width: 180px;
    }

    .dashboard-image .page-picture {
        max-width: 340px;
        transform: scale(1.4);
        transform-origin: center;
    }

    .dashboard-welcome-text h1 {
        font-size: 2.3rem;
    }

    .dashboard-empty-text {
        font-size: 1.3rem;
    }
}


@media (max-width: 992px) {
    .footer-left {
        display: none;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .footer-center, 
    .footer-right {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .social-icon {
        justify-content: center;
    }
}

/*Desktop*/

@media (min-width: 992px) {

    .menu-toggle {
        display: none;
    }

    .navbar {
        padding: 15px 50px 15px 20px;
    }

    .navbar-links {
        display: flex !important;
        position: static;
        flex-direction: row;
        gap: 40px;
        width: auto;
        padding: 0;
        background-color: transparent;
        border: none;
    }

    .navbar-links a {
        color: #f5f5f5;
    }

    .navbar-links .btn-primary, 
    .navbar-links .btn-secondary {
        padding: 3px 7px;
    }

    .divider {
        display: none;
    }

    .footer-links {
        gap: 60px;
    }

    .hero-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .hero-text {
        text-align: left;
    }

    .hero-buttons {
        justify-content: flex-start;
    }

    
    .feature-container{
        display: flex;
        justify-content: center;
    }

    .register-container,
    .login-container {
        display: grid;
        align-items: center;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .register-text,
    .register-form,
    .login-text,
    .login-form {
        text-align: left;
    }

    .register-image,
    .login-image {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
        overflow: hidden;
        border-radius: 2rem;
    }

    .register-image img,
    .login-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 10px;
        display: block;
        max-width: 700px;
        transform: scale(1.4);
        transform-origin: center;
    }

    .recipe-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: start;
    }

    .recipe-left {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .recipe-right {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    #instructions {
        min-height: 200px;
    }

    #ingredients {
        min-height: 200px;
    }

    .dashboard-section {
        display: flex;
        align-items: center;
    }

    .dashboard-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        grid-template-areas: "welcome image"
                             "empty image";
        column-gap: 2.5rem;
        row-gap: 0.75rem;
    }

    .dashboard-content>.dashboard-left:first-of-type {
        grid-area: welcome;
    }

    .dashboard-content>.dashboard-left{
        margin: 0 4rem;
    }

    .dashboard-content>.dashboard-right {
        grid-area: image;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .dashboard-content>.dashboard-left:last-of-type {
        grid-area: empty;
    }

    .dashboard-image {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
    }

    .dashboard-image .page-picture {
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 10px;
        display: block;
        max-width: 900px;
        transform: scale(1.4);
        transform-origin: center;
    }

    .dashboard-buttons {
        align-items: center;
    }

    .dashboard-buttons a {
        margin-top: 1rem;
    }

    .dashboard-welcome-text {
        text-align: center;
        margin-bottom: 5rem;
    }
    
    .dashboard-welcome-text h1 {
        font-size:3.2rem;
    }

    .dashboard-content p {
        font-size: 1.15rem;
    }

    .dashboard-content .dashboard-empty-text {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 2rem;
    }
}

@media (min-width: 1200px) {

    .social-links{
        gap: 1.5rem;
    }

    .social-links a {
        font-size: 2.1rem;
        gap: 60px;
    }
}

/*Animation*/
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translatex(60px);
    }
    to {
        opacity: 1;
        transform: translatex(0);
    }
}

@keyframes flashGlow {
    0% {
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    50% {
        box-shadow: 0 0 15px rgba(229, 57, 53, 0.7);
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
}