/* Main Form Container */
#smnaz-form {
    max-width: 1140px;
    margin: 0 auto;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Row Layout for Main Form */
#smnaz-form .row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

#smnaz-form .row label {
    flex: 1 1 calc(50% - 10px);
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 5px;
}

/* Two column layout for bird entries */
.bird-entry .row.two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Row for DNA Test and Disease Tests side by side */
.bird-entry .row.two-col.tests-row {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Left column for DNA Test */
.bird-entry .dna-test-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Right column for Disease Tests */
.bird-entry .disease-test-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Make both columns equal height */
.bird-entry .dna-test-col,
.bird-entry .disease-test-col {
    display: flex;
    flex-direction: column;
}

.bird-entry .dna-test-row,
.bird-entry .disease-tests-row {
    flex: 1;
}

/* ============ COMPACT DNA TEST SECTION ============ */
.bird-entry .dna-test-row {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f5f9ff 0%, #e8f0fe 100%);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #c8e0ff;
    box-shadow: 0 1px 3px rgba(52, 152, 219, 0.05);
    transition: all 0.3s ease;
}

.bird-entry .dna-test-row:hover {
    border-color: #3498db;
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.1);
}

.bird-entry .dna-test-row.error {
    border: 1px solid #e74c3c;
    background: #fef5f5;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.bird-entry .dna-test-row .tests-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.bird-entry .dna-test-row .tests-label .required {
    color: #e74c3c;
    margin-left: 5px;
    font-size: 13px;
}

.bird-entry .dna-yesno-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.bird-entry .dna-yesno-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 500;
    font-size: 12px;
    color: #34495e;
    cursor: pointer;
    padding: 4px 10px;
    background: white;
    border-radius: 20px;
    border: 1px solid #3498db;
    transition: all 0.2s ease;
    min-width: 50px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    flex: 0 1 auto;
}

.bird-entry .dna-yesno-label:hover {
    background: #e8f4fc;
    border-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

.bird-entry .dna-yesno-label input[type="radio"] {
    margin: 0;
    width: 12px;
    height: 12px;
    cursor: pointer;
    accent-color: #3498db;
}

/* Selected state for DNA test - Yes option */
.bird-entry .dna-yesno-label:has(input[value="Yes"]:checked) {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-color: #27ae60;
    color: white;
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.2);
}

.bird-entry .dna-yesno-label:has(input[value="Yes"]:checked) input[type="radio"] {
    accent-color: white;
}

/* Selected state for DNA test - No option */
.bird-entry .dna-yesno-label:has(input[value="No"]:checked) {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: #c0392b;
    color: white;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.2);
}

.bird-entry .dna-yesno-label:has(input[value="No"]:checked) input[type="radio"] {
    accent-color: white;
}

/* Icons for DNA test - smaller */
.bird-entry .dna-yesno-label:has(input[value="Yes"])::before {
    content: "✓";
    font-size: 12px;
    font-weight: bold;
    margin-right: 2px;
}

.bird-entry .dna-yesno-label:has(input[value="No"])::before {
    content: "✗";
    font-size: 12px;
    font-weight: bold;
    margin-right: 2px;
}

/* DNA Test section heading */
.bird-entry .dna-test-heading {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #3498db;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bird-entry .dna-test-heading:before {
    content: "🧬 ";
    font-size: 16px;
    margin-right: 5px;
}

/* ============ COMPACT DISEASE TESTS SECTION ============ */
.bird-entry .disease-tests-row {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.bird-entry .disease-tests-row .tests-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.bird-entry .disease-tests-row .tests-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    flex: 1;
}

.bird-entry .disease-tests-row .tests-group label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: normal;
    font-size: 12px;
    color: #34495e;
    margin: 0;
    cursor: pointer;
    padding: 4px 10px;
    background: #f8f9fa;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex: 0 0 auto;
}

