@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

:root {
    --desert-sand: #E5B796;
    --deep-sand: #C4976F;
    --chefchaouen-blue: #4C7195;
    --deep-blue: #2A4C70;
    --terracotta: #B44C36;
    --light-sand: #F5E6D3;
    --dark-text: #2C1810;
}

@font-face {
    font-family: 'Azqad';
    src: url('./fonts/Azqad.ttf') format('truetype');
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--light-sand);
    padding: 2rem;
    min-height: 100vh;
    color: var(--dark-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(196, 151, 111, 0.15);
}

/* Typography */
h1 {
    font-family: 'Azqad', sans-serif;
    font-size: 2.75rem;
    font-weight: normal;
    text-align: center;
    color: var(--terracotta);
}

h2 {
    font-size: 2.75rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: normal;
    color: var(--deep-blue);
}

/* Home Page */
.home-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--desert-sand);
    padding-bottom: 2rem;
    position: relative;
}

.home-header .logo {
    font-family: 'Azqad', sans-serif;
    font-size: 2.75rem;
    font-weight: normal;
    color: var(--terracotta);
    margin-bottom: 0.5rem;
}

.home-header .subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: .75rem;
    color: var(--deep-blue);
}

.home-header .login-button {
    position: absolute;
    top: 0;
    right: 0;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo-link:hover {
    cursor: pointer;
}

/* Navigation Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--desert-sand);
    margin-bottom: 2rem;
    padding-bottom: 2rem;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-button, .login-button {
    font-family: 'Poppins', sans-serif;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid var(--chefchaouen-blue);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    background: var(--chefchaouen-blue);
    color: white;
    border-radius: 4px
}

.nav-button:hover, .login-button:hover {
    background: var(--deep-blue);
    color: white;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--dark-text);
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--desert-sand);
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--chefchaouen-blue);
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 113, 149, 0.1);
}

.form-group input[type="range"] {
    padding: 0;
}

.help-text {
    font-size: 0.75rem;
    color: var(--deep-sand);
}

.range-value {
    text-align: center;
    font-size: 0.875rem;
    color: var(--deep-sand);
}

/* Button Styles */
.button, .search-button, .submit-button {
    font-family: 'Poppins', sans-serif;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    background: var(--chefchaouen-blue);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button:hover, .search-button:hover, .submit-button:hover {
    background: var(--deep-blue);
}

.button.primary {
    background: var(--terracotta);
    border-color: var(--terracotta);
    color: white;
}

.button.primary:hover {
    background: var(--deep-sand);
}

/* Search Section */
.search-section {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 3rem;
    border: 1px solid var(--desert-sand);
    box-shadow: 0 2px 8px rgba(196, 151, 111, 0.1);
}

.search-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    align-items: end;
}

.search-form .search-button {
    grid-column: 1 / 2;
    margin-top: 1rem;
}

/* Analytics Section */
.analytics-section {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 3rem;
    border: 1px solid var(--desert-sand);
    box-shadow: 0 2px 8px rgba(196, 151, 111, 0.1);
}

.analytics-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.analytics-form .submit-button {
    grid-column: 1 / 2;
    margin-top: 1rem;
}

.chart-container {
    margin-top: 3rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.chart-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(196, 151, 111, 0.1);
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.recipe-card {
    text-decoration: none;
    color: inherit;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(196, 151, 111, 0.1);
    transition: transform 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-4px);
}

.recipe-card:hover .recipe-title {
    color: var(--terracotta);
}

.recipe-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 1rem;
}

.recipe-title {
    font-size: 1.25rem;
    color: var(--dark-text);
    transition: color 0.2s ease;
    font-family: 'Poppins', sans-serif;
    padding: 0 1rem 1rem;
}

/* Recipe Detail */
.recipe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(196, 151, 111, 0.1);
}

.recipe-header {
    max-width: 800px;
    text-align: center;
    margin: 0 auto 2rem auto;
}

.recipe-header h2 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    font-weight: normal;
    color: var(--terracotta);
}

.recipe-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(196, 151, 111, 0.1);
}

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(196, 151, 111, 0.15);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form .submit-button {
    margin-top: 1rem;
}

.error-message {
    color: var(--terracotta);
    background-color: #fff2f2;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Media Queries */
@media (max-width: 768px) {
    h1, h2, .logo {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .analytics-form {
        grid-template-columns: 1fr;
    }
    
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

/* Fix for home page hero section */
.hero-image {
    width: 100%;
    max-width: 1000px;
    height: auto;
    margin: 0 auto 2rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(196, 151, 111, 0.15);
}

.featured-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--dark-text);
    max-width: 600px;
    margin: 0 auto 2rem auto;
    text-align: center;
    align-items: center;
}

.featured-section {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}

.cta-button {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    background: var(--terracotta);
    color: white;
    border: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.cta-button:hover {
    background: var(--deep-sand);
}

.meta-info {
    font-family: 'Poppins', sans-serif;
    margin-bottom: 2rem;
    line-height: 1.6;
    color: var(--dark-text);
}

.ingredients {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(196, 151, 111, 0.1);
}

.ingredients h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    width: 100%;
    grid-column: 1 / -1;
    box-shadow: 0 2px 8px rgba(196, 151, 111, 0.1);
}

.empty-state p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.125rem;
    color: var(--deep-sand);
    margin-bottom: 1.5rem;
}

/* Footer Styles */
.footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--desert-sand);
}

.about-me-button {
    font-family: 'Poppins', sans-serif;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    background: #333;
    color: white;
    border: none;
    transition: background-color 0.2s ease;
}

.about-me-button:hover {
    background: #555;
}