/**
 * Tutor Referral Suite - Frontend Styles
 */

/* Generic form wrapper */
.trs-form-wrapper {
    max-width: 480px;
    margin: 30px auto;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.trs-form-wrapper h2 {
    margin-top: 0;
}

.trs-form-wrapper p {
    margin-bottom: 12px;
}

.trs-form-wrapper input,
.trs-form-wrapper button {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.trs-form-wrapper button {
    background: #00297a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.trs-form-wrapper button:hover {
    background: #001f57;
}

/* Messages */
.trs-errors p {
    background: #ffe6e6;
    border-left: 5px solid #cc0000;
    padding: 10px;
    margin: 10px 0;
}

.trs-success p {
    background: #e9ffe8;
    border-left: 5px solid #2f9e44;
    padding: 10px;
    margin: 10px 0;
}

/* Introducer dashboard main layout */
.trs-introducer-dashboard {
    max-width: 1080px;
    margin: 30px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.trs-introducer-dashboard h2 {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    margin-bottom: 20px;
    border-bottom: 3px solid #00297a;
    padding-bottom: 8px;
}

/* Top info box (referral code + link) */
.trs-box {
    background: #f6faff;
    border: 1px solid #d7e8ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.trs-introducer-dashboard h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 0;
    color: #00297a;
}

/* Referral link input */
.trs-ref-link {
    width: 100%;
    padding: 10px;
    border: 1px solid #b5d3f7;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    margin: 4px 0;
}

/* Stats row */
.trs-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.trs-stat-box {
    flex: 1;
    min-width: 160px;
    background: #e8f3ff;
    border-left: 5px solid #00297a;
    padding: 14px;
    border-radius: 6px;
    text-align: center;
}

.trs-stat-number {
    font-size: 22px;
    font-weight: 700;
    color: #00297a;
}

.trs-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #333;
}

/* Copy buttons */
.trs-copy-btn {
    background: #00297a;
    border: none;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    margin-left: 8px;
    cursor: pointer;
}

.trs-copy-btn:hover {
    background: #001f57;
}

.trs-copy-msg {
    opacity: 0;
    transition: 0.3s;
    margin-left: 6px;
    color: green;
    font-size: 12px;
}

/* Search input */
#trs-search {
    width: 260px;
    max-width: 100%;
    padding: 7px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 18px;
}

/* Student cards grid */
.trs-students-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* Single student card */
.trs-student-card {
    flex: 1 1 320px;
    max-width: calc(50% - 8px);
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e0e7ff;
}

/* Card header */
.trs-student-card-header {
    background: #00297a;
    color: #ffffff;
    padding: 12px 14px;
}

.trs-student-name {
    font-size: 16px;
    font-weight: 600;
}

.trs-student-meta {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

/* Card body */
.trs-student-card-body {
    background: #f6faff;
    padding: 12px 14px 14px 14px;
}

.trs-student-contact-line {
    font-size: 13px;
    margin-bottom: 10px;
}

.trs-student-contact-line a {
    color: #00297a;
    text-decoration: none;
}

/* Course list */
.trs-course-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.trs-course-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dde7ff;
}

.trs-course-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.trs-course-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Progress bar wrapper */
.trs-progress-wrap {
    position: relative;
    background: #e4edf7;
    height: 14px;
    border-radius: 6px;
    overflow: hidden;
}

/* Filled progress bar */
.trs-progress-bar {
    background: #28a745;
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* Percentage label on bar */
.trs-progress-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    line-height: 14px;
    height: 14px;
    width: 100%;
    text-align: center;
    pointer-events: none;
    color: #ffffff;
    text-shadow: 0 0 3px rgba(0,0,0,0.4);
}

/* Course status text */
.trs-course-status {
    font-size: 12px;
    margin-top: 3px;
    color: #444;
}

/* Card action buttons */
.trs-card-actions {
    margin-top: 10px;
}

.trs-btn-email,
.trs-btn-wa {
    font-size: 13px;
    padding: 6px 10px;
    margin-right: 6px;
    border-radius: 6px;
    text-decoration: none !important;
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.trs-btn-email {
    background: #00297a;
}

.trs-btn-email:hover {
    background: #001f57;
}

.trs-btn-wa {
    background: #25D366;
}

.trs-btn-wa:hover {
    background: #1EBE5A;
}

.trs-btn-email::before {
    content: "📧";
}

.trs-btn-wa::before {
    content: "💬";
}

/* Responsive tweaks */
@media (max-width: 900px) {
    .trs-student-card {
        max-width: 100%;
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .trs-introducer-dashboard {
        padding: 15px;
        margin: 15px auto;
    }

    .trs-introducer-dashboard h2 {
        font-size: 22px;
    }
}

