/* General Body & Typography */
body {
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    padding-bottom: 80px; /* Adjust padding for smaller footer */
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: #d8b2d8; /* Pastel Purple */
}

a {
    color: #a7d8b4; /* Pastel Green */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background: #2c2c2c;
    color: #fff;
    padding: 1rem 0;
    border-bottom: 3px solid #d8b2d8;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 2.5rem;
    font-weight: bold;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #fff;
}

/* Main Content */
.content-section {
    background: #2c2c2c;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.page-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Flower Index */
.flower-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.flower-card {
    background: #333;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flower-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(216, 178, 216, 0.2);
}

.flower-card h2 {
    margin-top: 0;
}

.flower-card p {
    color: #b0b0b0;
}

/* Flower Detail Page */
.flower-details-container {
    padding: 20px;
    max-width: 900px;
    margin: 20px auto;
    background: #2c2c2c; /* Dark background */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.flower-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444; /* Darker border */
}

.flower-header h1 {
    font-size: 2.8em;
    color: #d8b2d8; /* Pastel Purple */
    margin-bottom: 0.2em;
}

.scientific-name {
    font-size: 1.2em;
    color: #e0e0e0; /* Light text */
    font-style: italic;
}

.detail-pane {
    background-color: #333; /* Darker pane background */
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.detail-pane h2 {
    font-size: 1.5em;
    color: #d8b2d8; /* Pastel Purple */
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-pane p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #e0e0e0; /* Light text */
    margin: 0;
}

.edit-mode-enabled .editable {
    cursor: text;
    background-color: #444;
    padding: 5px;
    border-radius: 4px;
}

.manage-images-btn {
    display: none;
}

.edit-mode-enabled .manage-images-btn {
    display: inline-block;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.image-gallery .image-container {
    flex-basis: 200px; /* Adjust size as needed */
    flex-grow: 1;
    max-width: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.image-gallery img {
    width: 100%;
    height: auto;
    display: block;
}

.manage-images-btn {
    font-size: 0.8em;
    padding: 8px 12px;
}

.flower-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.flower-gallery img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid #a7d8b4;
}

.flower-info h3 {
    border-bottom: 2px solid #d8b2d8;
    padding-bottom: 5px;
    margin-top: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control-label {
    display: block;
    margin-bottom: .5rem;
}

.form-control {
    width: 100%;
    padding: .75rem;
    background: #333;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 4px;
}

.btn {
    display: inline-block;
    background: #d8b2d8;
    color: #1a1a1a;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-outline-info {
    background: transparent;
    border: 2px solid #a7d8b4;
    color: #a7d8b4;
}

.btn-outline-info:hover {
    background: #a7d8b4;
    color: #1a1a1a;
}

/* Edit Mode Toggle Switch in Admin Panel */
.edit-mode-toggle {
    display: flex;
    align-items: center;
}
.edit-mode-toggle label {
    margin-right: 10px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 44px; /* smaller switch */
    height: 24px;
}
.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;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider {
    background-color: #a7d8b4; /* Pastel Green */
}
input:checked + .slider:before {
    transform: translateX(20px);
}
.slider.round {
    border-radius: 24px;
}
.slider.round:before {
    border-radius: 50%;
}

/* In-place editing styles */
.manage-images-btn {
    display: none; /* Hide by default */
}

.edit-mode-enabled .manage-images-btn {
    display: inline-block; /* Show only in edit mode */
}

.editable-field textarea {
    width: 100%;
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px;
    margin-top: 5px;
}

/* Admin Panel */
.admin-panel {
    background: #222;
    color: #fff;
    padding: 0.5rem 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    border-top: 2px solid #d8b2d8;
    z-index: 1000;
}

.admin-panel .container {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
}

.alert-success {
    background-color: #a7d8b4;
    color: #1a1a1a;
}

.alert-danger {
    background-color: #f8a7a7;
    color: #1a1a1a;
}

.alert-info {
    background-color: #a7c5d8;
    color: #1a1a1a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }

    .nav-links {
        margin-top: 10px;
    }
}
