@font-face {
    font-family: "Norse";
    src: url("../uploads/fonts/Norse.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Norse";
    src: url("../uploads/fonts/Norse-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #eef3eb;
    color: #1f2a1f;
}


a {
    color: #1d5f3c;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* ===== TOPBAR / GENERELLT ===== */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #dfeadb;
    border-bottom: 1px solid #cad8c6;
}

.topbar h1 {
    margin: 0 0 4px;
    font-size: 32px;
}

.muted {
    color: #5f6d5f;
    margin: 0;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.back-link {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 15px;
}

main {
    padding: 20px;
}

.empty-state,
.info-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

/* ===== KNAPPAR ===== */

.button {
    appearance: none;
    border: 0;
    border-radius: 4px;
    background: #2e7d4f;
    color: #fff;
    padding: 4px 10px;
    font-size: 10px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.button.secondary {
    background: #718775;
}

.button:hover {
    filter: brightness(1.20);
    text-decoration: none;
}

.button.btn-ok {
    background: #2e7d4f;
    color: #fff;
}

.button.btn-alert {
    background: #c94141;
    color: #fff;
	/* animation: pulse 1.5s infinite, glow 2s infinite; */
  animation: blink 3s infinite, glow 2s infinite;
  /* animation: breathe 2s infinite, glow 2s infinite; */
 }

.button.btn-neutral {
    background: #9aa5a0;
    color: #fff;
}

/* ===== ÖVERSIKT / VANLIG ===== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.plant-card {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
    border: 5px solid #68a96b;
    color: inherit;
    text-decoration: none;
}

.plant-card:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.plant-card.soon {
    border-color: #d9a11d;
}

.plant-card.alert {
    border-color: #c94141;
    animation: colorPulse 3s infinite;
}

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

.plant-card-body {
    padding: 16px;
}

.plant-card-header h2 {
    margin: 0 0 4px;
    font-size: 24px;
}

.latin-name {
    color: #5f6d5f;
    font-style: italic;
    margin-bottom: 12px;
}

.status-lines {
    display: grid;
    gap: 8px;
    font-size: 17px;
}

.status-pill {
    margin-top: 14px;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 15px;
    background: #dff1e1;
}

.status-pill.soon {
    background: #f7e6bb;
}

.status-pill.alert {
    background: #f3c8c8;
}

/* ===== ADMIN ===== */

.admin-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.plant-form {
    display: grid;
    gap: 14px;
}

.plant-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.plant-form input[type="text"],
.plant-form input[type="number"],
.plant-form input[type="file"],
.plant-form select,
.plant-form textarea {
    width: 100%;
    border: 1px solid #c9d4c7;
    border-radius: 12px;
    padding: 12px;
    font-size: 16px;
    font-family: inherit;
    background: #fbfcfa;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-actions,
.inline-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== DETALJSIDA / PLANT.PHP ===== */

/* ===== DETALJSIDA / PLANT.PHP ===== */

.detail-single-column {
    display: grid;
    gap: 12px;
}

.hero-panel {
    padding: 12px;
    overflow: hidden;
}

.hero-status-actions-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 125px;
    gap: 8px;
    align-items: start;
}

.hero-left {
    flex-direction: column;
    align-items: center;
}

.hero-image {
    margin-bottom: 8px;
}

.status-middle {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-self: stretch;
    padding: 2px 4px;
    min-width: 0;
}


.plant-nickname {
    font-family: "Norse", sans-serif;
    font-weight: 700;
    font-size: 40px;
    display: inline-block;
    align-self: flex-start;   /* <-- viktigaste raden */
    padding: 10px 18px;
	background-repeat: no-repeat;
	min-width: fit-content;		
    background: url("../uploads/wood.png");
    background-size: cover;
    background-position: center;

    color: #DEB887;

    text-shadow:
        1px 1px 0 #000,
        -1px -1px 0 rgba(166,3,0,1);

    border: 3px solid #3e2a14;
    border-radius: 6px;
}

.status-middle p {
    margin: 0 0 8px;
    font-size: 14px;
}

.status-middle h2 {
    margin: 2px 0 8px;
    font-size: 17px;
}

.status-list {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.actions-right {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.right-centered-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-actions form,
.vertical-actions form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.vertical-actions .button {
    min-width: 0;
    width: 100%;
    padding: 8px 8px;
    font-size: 13px;
    line-height: 1.15;
    text-align: center;
    border-radius: 6px;
}

/* 1024-bredd och mindre: bild + status bredvid varandra, knappar under */
@media (max-width: 700px) {
    main {
        padding: 10px;
    }

    .topbar {
        padding: 12px;
    }

    .info-card {
        padding: 12px;
    }

    .hero-status-actions-layout {
        grid-template-columns: 200px minmax(0, 1fr);
        gap: 8px;
    }

    .hero-left {
        grid-column: 1;
        grid-row: 1;
    }

    .status-middle {
        grid-column: 2;
        grid-row: 1;
    }

    .actions-right {
        grid-column: 1 / span 2;
        grid-row: 2;
        justify-content: flex-start;
        margin-top: 4px;
    }

    .right-centered-actions {
        justify-content: flex-start;
    }

    .vertical-actions form {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }

    .vertical-actions .button {
        width: auto;
        min-width: 120px;
        font-size: 13px;
        padding: 8px 10px;
    }

    .hero-image {
        max-width: 200px;
        max-height: 200px;
    }

    .plant-nickname {
        font-size: 28px;
        padding: 7px 12px;
    }

    .status-list {
        font-size: 13px;
        gap: 5px;
    }
}

/* smal stående mobil/äldre liten skärm */
@media (max-width: 640px) {
    .hero-status-actions-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero-left,
    .status-middle,
    .actions-right {
        grid-column: auto;
        grid-row: auto;
    }

    .hero-left {
        justify-content: center;
    }

    .hero-image {
        max-width: 170px;
        max-height: 170px;
    }

    .actions-right,
    .right-centered-actions {
        justify-content: flex-start;
    }

    .vertical-actions form {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .vertical-actions .button {
        min-width: calc(50% - 4px);
        width: auto;
    }

    .plant-nickname {
        font-size: 24px;
    }
}

/* ===== HISTORIKLISTA, OM DU LÄGGER TILL SENARE ===== */

.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.history-list li {
    padding: 12px 0;
    border-top: 1px solid #e7ece5;
}

.history-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

/* ===== MINI-ÖVERSIKT FÖR IPAD / MOBIL / VÄGGSKÄRM ===== */

.mini-overview main {
    padding: 6px;
}

.mini-overview .topbar {
    padding: 6px 10px;
}

.mini-overview .topbar h1 {
    margin: 0 0 2px;
    font-size: clamp(16px, 3vw, 18px);
}

.mini-overview .muted {
    font-size: clamp(10px, 1.5vw, 14px);
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 4px;
    align-items: stretch;
}

.mini-card {
    background: #68a96b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 4px solid #68a96b;
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.mini-card:hover {
    text-decoration: none;
	border-color: #78FF73;
	transform: translateY(-2px);
}

.mini-card.soon {
    border-color: #ccb81d;
	background: #ccb81d;
}

.mini-card.alert {
    border-color: #c94141;
    animation: colorPulse 3s infinite;
}

.mini-card.alert:hover {
	text-decoration: none;
    border-color: #FFA3A3;
    animation: colorPulse 3s infinite;
}

.mini-image-wrap {
    width: 100%;
    height: 140px;
    background: #f4f6f1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.mini-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.mini-card-body {
    padding: 4px 4px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mini-title {
    font-family: "Norse", sans-serif;
    padding: 4px 8px;
    background: url("../uploads/wood.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-width: fit-content;
    color: #DEB887;
    text-shadow:
        1px 1px 0 #000,
        -1px -1px 0 rgba(166,3,0,1);
    border: 3px solid #3e2a14;
    border-radius: 6px;
    margin: 0;
    text-align: center;
    font-size: clamp(24px, 1.2vw, 60px);
    line-height: 1;
    min-height: 1.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-card .status-pill {
    margin-top: 0;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 60px;
    padding: 4px 6px;
    border-radius: 999px;
    font-size: clamp(6px, 1vw, 10px);
    background: #dff1e1;
    color: #23402c;
}

.mini-card .status-pill.soon {
    background: #f7e6bb;
    color: #6d5200;
}

.mini-card .status-pill.alert {
    background: #f3c8c8;
    color: #7c1e1e;
}


/* ===== ANIMATIONER ===== */

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 8px 22px rgba(0,0,0,0.08); }
    50% { transform: scale(1.012); box-shadow: 0 12px 28px rgba(201,65,65,0.20); }
    100% { transform: scale(1); box-shadow: 0 8px 22px rgba(0,0,0,0.08); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

@keyframes glow {
  0%   { box-shadow: 0 0 5px rgba(201,65,65,0.4); }
  50%  { box-shadow: 0 0 20px rgba(201,65,65,0.8); }
  100% { box-shadow: 0 0 5px rgba(201,65,65,0.4); }
}

@keyframes popIn {
  0%   { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes colorShift {
  0%   { background: #c94141; }
  50%  { background: #ff6b6b; }
  100% { background: #c94141; }
}

@keyframes colorPulse{
  0%   { transform: scale(1); box-shadow: 0 8px 22px rgba(0,0,0,0.08); background: #c94141; }
  50%  { transform: scale(0.950); box-shadow: 0 12px 32px rgba(201,65,65,0.20); background: #ff6b6b; }
  100% { transform: scale(1); box-shadow: 0 8px 22px rgba(0,0,0,0.08); background: #c94141; }
}


