/* Accordion Styles */
.accordion-row {
    background: transparent;
}

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
}

.accordion-content.open {
    max-height: 350px;
    padding: 0.75rem 0 0.25rem 0;
}

.keyboard-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: transparent;
    width: 100%;
}

.keyboard-container svg {
    max-width: 100%;
    height: auto;
}

/* Keyboard SVG Styles */
.key-legend {
    font-size: 14px;
    font-weight: 500;
    fill: #111827;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    user-select: none;
}

/* Secondary legend (top-right corner) for showing known layout key */
.key-legend-secondary {
    font-size: 10px;
    font-weight: 500;
    fill: #6366f1;
    text-anchor: end;
    dominant-baseline: hanging;
    pointer-events: none;
    user-select: none;
    opacity: 0.8;
}

body.dark-mode .key-legend-secondary {
    fill: #a78bfa;
}

.key-rect {
    fill: #f3f4f6;
    stroke: #9ca3af;
    stroke-width: 1.5;
    rx: 6;
    ry: 6;
}

.home-position-key .key-rect {
    fill: #e5e7eb;
    stroke: #9ca3af;
    stroke-width: 1.5;
}

/* Dark mode support for accordion */
body.dark-mode .accordion-row {
    background: transparent;
}

body.dark-mode .key-legend {
    fill: #e2e8f0;
}

body.dark-mode .key-rect {
    fill: #4a5568;
    stroke: #718096;
}

body.dark-mode .home-position-key .key-rect {
    fill: #3a4556;
    stroke: #718096;
    stroke-width: 1.5;
}

/* Responsive design */
@media (max-width: 768px) {
    .accordion-content.open {
        max-height: 600px;
    }
    
    .keyboard-container svg {
        max-width: 100%;
        height: auto;
    }
}

/* Accordion actions */
.accordion-actions {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0 0.5rem 0;
}

.try-layout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.try-layout-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.try-layout-btn:active {
    transform: translateY(0);
}

.try-layout-btn i {
    font-size: 0.85rem;
}

/* Make table rows clickable */
#layoutTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#layoutTable tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

#layoutTable tbody tr.active {
    background-color: rgba(102, 126, 234, 0.1);
}

body.dark-mode #layoutTable tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.15);
}

body.dark-mode #layoutTable tbody tr.active {
    background-color: rgba(102, 126, 234, 0.25);
}
