/* ==========================================================
   Simple Surveys — Frontend Styles
   Theme colors: Primary #005594 | Accent #2277B6
   ========================================================== */

.mts-survey-wrap {
    max-width: 680px;
    margin: 1.5em auto;
    font-family: inherit;
    line-height: 1.5;
}

/* Description banner */
.mts-description {
    background: #f0f6ff;
    border-left: 4px solid #005594;
    padding: .9em 1.25em;
    margin-bottom: 1.5em;
    border-radius: 0 4px 4px 0;
    color: #333;
}

/* --- Email field ----------------------------------------- */
.mts-field {
    margin-bottom: 1.5em;
}
.mts-field label {
    display: block;
    font-weight: 600;
    margin-bottom: .4em;
    color: #222;
}
.mts-field input[type="email"] {
    width: 100%;
    max-width: 360px;
    padding: .55em .75em;
    border: 2px solid #bbb;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color .2s;
    box-sizing: border-box;
}
.mts-field input[type="email"]:focus {
    border-color: #005594;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,85,148,.15);
}
.mts-required { color: #c00; }
.mts-hint {
    display: block;
    font-size: .83em;
    color: #666;
    margin-top: .35em;
}

/* --- Ranking section ------------------------------------- */
.mts-ranking-title {
    color: #005594;
    margin: 0 0 .75em;
    font-size: 1.05em;
}
.mts-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.mts-ranking-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #c8d8e8;
}
.mts-ranking-table thead th {
    background: #005594;
    color: #fff;
    padding: .65em 1em;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}
.mts-ranking-table thead th.mts-option-col { text-align: left; min-width: 180px; }
.mts-ranking-table thead th.mts-rank-col   { min-width: 90px; }

.mts-ranking-table tbody tr { transition: background .12s; }
.mts-ranking-table tbody tr:nth-child(odd)  { background: #fff; }
.mts-ranking-table tbody tr:nth-child(even) { background: #f4f8fc; }
.mts-ranking-table tbody tr:hover           { background: #e6f0f9; }

/* Row highlight when a rank is selected */
.mts-ranking-table tbody tr[class*="mts-sel-"] { background: #e6f0f9 !important; }
.mts-ranking-table tbody tr.mts-sel-1 { background: #cce0f5 !important; }
.mts-ranking-table tbody tr.mts-sel-2 { background: #d5ecd5 !important; }
.mts-ranking-table tbody tr.mts-sel-3 { background: #fff3cc !important; }

.mts-option-label {
    padding: .6em 1em;
    font-weight: 500;
    color: #1a1a1a;
}
.mts-rank-cell {
    text-align: center;
    padding: .5em .4em;
    border-left: 1px solid #dde8f0;
}

/* Custom radio circle */
.mts-radio-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: auto;
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s;
}
.mts-radio-wrap:hover { background: rgba(0,85,148,.12); }
.mts-radio {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #005594;
}

/* --- Messages ------------------------------------------- */
.mts-messages {
    padding: .75em 1.1em;
    border-radius: 4px;
    margin: 1em 0;
    font-weight: 500;
}
.mts-messages.mts-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #b8ddc5;
}
.mts-messages.mts-error-msg {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

/* --- Submit button --------------------------------------- */
.mts-submit-btn {
    display: inline-block;
    background: #005594;
    color: #fff !important;
    border: none;
    padding: .7em 2.2em;
    font-size: 1em;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1.1em;
    transition: background .2s;
    text-decoration: none;
}
.mts-submit-btn:hover:not(:disabled) { background: #2277B6; }
.mts-submit-btn:disabled { background: #8aabbf; cursor: not-allowed; }

/* Error text (shortcode-level) */
.mts-error { color: #721c24; font-style: italic; }

/* --- Questions (frontend) -------------------------------- */
.mts-question {
    margin-bottom: 1.75em;
    padding-bottom: 1.25em;
    border-bottom: 1px solid #e3ebf3;
}
.mts-question:last-of-type { border-bottom: none; }
.mts-question-title {
    color: #005594;
    margin: 0 0 .6em;
    font-size: 1.05em;
}

/* Choice lists (radio / checkbox / yes-no) */
.mts-choices { display: flex; flex-direction: column; gap: .5em; }
.mts-choice {
    display: flex;
    align-items: center;
    gap: .55em;
    padding: .45em .7em;
    border: 1px solid #d3dfea;
    border-radius: 4px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.mts-choice:hover { background: #f0f6ff; border-color: #2277B6; }
.mts-choice input { accent-color: #005594; width: 17px; height: 17px; }

/* Text / number / date inputs */
.mts-input {
    width: 100%;
    max-width: 360px;
    padding: .55em .75em;
    border: 2px solid #bbb;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color .2s;
}
.mts-input.mts-textarea { max-width: 100%; }
.mts-input:focus {
    border-color: #005594;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,85,148,.15);
}

/* --- Results (admin) ------------------------------------- */
.mts-result-block {
    margin: 0 0 1.75em;
    padding: 1em 1.25em;
    background: #fbfdff;
    border: 1px solid #dce7f2;
    border-radius: 5px;
}
.mts-result-block h3 { margin-top: 0; color: #005594; }
.mts-qtype { font-size: .8em; font-weight: normal; color: #777; }
.mts-answer-list { margin: 0; }
.mts-answer-list dt { font-weight: 600; color: #333; }
.mts-answer-list dd { margin: 0 0 .5em; color: #444; }

/* --- Question builder (admin) ---------------------------- */
.mts-q-block {
    background: #fff;
    border: 1px solid #ccd6e0;
    border-left: 4px solid #005594;
    border-radius: 4px;
    padding: 1em 1.15em;
    margin-bottom: 1em;
}
.mts-q-head {
    display: flex;
    align-items: center;
    gap: .75em;
    flex-wrap: wrap;
    margin-bottom: .6em;
}
.mts-q-drag { color: #8aa; cursor: default; }
.mts-q-req { white-space: nowrap; }
.mts-q-move { margin-left: auto; }
.mts-q-move .button-link { text-decoration: none; font-size: 1.1em; padding: 0 .25em; }
.mts-q-text-input { margin-bottom: .6em; }
.mts-q-panel {
    margin-top: .5em;
    padding: .5em .75em;
    background: #f6f9fc;
    border-radius: 3px;
}
.mts-q-panel label { font-weight: 600; display: inline-block; margin-bottom: .25em; }

/* --- Survey list shortcode ------------------------------- */
.mts-survey-list {
    list-style: none;
    margin: 0 0 1.5em;
    padding: 0;
}
.mts-survey-list li {
    padding: .65em 0;
    border-bottom: 1px solid #e4eaf2;
}
.mts-survey-list li:last-child { border-bottom: none; }
.mts-survey-list a {
    font-weight: 600;
    color: #005594;
    text-decoration: none;
    font-size: 1.05em;
}
.mts-survey-list a:hover { text-decoration: underline; color: #2277B6; }

/* --- Live / public results section ----------------------- */
.mts-live-results {
    margin-top: 2.5em;
    padding-top: 1.5em;
    border-top: 2px solid #005594;
}
.mts-live-results > h3 {
    margin-top: 0;
    color: #005594;
}

/* --- Responsive ----------------------------------------- */
@media (max-width: 500px) {
    .mts-ranking-table thead th,
    .mts-option-label,
    .mts-rank-cell { padding: .4em .5em; font-size: .88em; }
    .mts-ranking-table thead th.mts-rank-col { min-width: 64px; }
}
