body {
    font: 14px sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#loader {
    display: none;
}

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

.window {
    margin: 3rem auto;
    max-width: 40rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
    min-width: 600px;
}

.loader {
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #3498db;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.loaderPosition {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 999;
    background: rgba(255,255,255,0.8);
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url(/img/Background.png);
    background-size: cover;
    background-position: center;
    z-index: -10;
}

.error-template {
    margin-top: 5%;
    padding: 40px 15px;
    text-align: center;
}

.error-actions {
    margin-top: 15px;
    margin-bottom: 15px;
}

.btn {
    margin-right: 10px;
}

.image-container {
    text-align: center;
}

.image-container img {
    width: 30%;
    height: auto;
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Recipe page styles */
.recipe-details .image-container {
    position: relative;
    margin-bottom: 1rem;
    width: 100%;
}

.recipe-details .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
}

.recipe-details .image-overlay h1 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: calc(1.2rem + 1.5vw);
    word-wrap: break-word;
}

.recipe-details .image-overlay p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
    font-size: 0.9rem;
}

.recipe-info li {
    margin-bottom: 0.5rem;
}

.description-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.recipe-details .list-group-item {
    border-left: none;
    border-right: none;
}

.recipe-details .list-group-item:first-child {
    border-top: none;
}

.recipe-details .list-group-item:last-child {
    border-bottom: none;
}

/* Recipe cards styles */
.card-img-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img-container .bg-light {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    transition: transform 0.2s ease-in-out;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.card-body {
    display: flex;
    flex-direction: column;
}

.card-text {
    flex-grow: 1;
}

.recipe-meta {
    margin-top: auto;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-text {
        font-size: 0.9rem;
    }
    
    .recipe-meta {
        font-size: 0.85rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Admin login page styles */
#login {
    display: flex;
    flex-direction: column;
}

#login main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
}

#login .card {
    width: 100%;
    border: none;
    border-radius: 10px;
}

#login .form-control {
    border-radius: 8px;
    padding: 8px 12px;
    height: 42px;
}

#login .form-control-lg {
    height: 46px;
    font-size: 1rem;
}

#login .btn-primary {
    padding: 10px 0;
    border-radius: 8px;
    height: 46px;
}

/* Admin panel styles */
#adminPanel main {
    flex: 1 0 auto;
}

#adminPanel .recipe-admin-form .btn {
    margin-right: 0;
}

#adminPanel .admin-step {
    background: #f8fafc;
}

#adminPanel .admin-image-preview {
    max-height: 180px;
    width: 100%;
    object-fit: cover;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #login .card {
        margin: 1rem 0;
    }

    #login .card-body {
        padding: 1.5rem;
    }

    #login h2 {
        font-size: 1.5rem;
    }

    #login .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        height: 42px;
    }

    #login .form-control-lg {
        height: 46px;
    }

    #login .btn {
        font-size: 16px;
        height: 46px;
    }

    #login .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Recipe ingredients styles */
.ingredient-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.ingredient-checkbox {
    flex: 0 0 auto;
    padding-top: 2px;
}

.ingredient-content {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding-right: 1rem;
    word-wrap: break-word;
}

.ingredient-name {
    font-weight: 500;
}

.ingredient-measure {
    color: #666;
}

.ingredients-section .list-group-item {
    padding: 0.75rem 1rem;
}

.ingredients-section .form-check {
    padding-left: 0;
    margin-bottom: 0;
}

.ingredients-section .form-check-input {
    margin-left: 0;
    margin-top: 0;
}

@media (max-width: 768px) {
    .ingredients-section .list-group-item {
        padding: 0.625rem 0.875rem;
    }
    
    .ingredient-name,
    .ingredient-measure {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .ingredient-row {
        gap: 0.75rem;
    }
    
    .ingredient-content {
        padding-right: 0.5rem;
    }
}

/* Recipe steps styles */
.steps-section .list-group-item h5 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.steps-section .list-group-item {
    padding: 1.25rem;
    border-left: 4px solid #3498db;
    margin-bottom: 0.5rem;
}

.steps-section .list-group-item:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .steps-section .list-group-item {
        padding: 1rem;
    }
    
    .steps-section .list-group-item h5 {
        font-size: 1.1rem;
    }
}

/* Step images styling */
.step-image-container {
    width: 200px;
    flex-shrink: 0;
}

.step-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

/* Make steps section responsive */
@media (max-width: 768px) {
    .step-image-container {
        width: 120px;
    }
    
    .step-image {
        height: 90px;
    }
}

@media (max-width: 576px) {
    .list-group-item .d-flex {
        flex-direction: column;
    }
    
    .step-image-container {
        width: 100%;
        margin-top: 1rem;
        margin-left: 0 !important;
        margin-bottom: 1.5rem;
    }
    
    .step-image {
        height: 200px;
    }
}
