/**
 * Primer3 PCR Primer Design Tool Styles
 * 
 * @author Quantabio
 */

/* ---- Tool Wrapper ---- */
.primer3-tool-wrap {
    padding: 40px 30px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: inherit;
}

/* ---- Instructions accordion ---- */
.p3-instructions {
    margin-bottom: 28px;
    border: 1px solid #c8d8e8;
    border-radius: 8px;
    overflow: hidden;
}

.p3-instr-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #eef4fa;
    color: #004877;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 13px 18px;
    border: none;
    cursor: pointer;
    text-align: left;
    gap: 10px;
    transition: background 0.15s;
}

.p3-instr-toggle:hover {
    background: #ddeaf5;
}

.p3-instr-toggle::after {
    content: '▶';
    font-size: 11px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.p3-instr-toggle:not(.collapsed)::after {
    transform: rotate(90deg);
}

.p3-instr-body {
    padding: 18px 22px 20px;
    background: #fff;
    color: #333;
    font-size: 1.5rem;
    line-height: 1.65;
    border-top: 1px solid #c8d8e8;
}

.p3-instr-body p {
    margin: 0 0 14px;
}

.p3-instr-body h4 {
    color: #004877;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 16px 0 6px;
}

.p3-instr-body h4:first-of-type {
    margin-top: 0;
}

.p3-instr-body ul {
    margin: 0 0 10px 0;
    padding-left: 22px;
}

.p3-instr-body ul li {
    margin-bottom: 5px;
}

/* ---- Header ---- */
.primer3-header {
    margin-bottom: 30px;
}

.primer3-header h1 {
    color: #004877;
    font-size: 3.5rem;
    margin-bottom: 8px;
}

.primer3-header p {
    color: #004877;
    font-size: 1.15rem;
    font-weight: 600;
}

/* ---- Layout ---- */
.primer3-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .primer3-layout {
        grid-template-columns: 1fr !important;
    }
}

/* ---- Panel card ---- */
.primer3-panel {
    background: #fff;
    border: 1px solid #dde4ec;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.primer3-panel h2 {
    color: #004877;
    font-size: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* ---- Form fields ---- */
.p3-field {
    margin-bottom: 16px;
}

.p3-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.p3-task-picker label {
    color: #004877;
    font-size: 1.5rem;
}

.p3-task-picker label::after {
    margin-left: 6px;
    color: #004877;
}

.p3-field .p3-required {
    color: #e14504;
}

.p3-field input,
.p3-field textarea,
.p3-field select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #c8d4df;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    color: #222;
    background: #fafcff;
    transition: border-color .2s;
    box-sizing: border-box;
}

