/**
 * Theme Name: Garten
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

#garden-planner {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.plants-container {
    background: #f7f5f2;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plants-category {
    margin-bottom: 24px;
}

.plants-category h3 {
    margin-bottom: 16px;
    font-size: 1.2em;
    color: #064564;
    border-bottom: 2px solid #35c261;
    padding-bottom: 4px;
}

.plants-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plant-item {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 12px;
    align-items: center;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.plant-item::before {
    content: '';
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--plant-color);
    border: 2px solid rgba(0,0,0,0.1);
}

.plant-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plant-name {
    font-weight: 500;
    color: #333;
}

.plant-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    grid-column: 1 / -1;
}

.plant-details.active {
    display: block;
}

.detail-category {
    margin-bottom: 8px;
}

.detail-category h4 {
    color: #064564;
    margin: 0 0 4px 0;
    font-size: 0.9em;
}

.detail-category p {
    margin: 0;
    color: #666;
    font-size: 0.85em;
}

.neighbor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.neighbor-tag {
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f5f5f5;
}

.neighbor-tag.good { color: #2e7d32; }
.neighbor-tag.bad { color: #c62828; }

.toggle-details {
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.toggle-details:hover {
    background: rgba(0,0,0,0.05);
}

.search-container {
    margin-bottom: 24px;
    position: relative;
    display: flex;
    gap: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background: #f7f5f2;
}

.reset-button {
    /* margin-top: 12px; */
    padding: 8px 16px;
    background: #064564;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.reset-button:hover {
    background: #052a4a;
}

/* Grid Size Controls */
.grid-controls {
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.grid-size-inputs {
    display: flex;
    gap: 16px;
    align-items: center;
}

.grid-size-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-size-input input {
    width: 80px; /* Breiter für cm-Werte */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.grid-size-input::after {
    content: 'cm';
    margin-left: 4px;
    color: #666;
}

/* Aktualisierte Garden Grid Styles */
.garden-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), minmax(40px, 1fr));
    grid-template-rows: repeat(var(--grid-rows), minmax(40px, 1fr));
    gap: 2px;
    background: #e8f5e9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    width: 100%;
    max-width: calc(var(--total-width-cm) * 2px); /* 2px pro cm für bessere Visualisierung */
    aspect-ratio: calc(var(--total-width-cm) / var(--total-height-cm));
}

.grid-cell {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Quadratische Zellen */
    background: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-cell.planted {
    position: relative;
}

.grid-cell.planted::after {
    content: attr(data-plant-name);
    position: absolute;
    bottom: -1.5em;
    left: 50%;
    transform: translateX(-50%);
    font-size: min(0.7em, 10px);
    white-space: nowrap;
    color: #333;
    text-align: center;
}

.grid-cell.plant-preview {
    background: rgba(0,255,0,0.1);
    border: 2px dashed #4CAF50;
}

.grid-cell.invalid-placement {
    background: rgba(255,0,0,0.1);
    border: 2px dashed #f44336;
}

.cell-content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plant-preview-overlay {
    position: absolute;
    background: rgba(0,0,0,0.1);
    pointer-events: none;
    z-index: 2;
    transition: all 0.2s ease; /* Smooth transition für Rotation */
}

.neighbor-indicator {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.neighbor-indicator.good {
    background: rgba(46, 125, 50, 0.1);
    border: 2px dashed #2e7d32;
}

.neighbor-indicator.bad {
    background: rgba(198, 40, 40, 0.1);
    border: 2px dashed #c62828;
}

.rotate-handle {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%234CAF50" d="M12,4V1L8,5L12,9V6C15.31,6 18,8.69 18,12C18,13.01 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12C20,7.58 16.42,4 12,4M6,12C6,10.99 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12C4,16.42 7.58,20 12,20V23L16,19L12,15V18C8.69,18 6,15.31 6,12Z"/></svg>') center/16px no-repeat;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.rotate-handle:hover {
    transform: scale(1.1);
}

.planted {
    transition: background-color 0.3s ease;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    #garden-planner {
        padding: 10px;
    }

    .plants-container {
        padding: 16px;
    }

    .garden-grid {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .garden-grid {
        grid-template-columns: repeat(8, 1fr); /* Minimale Zellengröße aufheben */
        gap: 1px;
        padding: 5px;
    }

    .grid-cell.planted::after {
        display: none; /* Pflanzennamen auf sehr kleinen Bildschirmen ausblenden */
    }
}

/* Planting Calendar Styles */
.planting-calendar {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-top: 12px;
}

.month-cell {
    padding: 8px;
    text-align: center;
    font-size: 0.8em;
}

.month-cell.aussaat { background: #e8f5e9; }
.month-cell.ernte { background: #fff3e0; }

/* Entfernen der install-button Styles, falls vorhanden */
