/**
 * Trusted CPD — Frontend styles (My Account area).
 *
 * Scoped under .trustedcpd- prefix to avoid theme conflicts.
 * Designed to work well with default WooCommerce My Account layout.
 */

/* ── Badges ───────────────────────────────────────────────────────────── */

.trustedcpd-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: middle;
}

.trustedcpd-badge--neutral  { background: #f0f0f1; color: #50575e; }
.trustedcpd-badge--info     { background: #e5f5fa; color: #0073aa; }
.trustedcpd-badge--warning  { background: #fcf0c3; color: #6e4e00; }
.trustedcpd-badge--success  { background: #d4edda; color: #155724; }
.trustedcpd-badge--danger   { background: #f8d7da; color: #721c24; }

/* ── Buttons ──────────────────────────────────────────────────────────── */

.trustedcpd-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.trustedcpd-btn--primary {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

a.trustedcpd-btn--primary,
a.trustedcpd-btn--primary:visited {
    color: #fff;
}

.trustedcpd-btn--primary:hover,
.trustedcpd-btn--primary:focus {
    background: #15294a;
    color: #fff;
    text-decoration: none;
}

.trustedcpd-btn--secondary {
    background: #f0f0f1;
    color: #1e3a5f;
    border-color: #c3c4c7;
}

.trustedcpd-btn--secondary:hover,
.trustedcpd-btn--secondary:focus {
    background: #e0e0e0;
    color: #1e3a5f;
    text-decoration: none;
}

.trustedcpd-btn--lg {
    padding: 12px 28px;
    font-size: 16px;
}

/* ── Filter Tabs ──────────────────────────────────────────────────────── */

.trustedcpd-filters {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.trustedcpd-filter-tab {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #50575e;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.trustedcpd-filter-tab:hover {
    color: #1e3a5f;
    text-decoration: none;
}

.trustedcpd-filter-tab--active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
    font-weight: 600;
}

/* ── Application Cards ────────────────────────────────────────────────── */

.trustedcpd-app-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trustedcpd-app-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    background: #fff;
    transition: box-shadow 0.15s ease;
}

.trustedcpd-app-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.trustedcpd-app-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.trustedcpd-app-card__ref {
    font-weight: 700;
    font-size: 15px;
    color: #1e3a5f;
}

.trustedcpd-app-card__body {
    margin-bottom: 12px;
}

.trustedcpd-app-card__meta {
    margin-bottom: 6px;
}

.trustedcpd-app-card__type {
    font-weight: 500;
    color: #1d2327;
}

.trustedcpd-app-card__product {
    margin-left: 8px;
    color: #787c82;
    font-size: 13px;
}

.trustedcpd-app-card__details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: #787c82;
}

.trustedcpd-app-card__footer {
    text-align: right;
}

/* ── Empty State ──────────────────────────────────────────────────────── */

.trustedcpd-empty {
    text-align: center;
    padding: 40px 20px;
    color: #787c82;
}

/* ── Wizard ───────────────────────────────────────────────────────────── */

.trustedcpd-wizard__nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.trustedcpd-wizard__back {
    font-size: 14px;
    text-decoration: none;
    color: #1e3a5f;
}

.trustedcpd-wizard__back:hover {
    text-decoration: underline;
}

.trustedcpd-wizard__ref {
    font-weight: 700;
    font-size: 15px;
    color: #1d2327;
}

/* ── Step Indicator ───────────────────────────────────────────────────── */

.trustedcpd-wizard__steps {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.trustedcpd-step {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    background: #f0f0f1;
    color: #787c82;
    border-radius: 4px;
}

.trustedcpd-step--active {
    background: #1e3a5f;
    color: #fff;
}

.trustedcpd-step--completed {
    background: #d4edda;
    color: #155724;
}

/* ── Detail Table ─────────────────────────────────────────────────────── */

.trustedcpd-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.trustedcpd-detail-table th,
.trustedcpd-detail-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f1;
    font-size: 14px;
}

.trustedcpd-detail-table th {
    width: 160px;
    font-weight: 600;
    color: #50575e;
}

/* ── Notices ──────────────────────────────────────────────────────────── */

.trustedcpd-notice {
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}

.trustedcpd-notice strong {
    display: block;
    margin-bottom: 4px;
}

.trustedcpd-notice--success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.trustedcpd-notice--info {
    background: #e5f5fa;
    border-left-color: #0073aa;
    color: #004085;
}

.trustedcpd-notice--warning {
    background: #fcf0c3;
    border-left-color: #dba617;
    color: #6e4e00;
}

.trustedcpd-notice--error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.trustedcpd-notice--neutral {
    background: #f0f0f1;
    border-left-color: #787c82;
    color: #50575e;
}

/* ── Wizard Action Area ───────────────────────────────────────────────── */

.trustedcpd-wizard__action-form {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.trustedcpd-wizard__form-intro {
    margin-bottom: 16px;
    color: #50575e;
    font-size: 14px;
}

.trustedcpd-wizard__form-nav {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* ── Formidable Form Container ────────────────────────────────────────── */

.trustedcpd-wizard__formidable-container {
    margin: 16px 0;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

/* ── Assets Download ──────────────────────────────────────────────────── */

.trustedcpd-assets-download {
    margin: 16px 0 20px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .trustedcpd-app-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .trustedcpd-app-card__footer {
        text-align: left;
    }

    .trustedcpd-wizard__steps {
        flex-direction: column;
    }

    .trustedcpd-detail-table th {
        width: auto;
    }

    .trustedcpd-filters {
        flex-wrap: wrap;
    }

    .trustedcpd-wizard__nav {
        flex-wrap: wrap;
    }
}

/* ── Assessor Dashboard ──────────────────────────────────────────────── */

.trustedcpd-assessor-review {
    max-width: 100%;
}

.trustedcpd-review-header h3 {
    margin: 0 0 16px;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */

.trustedcpd-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.trustedcpd-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #50575e;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.trustedcpd-tab:hover {
    color: #1e3a5f;
    text-decoration: none;
}

.trustedcpd-tab--active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
    font-weight: 600;
}

.trustedcpd-tab-content {
    margin-top: 0;
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.trustedcpd-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f1;
}

.trustedcpd-section:last-child {
    border-bottom: none;
}

.trustedcpd-section h4 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

/* ── Decision Form Elements ───────────────────────────────────────────── */

.trustedcpd-select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.trustedcpd-textarea {
    width: 100%;
    max-width: 600px;
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.trustedcpd-description {
    font-size: 13px;
    color: #646970;
    margin-top: 4px;
}

/* ── History Table ────────────────────────────────────────────────────── */

.trustedcpd-history-table {
    font-size: 13px;
}

.trustedcpd-history-table thead th {
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
    padding: 8px;
}

.trustedcpd-history-table tbody td {
    padding: 8px;
    border-bottom: 1px solid #f0f0f1;
}

/* ── Assessment Form Container ────────────────────────────────────────── */

.trustedcpd-assessment-form {
    padding: 4px 0;
}

/* ── Entry View (read-only) ───────────────────────────────────────────── */

.trustedcpd-entry-view {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px 20px;
}

.trustedcpd-entry-view .trustedcpd-detail-table {
    background: transparent;
}

/* ── Notices ──────────────────────────────────────────────────────────── */

.trustedcpd-notice--success {
    background: #d4edda;
    border-left: 4px solid #155724;
    color: #155724;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.trustedcpd-notice--info {
    background: #e5f5fa;
    border-left: 4px solid #0073aa;
    color: #0073aa;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .trustedcpd-tabs {
        flex-wrap: wrap;
    }

    .trustedcpd-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .trustedcpd-select,
    .trustedcpd-textarea {
        max-width: 100%;
    }
}

/* ── Progress Timeline ──────────────────────────────────────────────── */

.trustedcpd-timeline {
    margin: 24px 0;
    padding: 0;
}

.trustedcpd-timeline__step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
}

.trustedcpd-timeline__marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
}

.trustedcpd-timeline__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    background: #e9ecef;
    border: 2px solid #dee2e6;
    position: relative;
    z-index: 1;
}

.trustedcpd-timeline__step--done .trustedcpd-timeline__icon {
    background: #d1fae5;
    border-color: #22c55e;
}

.trustedcpd-timeline__step--active .trustedcpd-timeline__icon {
    background: #dbeafe;
    border-color: #3b82f6;
    animation: trustedcpd-pulse 2s ease-in-out infinite;
}

.trustedcpd-timeline__step--upcoming .trustedcpd-timeline__icon {
    background: #f3f4f6;
    border-color: #d1d5db;
    opacity: 0.6;
}

.trustedcpd-timeline__step--warn .trustedcpd-timeline__icon {
    background: #fef3c7;
    border-color: #f59e0b;
}

.trustedcpd-timeline__step--warn.trustedcpd-timeline__step--done .trustedcpd-timeline__icon {
    background: #fce4e4;
    border-color: #d63638;
}

.trustedcpd-timeline__step--warn .trustedcpd-timeline__label {
    color: #92400e;
}

.trustedcpd-timeline__step--warn.trustedcpd-timeline__step--done .trustedcpd-timeline__label {
    color: #d63638;
}

@keyframes trustedcpd-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.trustedcpd-timeline__line {
    width: 2px;
    flex-grow: 1;
    min-height: 24px;
    background: #dee2e6;
    margin: 4px 0;
}

.trustedcpd-timeline__line--done {
    background: #22c55e;
}

.trustedcpd-timeline__content {
    padding: 6px 0 20px;
    min-height: 50px;
}

.trustedcpd-timeline__label {
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
    line-height: 1.4;
}

.trustedcpd-timeline__step--upcoming .trustedcpd-timeline__label {
    color: #9ca3af;
}

.trustedcpd-timeline__date {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.trustedcpd-timeline__date--active {
    color: #3b82f6;
    font-style: italic;
}

@media (max-width: 480px) {
    .trustedcpd-timeline__marker {
        width: 30px;
    }

    .trustedcpd-timeline__icon {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .trustedcpd-timeline__label {
        font-size: 13px;
    }
}

/* ── Company Profile ─────────────────────────────────────────────────── */

.trustedcpd-profile__intro {
    color: #555;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.6;
}

.trustedcpd-profile__section {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    background: #fff;
}

.trustedcpd-profile__section legend {
    font-size: 17px;
    font-weight: 600;
    color: #1a3a5c;
    padding: 0 8px;
}

.trustedcpd-profile__field {
    margin-bottom: 20px;
}

.trustedcpd-profile__field:last-child {
    margin-bottom: 0;
}

.trustedcpd-profile__field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.trustedcpd-profile__field input[type="text"],
.trustedcpd-profile__field input[type="url"],
.trustedcpd-profile__field textarea {
    width: 100%;
    max-width: 500px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.trustedcpd-profile__field input:focus,
.trustedcpd-profile__field textarea:focus {
    border-color: #1a3a5c;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.trustedcpd-profile__field textarea {
    min-height: 120px;
    resize: vertical;
}

.trustedcpd-profile__field--inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.trustedcpd-profile__field--inline label {
    min-width: 100px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.trustedcpd-profile__field--inline input {
    flex: 1;
}

.trustedcpd-profile__hint {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
    line-height: 1.4;
}

.trustedcpd-profile__logo-wrap {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.trustedcpd-profile__logo-preview {
    width: 120px;
    height: 120px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f9f9f9;
    flex-shrink: 0;
}

.trustedcpd-profile__logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.trustedcpd-profile__logo-placeholder {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    padding: 8px;
}

.trustedcpd-profile__logo-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.trustedcpd-profile__actions {
    margin-top: 8px;
}

/* Incomplete profile indicator on WooCommerce My Account menu */
.woocommerce-MyAccount-navigation-link.trustedcpd-profile-incomplete a::after {
    content: "\26A0";
    color: #d63638;
    font-size: 14px;
    margin-left: 6px;
    font-style: normal;
}

/* Incomplete profile alert banner */
.trustedcpd-profile-alert {
    background: #fff3f3;
    border: 1px solid #f0c8c8;
    border-left: 4px solid #d63638;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.trustedcpd-profile-alert strong {
    color: #d63638;
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.trustedcpd-profile-alert p {
    margin: 0;
    color: #555;
}

@media (max-width: 600px) {
    .trustedcpd-profile__field--inline {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .trustedcpd-profile__field--inline label {
        min-width: auto;
    }

    .trustedcpd-profile__logo-wrap {
        flex-direction: column;
        align-items: center;
    }
}