.bird-entry .disease-tests-row .tests-group label:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.bird-entry .disease-tests-row .tests-group label input[type="checkbox"] {
    margin: 0;
    width: 12px;
    height: 12px;
    cursor: pointer;
    accent-color: #e74c3c;
}

/* Custom scrollbar for disease tests */
.bird-entry .disease-tests-row .tests-group::-webkit-scrollbar {
    height: 3px;
}

.bird-entry .disease-tests-row .tests-group::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.bird-entry .disease-tests-row .tests-group::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.bird-entry .disease-tests-row .tests-group::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* ============ DROPDOWN STYLING WITH ARROW ============ */
.bird-entry select,
#smnaz-form select {
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}

.bird-entry select:hover,
#smnaz-form select:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.bird-entry select:focus,
#smnaz-form select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232980b9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

/* Fix for Firefox */
@-moz-document url-prefix() {
    .bird-entry select,
    #smnaz-form select {
        text-indent: 0.01px;
        text-overflow: '';
        padding-right: 30px;
    }
}

/* Fix for IE */
.bird-entry select::-ms-expand,
#smnaz-form select::-ms-expand {
    display: none;
}

/* Style for the default/placeholder option */
.bird-entry select option[value=""],
#smnaz-form select option[value=""] {
    color: #7f8c8d;
    font-style: italic;
}

/* Remove any unwanted text when dropdown is clicked */
.bird-entry select:invalid,
#smnaz-form select:invalid {
    color: #7f8c8d;
}

/* Container for birds */
#bird-wrapper {
    margin-top: 25px;
}

/* Each bird entry */
.bird-entry {
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
    background: #fafafa;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.bird-entry:hover {
    border-color: #3498db;
    box-shadow: 0 4px 10px rgba(52,152,219,0.1);
}

/* Row layout for bird entries */
.bird-entry .row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

/* Label styling for bird entries */
.bird-entry .row label {
    flex: 1 1 calc(50% - 10px);
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

/* ============ GENETIC TESTS SECTION ============ */
.bird-entry .genetic-tests-row {
    margin-bottom: 20px;
    width: 100%;
    background: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #d4e4f5;
}

.bird-entry .genetic-tests-row .tests-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.bird-entry .genetic-tests-row .tests-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.bird-entry .genetic-category {
    flex: 1 1 100%;
    margin-bottom: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.bird-entry .genetic-category:last-child {
    margin-bottom: 0;
}

.bird-entry .genetic-category strong {
    display: block;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.bird-entry .genetic-category label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    font-size: 14px;
    color: #34495e;
    margin-right: 25px;
    cursor: pointer;
    padding: 5px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.bird-entry .genetic-category label:hover {
    background: #e9ecef;
    border-color: #9b59b6;
}

.bird-entry .genetic-category label input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #9b59b6;
}

/* Selected state for genetic tests */
.bird-entry .genetic-category label:has(input:checked) {
    background: #f3e5f5;
    border-color: #9b59b6;
    color: #6a1b9a;
    font-weight: 500;
}

/* No selection message styling */
.bird-entry .genetic-category .no-selection-message p {
    color: #7f8c8d;
    margin: 0;
    padding: 10px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 5px;
    font-style: italic;
}

/* ============ COMMENTS SECTION ============ */
.bird-entry .row:last-of-type {
    margin-bottom: 0;
}

/* Input and textarea styling */
.bird-entry input[type="text"],
.bird-entry input[type="email"],
.bird-entry input[type="tel"],
.bird-entry textarea,
#smnaz-form input[type="text"],
#smnaz-form input[type="email"],
#smnaz-form input[type="tel"] {
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.bird-entry input:focus,
.bird-entry select:focus,
.bird-entry textarea:focus,
#smnaz-form input:focus,
#smnaz-form select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

/* Placeholder styling */
.bird-entry input::placeholder,
.bird-entry textarea::placeholder,
#smnaz-form input::placeholder {
    color: #aaa;
    font-size: 13px;
}

/* Textarea styling */
.bird-entry textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Remove bird button */
.bird-entry .remove-bird {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bird-entry .remove-bird:hover {
    background: #c0392b;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(192,57,43,0.3);
}

/* Add bird button */
#add-bird {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#add-bird:hover {
    background: #2980b9;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(41,128,185,0.3);
}

#add-bird:before {
    content: "+";
    font-size: 18px;
    font-weight: bold;
}

