/* -------------------------------------------------------
   Athletic Therapy Competency Tracker — stylesheet
------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background: #f0f2f5;
    color: #222;
}

/* Header */
header {
    background: #1a3a5c;
    color: #fff;
    padding: 0 1.5rem;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
}
.site-title { font-size: 1.1rem; font-weight: bold; letter-spacing: .5px; }
nav { display: flex; align-items: center; gap: 1.2rem; }
nav a { color: #cde; text-decoration: none; font-size: .9rem; }
nav a:hover { color: #fff; text-decoration: underline; }
.user-info { font-size: .85rem; color: #9bc; }
.user-info em { font-style: normal; }

/* Main content */
main {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

h1 { font-size: 1.4rem; margin-bottom: 1rem; color: #1a3a5c; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; color: #1a3a5c; border-bottom: 2px solid #c8d8e8; padding-bottom: .3rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }

/* Cards / panels */
.card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 5px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.2rem;
}

/* Alerts */
.alert { padding: .7rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: .95rem; }
.alert-error   { background: #fde; border: 1px solid #f99; color: #800; }
.alert-success { background: #dfd; border: 1px solid #9c9; color: #070; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; font-size: .93rem; }
th { background: #1a3a5c; color: #fff; text-align: left; padding: .55rem .75rem; font-weight: 600; }
td { padding: .5rem .75rem; border-bottom: 1px solid #e4e8ed; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f5f8fc; }
.table-wrap { overflow-x: auto; border: 1px solid #dde3ea; border-radius: 5px; margin-bottom: 1.2rem; }

/* Level badges */
.level { display: inline-block; padding: .15rem .55rem; border-radius: 3px; font-weight: bold; font-size: .88rem; }
.level-1 { background: #d6eaff; color: #1040a0; }
.level-2 { background: #fff0cc; color: #805000; }
.level-3 { background: #d4f5d4; color: #0a5a0a; }
.level-none { color: #aaa; font-style: italic; }

/* Category section in competency view */
.category-section { margin-bottom: 2rem; }
.category-title { font-size: 1.1rem; font-weight: bold; color: #1a3a5c; margin-bottom: .5rem; }

/* Forms */
.form-group { margin-bottom: .9rem; }
label { display: block; font-weight: bold; margin-bottom: .25rem; font-size: .9rem; }
input[type=text],
input[type=password],
input[type=number],
select,
textarea {
    width: 100%;
    padding: .45rem .6rem;
    border: 1px solid #b0bbc8;
    border-radius: 3px;
    font-size: .95rem;
    font-family: inherit;
}
input[type=text]:focus,
input[type=password]:focus,
select:focus,
textarea:focus { outline: none; border-color: #1a3a5c; box-shadow: 0 0 0 2px rgba(26,58,92,.15); }
textarea { resize: vertical; min-height: 60px; }

/* Inline radio group for level */
.radio-group { display: flex; gap: .4rem; align-items: center; flex-wrap: nowrap; }
.radio-group label { font-weight: normal; display: flex; align-items: center; gap: .2rem; cursor: pointer; }
.radio-group input[type=radio] { width: auto; margin: 0; }
.radio-group input[type=radio]:checked + .level { font-weight: bold; background-color: #e0f0ff; border: 2px solid #0066cc; }
.radio-group .level { padding: .1rem .4rem; font-size: .8rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: .45rem 1.1rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: .93rem;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary   { background: #1a3a5c; color: #fff; }
.btn-primary:hover { background: #265080; }
.btn-danger    { background: #c0392b; color: #fff; }
.btn-danger:hover  { background: #a93226; }
.btn-secondary { background: #e0e6ed; color: #333; }
.btn-secondary:hover { background: #ccd3dc; }
.btn-sm { padding: .25rem .65rem; font-size: .85rem; }

/* Dashboard tiles */
.tile-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.tile {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 5px;
    padding: 1.2rem 1.5rem;
    min-width: 200px;
    text-decoration: none;
    color: #222;
    transition: box-shadow .15s;
}
.tile:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.tile h3 { color: #1a3a5c; margin-bottom: .3rem; }
.tile p { font-size: .88rem; color: #666; }

/* Evaluate page */
.eval-table th, .eval-table td { vertical-align: middle; }
.competency-name { font-weight: bold; font-size: .9rem; }
.competency-desc { font-size: .75rem; color: #888; margin-top: .1rem;
                   display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                   overflow: hidden; line-height: 1.4; }

/* Sticky save bar */
.save-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 2px solid #1a3a5c;
    padding: .75rem 1.5rem;
    display: flex;
    justify-content: flex-start;
    gap: .8rem;
    margin: 0 -1rem;
}

/* Comments */
.comment-history { margin-bottom: .4rem; }
.comment-entry {
    background: #f5f8fc;
    border-left: 3px solid #b0c8e0;
    padding: .35rem .6rem;
    margin-bottom: .35rem;
    border-radius: 0 3px 3px 0;
}
.comment-meta {
    font-size: .8rem;
    font-weight: bold;
    color: #1a3a5c;
    display: block;
    margin-bottom: .15rem;
}
.comment-text { font-size: .9rem; color: #333; }
.text-muted { color: #888; font-size: .88rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Progress bars ─────────────────────────────────────────────────────────── */
.progress-wrap  { margin: .5rem 0 .8rem; }
.progress-bar   { display: flex; height: 18px; border-radius: 4px; overflow: hidden;
                  border: 1px solid #b0bac6; width: 100%; background: #cdd5de; }
.progress-seg   { height: 100%; transition: width .3s ease; }
.progress-seg-0 { background: #cdd5de; }   /* unrated – grey  */
.progress-seg-1 { background: #1040a0; }   /* level 1 – blue  */
.progress-seg-2 { background: #b06000; }   /* level 2 – amber */
.progress-seg-3 { background: #1a7f37; }   /* level 3 – green */
.level-4 { background: #e9d5ff; color: #5b21b6; }
.level-5 { background: #ccfbf1; color: #0f766e; }
.progress-seg-4 { background: #7c3aed; }
.progress-seg-5 { background: #0f766e; }

/* Edit comment button */
.btn-edit-comment { background: none; border: 1px solid #b0bac6; border-radius: 3px;
                    color: #555; font-size: .72rem; padding: .05rem .35rem; cursor: pointer;
                    margin-left: .4rem; vertical-align: middle; line-height: 1.4; }
.btn-edit-comment:hover { background: #e8edf3; color: #222; }

/* -------------------------------------------------------
   Mobile-responsive layout
   ------------------------------------------------------- */

/* Header / nav */
@media (max-width: 700px) {
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding: .5rem 0;
    gap: .3rem;
  }
  .site-title { font-size: 1rem; }
  nav { gap: .7rem; flex-wrap: wrap; }
  nav a { font-size: .82rem; }
  .user-info { font-size: .78rem; width: 100%; padding-bottom: .3rem; }
}

/* Main padding */
@media (max-width: 700px) {
  main { padding: 0 .5rem; margin-top: 1rem; }
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1rem; }
}

/* Evaluate table — card layout on mobile */
@media (max-width: 700px) {
  .eval-table thead { display: none; }
  .eval-table tr {
    display: block;
    border: 1px solid #dde3ea;
    border-radius: 5px;
    margin-bottom: .8rem;
    background: #fff;
    padding: .5rem .7rem;
  }
  .eval-table td {
    display: block;
    padding: .3rem 0;
    border: none;
  }
  .eval-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: .78rem;
    color: #666;
    display: block;
    margin-bottom: .15rem;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .eval-table td textarea { width: 100%; }
  /* Remove table-wrap border when stacked */
  .table-wrap:has(.eval-table) {
    border: none;
    border-radius: 0;
    overflow: visible;
  }
}

/* Radio group on mobile — touch-friendly */
@media (max-width: 700px) {
  .radio-group { gap: .6rem; }
  .radio-group .level { padding: .2rem .55rem; font-size: .9rem; }
  .radio-group input[type=radio] { width: 16px; height: 16px; }
}

/* Milestone table in epa.php — horizontal scroll on mobile */
@media (max-width: 700px) {
  .ms-table { font-size: .8rem; }
  .ms-table td, .ms-table th { padding: .3rem .4rem; }
}

/* Tiles — single column on mobile */
@media (max-width: 500px) {
  .tile-grid { flex-direction: column; }
  .tile { min-width: unset; }
}

/* Cards */
@media (max-width: 700px) {
  .card { padding: .8rem; }
}

/* Login card margin on small screens */
@media (max-width: 500px) {
  .card { margin-left: .5rem; margin-right: .5rem; }
}

/* Save bar */
@media (max-width: 700px) {
  .save-bar { padding: .6rem 1rem; }
}
