/* ============================
   Global basics
   ============================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* ============================
   Layout helpers
   ============================ */
a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================
   Login
   ============================ */
.login-box {
    max-width: 360px;
    margin: 8vh auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.login-box h2 {
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-box input:focus {
    border-color: #6200ee;
    box-shadow: 0 0 0 2px rgba(98, 0, 238, 0.15);
}

.login-box button {
    margin-top: 0.5rem;
    padding: 0.7rem;
    border-radius: 8px;
    border: none;
    background: #6200ee;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.login-box button:hover {
    background: #4b00c8;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.error {
    margin-bottom: 0.75rem;
    color: #c62828;
    font-size: 0.9rem;
}

/* ============================
   Dashboard – card grid
   ============================ */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

/* ============================
   Material Design card
   ============================ */
.md-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.md-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.md-card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.md-card-body {
    padding: 1.4rem 1.5rem 0.8rem;
}

.md-card-body h2 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    font-weight: 500;
    color: #222;
}

.md-card-body p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #555;
}

/* ============================
   Buttons (Material style)
   ============================ */
.md-card-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1.5rem 1.3rem;
}

.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: none;
    background: #6200ee;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}

.md-btn:hover {
    background: #4b00c8;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.md-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.md-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.md-btn-secondary:hover {
    background: #d0d0d0;
}

/* Links styled as buttons */
.admin-link,
.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 1rem 2rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.admin-link {
    background: #03a9f4;
    color: #fff;
}

.admin-link:hover {
    background: #0288d1;
}

.logout-link {
    background: #ef5350;
    color: #fff;
}

.logout-link:hover {
    background: #e53935;
}

/* ============================
   Modal (Mehr erfahren)
   ============================ */
.md-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.md-modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 640px;
    padding: 1.8rem 2rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
    position: relative;
}

.md-modal-content img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1.2rem;
}

.md-modal-content h2 {
    margin: 0 0 0.6rem;
    font-size: 1.4rem;
}

.md-modal-content p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #555;
}

.md-modal-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #777;
}

/* ============================
   Detail page
   ============================ */
.detail-container {
    max-width: 900px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

.detail-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.detail-img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.detail-card h1 {
    margin: 0 0 0.8rem;
    font-size: 2rem;
    font-weight: 500;
}

.detail-card p {
    margin: 0 0 1.8rem;
    font-size: 1.02rem;
    line-height: 1.7;
    color: #555;
}

/* ============================
   Admin area
   ============================ */
.admin-container {
    max-width: 960px;
    margin: 2.5rem auto;
    padding: 0 1rem 2rem;
    background: transparent;
}

.admin-container h2 {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.saved {
    margin: 0.5rem 0 1rem;
    color: #2e7d32;
    font-size: 0.95rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #6200ee;
}

.back-link:hover {
    text-decoration: underline;
}

.admin-container form {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem 1.8rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.item-block {
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 1.2rem;
    margin-bottom: 1.2rem;
}

.item-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.item-block h3 {
    margin: 0 0 0.6rem;
    font-size: 1.05rem;
    font-weight: 500;
}

.item-block label {
    display: block;
    margin: 0.4rem 0 0.2rem;
    font-size: 0.9rem;
    color: #555;
}

.item-block input[type="text"],
.item-block textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-block textarea {
    resize: vertical;
    min-height: 90px;
}

.item-block input:focus,
.item-block textarea:focus {
    border-color: #6200ee;
    box-shadow: 0 0 0 2px rgba(98, 0, 238, 0.12);
}

.item-block img {
    margin: 0.4rem 0 0.6rem;
    max-width: 180px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.item-block input[type="file"] {
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

/* Admin buttons */
.admin-container button {
    margin-top: 0.8rem;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: #6200ee;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.admin-container button:hover {
    background: #4b00c8;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.delete-btn {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: #c62828;
}

.delete-btn:hover {
    text-decoration: underline;
}

.add-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    background: #03a9f4;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.add-btn:hover {
    background: #0288d1;
}

/* ============================
   Responsive tweaks
   ============================ */
@media (max-width: 768px) {
    .container {
        margin-top: 1.5rem;
    }

    .md-card-image img {
        height: 200px;
    }

    .md-card-actions {
        flex-direction: column;
    }

    .md-btn {
        width: 100%;
        justify-content: center;
    }

    .detail-card {
        padding: 1.5rem;
    }

    .admin-container form {
        padding: 1.2rem 1.3rem;
    }
}

@media (max-width: 480px) {
    .login-box {
        margin: 5vh 1rem;
    }

    .detail-card h1 {
        font-size: 1.6rem;
    }
}