/* Submit button */
#smnaz-submit-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: auto;
    min-width: 200px;
    margin-top: 10px;
}

#smnaz-submit-btn:hover {
    background: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(46,204,113,0.3);
}

#smnaz-submit-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success and Error Messages */
.smnaz-success-message,
.smnaz-error-message {
    padding: 18px 25px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-weight: 500;
    font-size: 16px;
    text-align: center;
    animation: slideDown 0.5s ease;
    display: none;
}

.smnaz-success-message.show,
.smnaz-error-message.show {
    display: block;
}

.smnaz-success-message {
    background: #2ecc71;
    color: white;
    border-left: 5px solid #27ae60;
}

.smnaz-error-message {
    background: #e74c3c;
    color: white;
    border-left: 5px solid #c0392b;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Headings */
#smnaz-form h3 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    margin: 25px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* Animation for new DNA test section */
.bird-entry .dna-test-row {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus state for accessibility */
.bird-entry .dna-yesno-label:focus-within {
    outline: 3px solid rgba(52, 152, 219, 0.3);
    outline-offset: 2px;
}

/* Style for the container of all tests */
.bird-entry .tests-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* ============ RESPONSIVE DESIGN ============ */

/* Tablet & Small Desktop */
@media(max-width: 992px) {
    #smnaz-form {
        padding: 20px;
    }
}

/* Mobile Landscape */
@media(max-width: 768px) {
    #smnaz-form .row label,
    .bird-entry .row label {
        flex: 1 1 100%;
    }
    
    .bird-entry .row.two-col {
        grid-template-columns: 1fr;
    }
    
    .bird-entry .row.two-col.tests-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bird-entry .dna-test-row,
    .bird-entry .disease-tests-row {
        margin-bottom: 0;
    }
    
    /* DNA Test responsive */
    .bird-entry .dna-yesno-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .bird-entry .dna-yesno-label {
        flex: 1 1 auto;
        padding: 6px 12px;
    }
    
    .bird-entry .dna-test-row {
        padding: 12px;
    }
    
    /* Disease Tests responsive */
    .bird-entry .disease-tests-row .tests-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .bird-entry .disease-tests-row .tests-group label {
        flex: 1 1 auto;
        justify-content: center;
    }
    
    /* Genetic Tests responsive */
    .bird-entry .genetic-category label {
        display: block;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .bird-entry .genetic-category label:last-child {
        margin-bottom: 0;
    }
    
    .bird-entry .remove-bird {
        position: relative;
        top: 0;
        right: 0;
        margin-top: 15px;
        width: 100%;
    }
    
    #smnaz-submit-btn {
        width: 100%;
    }
}

/* Mobile Portrait */
@media(max-width: 480px) {
    #smnaz-form {
        padding: 5px;
    }
    
    .bird-entry {
        padding: 20px;
    }
    
    .bird-entry .genetic-category {
        padding: 10px;
    }
    
    #add-bird {
        width: 100%;
        justify-content: center;
    }
}

/* For tablets - specific adjustments */
@media(min-width: 481px) and (max-width: 768px) {
    .bird-entry .dna-yesno-group {
        flex-wrap: nowrap;
    }
    
    .bird-entry .disease-tests-row .tests-group {
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* Print Styles */
@media print {
    #smnaz-form {
        box-shadow: none;
        padding: 0;
    }
    
    .bird-entry .remove-bird,
    #add-bird,
    #smnaz-submit-btn {
        display: none;
    }
    
    .bird-entry {
        break-inside: avoid;
        border: 1px solid #000;
    }
}