/* Public Form Styles - Version 1.2.4 - improved validation */
.hcr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Responsive grid */
@media (max-width: 768px) {
    .hcr-grid-2,
    .hcr-grid-3 {
        grid-template-columns: 1fr;
    }

    .hcr-contest-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .hcr-contest-selector button {
        align-self: flex-start;
    }
}

/* Grid layouts */
.hcr-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.hcr-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.hcr-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.hcr-container h1 {
    text-align: center;
    margin-bottom: 30px;
}

.hcr-message.info {
    background: #e8f5e9;
    border-left: 4px solid #e67e22;
    padding: 15px;
    margin-bottom: 20px;
}

/* Visual separator in the middle */
.hcr-form-layout .hcr-separator {
    flex: 0 0 auto;
    width: 1px;
    background: #ddd;
    margin-right: 20px;
}

/* Hide separator when callsigns list is hidden */
.hcr-callsigns-list.hcr-hidden ~ .hcr-separator {
    display: none;
}

@media (max-width: 768px) {
    .hcr-form-layout .hcr-separator {
        display: none;
    }
}

.hcr-form-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .hcr-form-layout {
        flex-direction: column;
    }
}

.hcr-form-content {
    flex: 3;
    min-width: 0;
}

.hcr-form-content .description {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 3px;
}

.hcr-callsigns-list {
    flex: 1;
    min-width: 0;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.hcr-callsigns-list.hcr-hidden {
    display: none;
}

.hcr-callsigns-list h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.hcr-callsigns-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hcr-callsigns-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    margin-bottom: 5px;
}

/* Form elements */
.hcr-contest-selector {
    margin-bottom: 20px;
}

.hcr-contest-selector select {
    padding: 12px;
    border: 2px solid #0073aa;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    background-color: white;
}

/* Form sections */
.hcr-form-section {
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.hcr-form-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Contest selector with edit button */
.hcr-contest-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Ensure contest selector label is always visible */
.hcr-contest-selector label {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-right: 10px !important;
    font-weight: bold !important;
}

/* Override any WordPress admin styles that might hide the label */
.hcr-contest-selector label[for="hcr-contest-select"] {
    display: inline-block !important;
    visibility: visible !important;
}

/* Force label display even after JS updates */
.hcr-contest-selector label[for="hcr-contest-select"]:not(:first-of-type) {
    display: inline-block !important;
}

.hcr-edit-contest-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.hcr-edit-contest-button:hover {
    background: #005a87;
}

.hcr-radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.hcr-radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.hcr-radio-group input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

/* Grid layout for form fields */
.hcr-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.hcr-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.hcr-name-field {
    margin-bottom: 15px;
}

.hcr-name-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.hcr-name-field input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
}

.hcr-name-field input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.hcr-error-message {
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* Buttons */
.hcr-submit-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
}

.hcr-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.hcr-submit-button:hover:not(:disabled) {
    background: #005a87;
}

/* Required indicators */
.required {
    color: #dc3232;
    margin-left: 3px;
}

#hcr-time-message {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 3px;
    color: #dc3232;
}

.hcr-form-container-hidden {
    display: none !important;
}

/* Form header sections */
.hcr-form-header {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    padding: 20px;
    border-radius: 5px 5px 0 0;
    margin-bottom: 20px;
}

.hcr-form-header h3 {
    margin: 0;
    color: white;
}

/* Form sections */
.hcr-form-section {
    background: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.hcr-form-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Station type radio buttons */
.hcr-radio-group {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.hcr-radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.hcr-radio-group input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

/* Individual names section */
#hcr-individual-names, #hcr-collective-names {
    margin-bottom: 0;
}

#hcr-individual-names .hcr-form-section,
#hcr-collective-names .hcr-form-section {
    background: #f9f9f9;
    margin-bottom: 20px;
}

/* Error highlighting for form fields */
.hcr-name-field input.error {
    border-color: #dc3232;
    background-color: #fff5f5;
    box-shadow: 0 0 5px rgba(220, 50, 50, 0.3);
}

.hcr-error-message {
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.hcr-error-message.show {
    display: block;
}

/* Success message */
.hcr-success-message {
    background: #e8f5e9;
    border: 2px solid #28a745;
    color: #155724;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.hcr-success-message.show {
    display: block;
}

/* Validation summary */
.hcr-validation-summary {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    display: none;
}

.hcr-validation-summary.show {
    display: block;
}