.p3-field select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 36px;
    background-image: linear-gradient(45deg, transparent 50%, #5a6d80 50%), linear-gradient(135deg, #5a6d80 50%, transparent 50%);
    background-position: calc(100% - 17px) calc(50% - 3px), calc(100% - 11px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.p3-field input:focus,
.p3-field textarea:focus,
.p3-field select:focus {
    outline: none;
    border-color: #004877;
    box-shadow: 0 0 0 3px rgba(0, 72, 119, .1);
}

.p3-field textarea {
    min-height: 130px;
    resize: vertical;
}

.p3-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.p3-help {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* ---- Check Primers Section ---- */
.p3-check-primers-section {
    background: #f0f7ff;
    border: 1px solid #c5ddf5;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.p3-check-primers-section .p3-field {
    margin-bottom: 12px;
}

.p3-check-primers-section .p3-field:last-child {
    margin-bottom: 0;
}

.p3-seq-stats {
    background: #eef4fa;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 13px;
    color: #004877;
    margin-top: 6px;
}

/* ---- Advanced toggle ---- */
.p3-toggle {
    cursor: pointer;
    color: #004877;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 8px 0 4px;
    user-select: none;
}

.p3-toggle::after {
    content: ' ▶';
    font-size: 11px;
}

.p3-toggle:not(.collapsed)::after {
    content: ' ▼';
}

.p3-advanced {
    padding-top: 10px;
}

/* ---- Buttons ---- */
.primer3-tool-wrap .btn-submit {
    width: 100%;
    margin-top: 15px;
}

.primer3-tool-wrap .btn-example {
    width: 100%;
    margin-top: 8px;
    background: #f0f4f8;
    color: #004877;
    border: 1px solid #c0ccd8;
}

.primer3-tool-wrap .btn-example:hover {
    background: #e5eaf0;
}

/* ---- Loading spinner ---- */
.p3-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #dde4ec;
    border-top-color: #004877;
    border-radius: 50%;
    animation: p3spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes p3spin {
    to {
        transform: rotate(360deg);
    }
}

.p3-loading {
    text-align: center;
    padding: 40px;
}

.p3-loading p {
    color: #555;
}

/* ---- Result cards ---- */
.p3-pair {
    background: #f7fafd;
    border: 1px solid #dde4ec;
    border-left: 4px solid #004877;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 14px;
}

.p3-pair.best {
    border-left-color: #e14504;
    background: #fff8f6;
}

.p3-pair h3 {
    font-size: 14px;
    color: #004877;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.p3-pair.best h3 {
    color: #e14504;
}

.p3-badge {
    background: #e14504;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.p3-sequences {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.p3-seq-box {
    background: #fff;
    border: 1px solid #dde4ec;
    border-radius: 5px;
    padding: 10px;
}

.p3-seq-box .p3-seq-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}

.p3-seq-box .p3-seq-val {
    font-family: inherit;
    font-size: 13px;
    color: #004877;
    font-weight: bold;
    word-break: break-all;
}

.p3-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.p3-stat {
    text-align: center;
    background: #fff;
    border: 1px solid #dde4ec;
    border-radius: 5px;
    padding: 8px 4px;
}

.p3-stat .val {
    font-size: 15px;
    font-weight: bold;
    color: #004877;
}

.p3-stat .lbl {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

/* ---- Error box ---- */
.p3-error {
    background: #fff3f0;
    border: 1px solid #e14504;
    border-radius: 6px;
    padding: 15px;
    color: #b33000;
    font-size: 14px;
}

/* ---- Summary bar ---- */
.p3-summary {
    background: #eef4fa;
    border-radius: 5px;
    padding: 8px 14px;
    font-size: 13px;
    color: #004877;
    margin-bottom: 15px;
}

/* ---- Check-primers property table (Primer3Plus style) ---- */\n.primer3plus_oligo_box {\n    border: 1px solid #b8d0e8;\n    border-radius: 5px;\n    margin-bottom: 16px;\n    overflow: hidden;\n}\n.primer3plus_oligo_title {\n    background: #d0e8f5;\n    color: #003a5c;\n    font-weight: 600;\n    font-size: 13px;\n    padding: 6px 12px;\n    border-bottom: 1px solid #b8d0e8;\n}\n.primer3plus_table {\n    width: 100%;\n    border-collapse: collapse;\n    font-size: 13px;\n}\n.primer3plus_table tr:nth-child(even) { background: #f0f7fc; }\n.primer3plus_cell_label {\n    padding: 5px 12px;\n    color: #555;\n    font-weight: 500;\n    width: 35%;\n    white-space: nowrap;\n}\n.primer3plus_cell_val {\n    padding: 5px 12px;\n    font-family: monospace;\n    word-break: break-all;\n}\n\n/* ---- Check-primers property table (old p3-prop-table kept for compat) ---- */
.p3-prop-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 6px;
}
.p3-prop-table tr:nth-child(odd) { background: #f5f8fb; }
.p3-prop-label {
    padding: 5px 10px;
    color: #555;
    font-weight: 500;
    width: 50%;
}
.p3-prop-val {
    padding: 5px 10px;
    font-family: inherit;
    word-break: break-all;
}

/* ---- Placeholder message ---- */
.p3-placeholder {
    color: #888;
    text-align: center;
    padding: 60px 20px;
}

/* ---- Footer ---- */
.primer3-footer {
    margin-top: 30px;
    color: #888;
    font-size: 13px;
    text-align: center;
}

.primer3-footer a {
    color: #004877;
}

.primer3-footer a:hover {
    text-decoration: underline;
}
