/* =========================
   GLOBAL BASE
========================= */

body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    margin: 0;
}

/* =========================
   AUTH PAGES
========================= */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.auth-container {
    background: white;
    padding: 30px;
    width: 350px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.auth-container form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* inputs now behave consistently */
.auth-container input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

/* button matches inputs exactly */
.auth-container button {
    width: 100%;
    padding: 10px;
    background: #4a90e2;
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

.auth-container button:hover {
    background: #357bd8;
}

input[type="hidden"] {
    display: none;
}

a {
    color: #4a90e2;
    text-decoration: none;
}

/* =========================
   NAVBAR (NEW STRUCTURE)
========================= */

.navbar {
    background: #222;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

/* left / center / right layout */
.nav-left,
.nav-center,
.nav-right {
    display: flex;
    align-items: center;
}

/* logo */
.logo {
    font-weight: bold;
    font-size: 18px;
}

/* right links */
.nav-right {
    gap: 15px;
}

.nav-right a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.nav-right a:hover {
    text-decoration: underline;
}

.welcome {
    margin-right: 10px;
    font-size: 14px;
    opacity: 0.8;
}

/* =========================
   SEARCH (IN NAVBAR)
========================= */

.search-form input {
    width: 220px;
    padding: 7px 10px;
    border-radius: 6px;
    border: none;
    outline: none;
}

.search-form input:focus {
    width: 260px;
    transition: 0.2s;
}

/* =========================
   MAIN LAYOUT
========================= */

.container {
    padding: 20px;
}

/* =========================
   RECIPES GRID
========================= */

.recipes {
    text-align: center;
    margin-top: 20px;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recipe-card {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: left;
    transition: 0.2s;
}

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

.recipe-card h3 {
    margin-top: 0;
}

.recipe-card a {
    display: inline-block;
    margin-top: 10px;
    color: #4a90e2;
    text-decoration: none;
}

.recipe-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.recipe-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recipe-info a {
    margin-top: 5px;
}

.recipe-info h3 {
    margin: 0;
}

.recipe-info p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

/* =========================
   RECIPE VIEW PAGE
========================= */

.recipe-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

/* HEADER */
.recipe-header {
    display: flex;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.recipe-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.recipe-info h1 {
    margin-top: 0;
}

.recipe-author {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.recipe-description {
    margin-top: 10px;
    color: #333;
}

/* CONTENT */
.recipe-content {
    margin-top: 20px;
    display: grid;
    gap: 20px;
}

/* SECTIONS */
.recipe-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.recipe-section h2 {
    margin-top: 0;
}

/* LIST STYLING */
.recipe-section ul,
.recipe-section ol {
    padding-left: 20px;
}

.recipe-section li {
    margin-bottom: 8px;
}

/* =========================
   FORM SYSTEM (NEW RECIPE PAGES)
========================= */

.card {
    max-width: 700px;
    margin: 40px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    margin: 0;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.card-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field input,
.field textarea,
.field select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.field textarea {
    min-height: 100px;
    resize: vertical;
}

button {
    font-family: inherit;
}

button[type="submit"] {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
}

button[type="submit"]:hover {
    background: #357bd8;
}

/* =========================
   STEP 2 PAGE (INGREDIENTS + STEPS)
========================= */

.section-block {
    margin-top: 20px;
}

.section-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

/* ingredient / step row styling */
.item-row {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* add row inputs */
.add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-row input,
.add-row select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* step textarea block */
.step-add-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step-add-row textarea {
    min-height: 80px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.step-add-bottom {
    display: flex;
    gap: 8px;
}

.step-add-bottom input {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* =========================
   BUTTON VARIANTS
========================= */

.btn-secondary {
    background: #eee;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #ddd;
}

.btn-primary {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #357bd8;
}

/* =========================
   IMAGE PREVIEW
========================= */

.recipe-preview-img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}