/* ============================================================
   QOTF Affiliate Manager — Frontend Styles
   Scoped to .qotf-* to avoid Flatsome theme conflicts
   ============================================================ */

/* ── Wrapper ────────────────────────────────────────────────── */
.qotf-wrap {
    max-width: 860px;
    margin: 0 auto;
    font-family: inherit;
}

/* ── Messages ───────────────────────────────────────────────── */
.qotf-message {
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 24px;
    border-left: 4px solid;
}
.qotf-message p { margin: 0; }
.qotf-message--success { background: #f0faf0; border-color: #4caf50; color: #2e7d32; }
.qotf-message--warning { background: #fff8e5; border-color: #f0b429; color: #7a5a00; }
.qotf-message--error   { background: #fff0f0; border-color: #e53935; color: #b71c1c; }
.qotf-message--info    { background: #f0f6ff; border-color: #4a90d9; color: #1a4a7a; }

/* ── Cards ──────────────────────────────────────────────────── */
.qotf-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}
.qotf-card h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.qotf-card--referral { border-color: #c8e6c9; background: #f9fff9; }
.qotf-card--info     { border-color: #e0e0e0; background: #fafafa; }

/* ── Referral Link ──────────────────────────────────────────── */
.qotf-referral-link {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.qotf-referral-link input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background: #f5f5f5;
    color: #333;
}
.qotf-copy-confirm {
    display: inline-block;
    color: #4caf50;
    font-size: 13px;
    margin-left: 8px;
    font-weight: 600;
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.qotf-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.qotf-stat-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.qotf-stat-card__icon  { font-size: 24px; }
.qotf-stat-card__label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #888; font-weight: 600; }
.qotf-stat-card__value { font-size: 28px; font-weight: 700; color: #2d5a27; }
.qotf-stat-card__hint  { font-size: 12px; color: #888; }

/* ── Progress Bar ───────────────────────────────────────────── */
.qotf-progress-bar {
    height: 12px;
    background: #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}
.qotf-progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #2e7d32);
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* ── Table ──────────────────────────────────────────────────── */
.qotf-table-wrap { overflow-x: auto; }
.qotf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.qotf-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.qotf-table td {
    padding: 12px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.qotf-table tr:last-child td { border-bottom: none; }
.qotf-table tr:hover td { background: #fafafa; }

/* ── Badges ─────────────────────────────────────────────────── */
.qotf-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.qotf-badge--pending  { background: #fff3e0; color: #e65100; }
.qotf-badge--approved { background: #e8f5e9; color: #2e7d32; }
.qotf-badge--payable  { background: #e3f2fd; color: #1565c0; }
.qotf-badge--paid     { background: #f3e5f5; color: #6a1b9a; }
.qotf-badge--rejected { background: #ffebee; color: #b71c1c; }

/* ── Dashboard header ───────────────────────────────────────── */
.qotf-dashboard__header {
    margin-bottom: 28px;
}
.qotf-dashboard__header h2 {
    margin: 0 0 4px;
    font-size: 24px;
    color: #2d5a27;
}
.qotf-dashboard__subtitle {
    margin: 0;
    color: #777;
    font-size: 15px;
}

/* ── Application Form ───────────────────────────────────────── */
.qotf-apply-form {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 32px;
}
.qotf-form-row {
    margin-bottom: 20px;
}
.qotf-form-row--half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.qotf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.qotf-field label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.qotf-field input,
.qotf-field select,
.qotf-field textarea {
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
}
.qotf-field input:focus,
.qotf-field select:focus,
.qotf-field textarea:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}
.qotf-field-hint {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}
.qotf-required { color: #e53935; }

/* ── Buttons ────────────────────────────────────────────────── */
.qotf-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    text-decoration: none;
}
.qotf-btn--primary {
    background: #2d5a27;
    color: #fff;
}
.qotf-btn--primary:hover {
    background: #1e3d1a;
    color: #fff;
}
.qotf-btn--copy {
    background: #f0f0f0;
    color: #333;
    padding: 10px 18px;
    font-size: 14px;
    white-space: nowrap;
}
.qotf-btn--copy:hover { background: #e0e0e0; }

.qotf-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .qotf-form-row--half { grid-template-columns: 1fr; }
    .qotf-referral-link  { flex-direction: column; }
    .qotf-stats-grid     { grid-template-columns: 1fr 1fr; }
    .qotf-apply-form     { padding: 20px; }
}

/* ============================================================
   QOTF Share & Promote Page
   ============================================================ */

.qotf-promote__header { margin-bottom: 28px; }
.qotf-promote__header h2 { margin: 0 0 4px; font-size: 24px; color: #2d5a27; }
.qotf-promote__subtitle { margin: 0; color: #777; font-size: 15px; }
.qotf-promote__intro { color: #555; margin: 0 0 16px; font-size: 14px; line-height: 1.6; }

/* Quick nav */
.qotf-promote__nav {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 28px;
}
.qotf-promote__nav a {
    display: inline-block; padding: 7px 14px;
    background: #f0f7f0; border: 1px solid #c8e6c9;
    border-radius: 20px; font-size: 13px; font-weight: 600;
    color: #2d5a27; text-decoration: none; transition: background .2s;
}
.qotf-promote__nav a:hover { background: #c8e6c9; color: #1a3d18; }

/* Copy row */
.qotf-copy-row { display: flex; gap: 10px; align-items: center; }
.qotf-copy-input {
    flex: 1; padding: 10px 14px;
    border: 1px solid #ccc; border-radius: 5px;
    font-size: 14px; background: #f8f8f8; color: #333;
}

/* Coupon card */
.qotf-card--coupon { border-color: #ffe082; background: #fffde7; }
.qotf-coupon-code {
    display: inline-block; padding: 12px 24px;
    background: #fff; border: 2px dashed #f0b429;
    border-radius: 6px; font-size: 24px; font-weight: 700;
    letter-spacing: .12em; color: #7a5a00;
}

/* Product link generator */
.qotf-link-generator { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qotf-link-generator input { flex: 1; min-width: 200px; }

/* Message grid */
.qotf-message-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.qotf-message-card {
    background: #fafafa; border: 1px solid #e8e8e8;
    border-radius: 8px; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.qotf-message-card__label {
    font-size: 13px; font-weight: 700; color: #333;
    display: flex; justify-content: space-between; align-items: center;
}
.qotf-message-card__platform {
    font-size: 11px; font-weight: 400; color: #888;
    background: #f0f0f0; padding: 2px 8px; border-radius: 10px;
}
.qotf-message-card__text {
    width: 100%; padding: 10px; box-sizing: border-box;
    border: 1px solid #ddd; border-radius: 5px;
    font-size: 13px; line-height: 1.6; color: #444;
    background: #fff; resize: vertical; font-family: inherit;
}
.qotf-message-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* WhatsApp button */
.qotf-btn--whatsapp {
    background: #25d366; color: #fff;
    padding: 8px 14px; border-radius: 5px;
    font-size: 13px; font-weight: 600;
    text-decoration: none; display: inline-flex;
    align-items: center; gap: 4px; transition: background .2s;
}
.qotf-btn--whatsapp:hover { background: #1da851; color: #fff; }

/* Small button variant */
.qotf-btn--sm { padding: 7px 14px; font-size: 13px; }

/* Email swipes */
.qotf-email-list { display: flex; flex-direction: column; gap: 20px; }
.qotf-email-card {
    background: #fafafa; border: 1px solid #e8e8e8;
    border-radius: 8px; padding: 20px;
}
.qotf-email-card__header { margin-bottom: 14px; font-size: 14px; color: #333; }
.qotf-email-card__subject { margin-bottom: 14px; }
.qotf-email-card__subject label,
.qotf-email-card__body label {
    display: block; font-size: 12px; font-weight: 600;
    color: #888; text-transform: uppercase; letter-spacing: .04em;
    margin-bottom: 6px;
}

/* Testimonial card */
.qotf-card--testimonial { border-color: #c8e6c9; background: #f9fff9; }
.qotf-card--testimonial p { color: #444; line-height: 1.7; margin-bottom: 12px; }
.qotf-testimonial-prompt {
    background: #fff; border: 1px solid #c8e6c9;
    border-radius: 6px; padding: 16px; margin-top: 12px;
}
.qotf-testimonial-prompt strong { display: block; margin-bottom: 8px; color: #2d5a27; }
.qotf-testimonial-prompt ul { margin: 0; padding-left: 20px; }
.qotf-testimonial-prompt li { color: #555; margin-bottom: 6px; font-size: 14px; line-height: 1.5; }

/* Media grid */
.qotf-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.qotf-media-item {
    background: #fafafa; border: 1px solid #e8e8e8;
    border-radius: 8px; padding: 12px;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    text-align: center;
}
.qotf-media-item__thumb img {
    width: 100%; max-height: 120px;
    object-fit: cover; border-radius: 4px;
}
.qotf-media-item__label { font-size: 13px; font-weight: 600; color: #333; }
.qotf-media-item__size  { font-size: 11px; color: #888; }

/* Responsive */
@media (max-width: 600px) {
    .qotf-message-grid { grid-template-columns: 1fr; }
    .qotf-link-generator { flex-direction: column; }
    .qotf-copy-row { flex-direction: column; }
    .qotf-promote__nav a { font-size: 12px; padding: 6px 10px; }
}

/* ============================================================
   Dashboard Refresh
   ============================================================ */

/* Hero header */
.qotf-dashboard__hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #1e3d1a 0%, #2d5a27 60%, #3d7a35 100%);
    border-radius: 12px;
    flex-wrap: wrap;
}
.qotf-dashboard__hero-text h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #fff;
}
.qotf-dashboard__hero .qotf-dashboard__subtitle {
    margin: 0;
    color: rgba(255,255,255,0.75);
    font-size: 15px;
}

/* Promote button */
.qotf-btn--promote {
    display: inline-block;
    padding: 13px 24px;
    background: #fff;
    color: #2d5a27;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s, transform .1s;
    border: none;
    cursor: pointer;
}
.qotf-btn--promote:hover {
    background: #f0faf0;
    color: #1a3d18;
    transform: translateY(-1px);
}

/* Bottom promote CTA bar */
.qotf-dashboard__promote-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: #f0f7f0;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.qotf-dashboard__promote-cta-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.qotf-dashboard__promote-cta-text strong {
    font-size: 15px;
    color: #2d5a27;
}
.qotf-dashboard__promote-cta-text span {
    font-size: 13px;
    color: #666;
}
.qotf-dashboard__promote-cta .qotf-btn--promote {
    background: #2d5a27;
    color: #fff;
    font-size: 14px;
    padding: 11px 20px;
}
.qotf-dashboard__promote-cta .qotf-btn--promote:hover {
    background: #1e3d1a;
    color: #fff;
}

@media (max-width: 600px) {
    .qotf-dashboard__hero { flex-direction: column; align-items: flex-start; padding: 20px; }
    .qotf-dashboard__promote-cta { flex-direction: column; align-items: flex-start; }
}
