/* Enhanced styles for ESR form */
.esr-form {
    display: grid;
    gap: 8px;
    max-width: 520px;
    box-sizing: border-box;
}

.esr-field {
    position: relative;
}

.esr-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.esr-field-half {
    position: relative;
}

.esr-field label,
.esr-field-half label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.esr-field input,
.esr-field textarea,
.esr-field-half input {
    width: 100%;
    padding: .5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.esr-field input:focus,
.esr-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.esr-field input::placeholder,
.esr-field textarea::placeholder {
    color: #999;
    opacity: 1;
}

.esr-field textarea {
    resize: vertical;
    min-height: 80px;
}

.esr-form button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.esr-form button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.esr-form button:active,
.esr-form button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.esr-form-status {
    margin-top: .5rem;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.esr-form-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.esr-form-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Autocomplete */
.esr-autocomplete {
    position: relative;
    display: block;
    z-index: 1000;
}

.esr-ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    list-style: none;
    margin: .25rem 0 0;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    max-height: 280px;
    overflow: auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
}

.esr-ac-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    column-gap: .5rem;
    row-gap: 0;
    padding: .35rem .5rem;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.esr-ac-item:last-child {
    border-bottom: none;
}

.esr-ac-item:hover {
    background: #f8f9fa;
}

.esr-ac-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    grid-row: 1 / span 2;
    border-radius: 3px;
}

.esr-ac-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    line-height: 1.3;
}

.esr-ac-artist {
    color: #666;
    font-size: 13px;
    line-height: 1.2;
}

.esr-ac-album {
    color: #999;
    font-size: 12px;
    grid-column: 2;
    line-height: 1.2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .esr-form {
        max-width: 100%;
    }

    .esr-field input,
    .esr-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .esr-form button {
        width: 100%;
        padding: 14px 24px;
    }
}
