/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

header {
    background-color: #2c3e50;
    color: white;
    height: 80px;
    margin-bottom: 2rem;
}

header > h1{
    line-height: 80px;
    margin-left: 20px;
}

header > nav{
    float: right;
    line-height: 80px;
    margin-top: -80px;
}

nav a {
    color: white;
    margin-right: 1rem;
    text-decoration: none;
}

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

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Lista przepisów */
.recipes-list {
    margin-bottom: 2rem;
}

.recipe-card {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex;
    margin-bottom: 1.5rem;
}

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

.recipe-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.recipe-image {
    width: 200px;
    min-height: 150px;
    background: #f5f5f5;
    overflow: hidden;
    flex-shrink: 0;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.05);
}

.recipe-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.recipe-description {
    color: #555;
    margin: 0.5rem 0;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-meta {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.recipe-meta span {
    margin-right: 1rem;
}

/* Strona przepisu */
.recipe-full {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.recipe-full h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.recipe-image-full {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.recipe-image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-description {
    font-style: italic;
    margin-bottom: 1rem;
    color: #555;
}

.ingredients, .preparation {
    margin: 2rem 0;
}

.ingredients h3, .preparation h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.ingredients ul {
    list-style-type: none;
}

.ingredients li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

/* Formularze */
.login-form, .recipe-form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #c0392b;
}

.secondary-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.5rem;
}

.secondary-button:hover {
    background-color: #2980b9;
}

.error {
    color: #e74c3c;
    background-color: #fdecea;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success {
    color: #27ae60;
    background-color: #e8f5e9;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Panel admina */
.recipes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.recipes-table th, .recipes-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.recipes-table th {
    background-color: #f2f2f2;
}

.recipes-table tr:hover {
    background-color: #f5f5f5;
}

.recipes-table a {
    color: #3498db;
    text-decoration: none;
    margin-right: 0.5rem;
}

.recipes-table a:hover {
    text-decoration: underline;
}

/* Składniki w formularzu */
.ingredients-container {
    margin-top: 1rem;
}

.ingredient-row {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.ingredient-row:last-child {
    border-bottom: none;
}

.remove-ingredient {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: flex-end;
    margin-left: 0.5rem;
}

.remove-ingredient:hover {
    background-color: #c0392b;
}

/* Responsywność */
@media (max-width: 768px) {
    .recipe-card {
        flex-direction: column;
    }
    
    .recipe-image {
        width: 100%;
        height: 150px;
    }
    
    .form-row {
        flex-direction: column;
    }
}

.current-image-preview {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    display: inline-block;
}

.current-image-preview p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Przycisk anuluj */
.secondary-button {
    display: inline-block;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    margin-left: 1rem;
}

.secondary-button:hover {
    background-color: #2980b9;
}

.delete-confirmation {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.delete-confirmation h2 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.delete-confirmation p {
    margin-bottom: 1.5rem;
}

.recipe-preview {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.recipe-preview h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.image-preview {
    margin-top: 1rem;
}

.delete-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.delete-button:hover {
    background-color: #c0392b;
}