@import url('https://fonts.googleapis.com/css2?family=Lora&display=swap');

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #fdf0d5;
    color: #333;
}

h1, h2, h3 {
    font-family: 'Lora', serif;
}

header {
    background-color: #557c55;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem;
}

.header-text {
    margin-bottom: 0.5rem;
    text-align: left;
    width: 100%;
    flex: 1;
    min-width: 200px;
}

.header-text h1 {
    margin-bottom: 0.2rem;
}

.subtitle {
    margin-top: 0;
    font-size: 1.1rem;
    font-style: italic;
    padding-left: 2rem;
    text-align: left;
}

nav {
    flex: 1;
    min-width: 200px;
    display: flex;
    justify-content: flex-end;
}

nav ul {
    list-style-type: none;
    padding: 0;
    display: flex;
    background-color: #557c55;
    margin: 0;
}

nav li {
    margin: 0 0.5rem;
}

nav a {
    color: white !important;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover, nav a.active {
    background-color: #8b1e3f;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

article {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.image-container {
    flex: 1;
    min-width: 200px;
    max-width: 50%;
}

.image-container img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.description-box {
    flex: 1;
    min-width: 200px;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.image-source {
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

article:nth-child(odd) .image-container {
    order: 1;
}
article:nth-child(odd) .description-box {
    order: 2;
}

article:nth-child(even) .image-container {
    order: 2;
}
article:nth-child(even) .description-box {
    order: 1;
}

@media (max-width: 768px) {
    article {
        flex-direction: column;
    }
    .image-container, .description-box {
        max-width: 100%;
    }
    article:nth-child(odd) .image-container,
    article:nth-child(even) .image-container {
        order: 1;
    }
    article:nth-child(odd) .description-box,
    article:nth-child(even) .description-box {
        order: 2;
    }
}

.dark-mode .description-box {
    background: #2a2a2a;
    color: #e0e0e0;
}

.dark-mode .image-source {
    color: #aaa;
}

:root {
    --bg-light: #fdf0d5;
    --text-light: #333;
    --primary-light: #557c55;
}

.dark-mode {
    --bg-dark: #1a1a1a;
    --text-dark: #e0e0e0;
    --primary-dark: #7aa67a;
    
    background-color: var(--bg-dark) !important;
    color: var(--text-dark) !important;
}

.dark-mode header,
.dark-mode footer {
    background-color: #121212 !important;
}

.dark-mode nav a {
    color: var(--text-dark) !important;
}

.dark-mode nav ul {
    background-color: #2a2a2a !important;
}

.dark-mode nav a:hover,
.dark-mode nav a.active {
    background-color: #8b1e3f !important;
    color: white !important;
}

.intro {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.categories {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.category-box {
    flex: 1;
    min-width: 300px;
    margin: 0.5rem;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.category-box img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.category-box h3 {
    color: #8b1e3f;
    margin: 1rem 0;
}

.category-box p {
    padding: 0 1rem 1rem;
}

.favorites {
    margin-bottom: 2rem;
}

.favorites h2 {
    color: #8b1e3f;
    border-bottom: 2px solid #e4bad4;
    padding-bottom: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #557c55;
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

.contact {
    background: url('../media/background.jpg') center/cover;
    padding: 2rem;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    color: #333;
}

.contact::before {
    content: "";
    background: rgba(255, 255, 255, 0.85);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    border-radius: 8px;
}

.contact form {
    position: relative;
    z-index: 1;
}

.dark-mode .contact::before {
    background: rgba(30, 30, 30, 0.85);
}
.dark-mode .contact {
    background: #252525 !important;
    background-image: none !important;
}
form {
    display: grid;
    grid-gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
}

legend {
    padding: 0 0.5rem;
    font-weight: bold;
}

.buttons {
    display: flex;
    gap: 1rem;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

button[type="submit"] {
    background-color: #e4bad4;
    color: #333;
}

button[type="reset"] {
    background-color: #557c55;
    color: white;
}

button:hover {
    opacity: 0.8;
}

footer {
    background-color: #557c55;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-light);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

details {
    margin: 1rem 0;
    cursor: pointer;
}

details summary {
    font-weight: bold;
    outline: none;
}

details[open] summary {
    margin-bottom: 0.5rem;
}

textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    min-height: 100px;
}
.dark-mode table {
    color: var(--text-dark);
    border-color: #444;
}

.dark-mode th {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
}

.dark-mode tr:nth-child(even) {
    background-color: #2a2a2a;
}

.dark-mode td {
    border-bottom-color: #444;
}

.dark-mode .category-box {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.dark-mode .category-box h3 {
    color: #e4bad4;
}

.dark-mode input[type="text"],
.dark-mode input[type="email"],
.dark-mode textarea,
.dark-mode fieldset {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
}

.dark-mode .contact form {
    color: #e0e0e0 !important;
}

.dark-mode legend {
    color: #e0e0e0;
}

.dark-mode button[type="submit"] {
    background-color: #8b1e3f;
    color: white;
}

.dark-mode button[type="reset"] {
    background-color: #7aa67a;
}

.dark-mode details {
    color: #e0e0e0;
}

.dark-mode details[open] {
    background-color: #252525;
}

.dark-mode .intro {
    background-color: #2a2a2a !important; 
    color: #e0e0e0 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
}

a {
    color: #8b1e3f;
    text-decoration: none;
    transition: color 0.3s;
}
a:visited:not(nav a) {
    color: #a63d5c;
}

a:hover:not(nav a) {
    color: #6e1630;
    text-decoration: underline;
}

.dark-mode a:not(nav a) {
    color: #e4bad4;
}

.dark-mode a:visited:not(nav a) {
    color: #c9738e;
}

.high-contrast {
    --hc-bg: #000;
    --hc-text: #FFF;
    --hc-primary: #FFFF00;
    --hc-secondary: #FFA500;

    background-color: var(--hc-bg) !important;
    color: var(--hc-text) !important;
    font-size: 1.1em;
    text-transform: uppercase;
}

.high-contrast h1,
.high-contrast h2,
.high-contrast h3,
.high-contrast a:not(nav a) {
    color: var(--hc-primary) !important;
    text-decoration: underline !important;
}

.high-contrast .description-box,
.high-contrast .category-box,
.high-contrast .intro,
.high-contrast table {
    border: 3px solid var(--hc-primary) !important;
}

.high-contrast .description-box,
.high-contrast .category-box,
.high-contrast .intro {
    background-color: #000;
}

.high-contrast th,
.high-contrast td {
    background-color: #000 !important;
    color: #FF0 !important;
    border: 2px solid #FFF !important;
}

.high-contrast tr:nth-child(even) {
    background-color: #111 !important;
}

.high-contrast-panel {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 8px;
}

.high-contrast .dark-mode .dark-mode-panel {
    background:#1a1a1a;
}

.high-contrast .contact,
.high-contrast .description-box,
.high-contrast .intro {
    background-color: #000 !important;
    color: #FFF !important;
    border: 3px solid #FF0 !important;
    
}

.high-contrast .contact {
    background-image: none !important;
}

.high-contrast .contact::before {
    display: none !important;
}

.high-contrast input[type="text"],
.high-contrast input[type="email"],
.high-contrast input[type="plant-name"],
.high-contrast input[type="notes"],
.high-contrast textarea,
.high-contrast fieldset {
    background-color: #000 !important;
    color: #FF0 !important;
    border: 2px solid #FFF !important;
}

.high-contrast button {
    background-color: #000 !important;
    color: #FF0 !important;
    border: 2px solid #FF0 !important;
    font-weight: bold !important;
}

.high-contrast label:not(.switch),
.high-contrast legend,
.high-contrast .image-source,
.high-contrast .required {
    color: #FF0 !important;
    text-decoration: underline !important;
}

.high-contrast nav a {
    color: #FF0 !important;

}

