/* Welcome Card Styles - Club Forge Pro */

/* Base card */
.cfp-welcome-card {
    background: #ffffff;
    border: 1px solid #e6eaf3;
    border-radius: 16px;
    padding: 24px;
    color: #0f172a;
    box-shadow: 0 10px 28px rgba(2,6,23,.10);
    margin: 16px auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    position: relative;
    max-width: 720px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

/* Avatar */
.cfp-welcome-card__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.cfp-welcome-card__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e6eaf3;
    box-shadow: 0 4px 12px rgba(2,6,23,.15);
    display: block;
}

.cfp-welcome-card__avatar--guest {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1d4ed8, #5b21b6);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
}

.cfp-welcome-card__status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Main content area */
.cfp-welcome-card__main {
    flex: 1 1 300px;
    min-width: 0;
}

/* Title row */
.cfp-welcome-card__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.cfp-welcome-card__title-row h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.cfp-welcome-card__message-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(29,78,216,.08), rgba(91,33,182,.08));
    border: 1px solid #e6eaf3;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #5b21b6;
    white-space: nowrap;
}

/* Subline */
.cfp-welcome-card__subline {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

/* Stats */
.cfp-welcome-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.cfp-welcome-card__stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e6eaf3;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: #334155;
}

.cfp-welcome-card__stat strong {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

/* Badge pill */
.cfp-welcome-card__badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(29,78,216,.08), rgba(91,33,182,.08));
    border: 1px solid #e6eaf3;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #5b21b6;
}

.cfp-welcome-card__badge-pill b {
    font-size: 16px;
    line-height: 1;
}

/* Progress */
.cfp-welcome-card__progress {
    width: 100%;
    margin-top: 4px;
}

.cfp-welcome-card__progress-bar {
    width: 100%;
    height: 6px;
    background: #e6eaf3;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.cfp-welcome-card__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8, #5b21b6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.cfp-welcome-card__progress-text {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.cfp-welcome-card__progress-text strong {
    color: #0f172a;
    font-weight: 600;
}

/* Actions */
.cfp-welcome-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    width: 100%;
}

@media (min-width: 600px) {
    .cfp-welcome-card__actions {
        width: auto;
        margin-left: auto;
        margin-top: 0;
        align-self: center;
    }
}

.cfp-welcome-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.cfp-welcome-card__btn--primary {
    background: linear-gradient(135deg, #1d4ed8, #5b21b6);
    color: #fff;
    border-color: transparent;
}

.cfp-welcome-card__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(29,78,216,.25);
}

.cfp-welcome-card__btn--secondary {
    background: #f8fafc;
    color: #334155;
    border-color: #e6eaf3;
}

.cfp-welcome-card__btn--secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Notification badge on Messages button */
.cfp-welcome-card__btn--messages {
    position: relative;
}

.cfp-welcome-card__btn-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
    animation: cfp-badge-pop 0.3s ease-out;
}

@keyframes cfp-badge-pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Login variant */
.cfp-welcome-card--login {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.03), rgba(220, 20, 20, 0.03));
    border: 1px solid rgba(220, 20, 20, 0.15);
}

/* Compact variant */
.cfp-welcome-card--compact {
    padding: 16px;
    gap: 12px;
}

.cfp-welcome-card--compact .cfp-welcome-card__avatar {
    width: 56px;
    height: 56px;
}

.cfp-welcome-card--compact .cfp-welcome-card__title-row h1 {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 640px) {
    .cfp-welcome-card {
        padding: 20px;
    }

    .cfp-welcome-card__title-row h1 {
        font-size: 20px;
    }

    .cfp-welcome-card__actions {
        width: 100%;
        margin-top: 8px;
    }

    .cfp-welcome-card__btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* Legacy support for old classes */
.cfp-welcome-panel {
    background: #ffffff;
    border: 1px solid #e6eaf3;
    border-radius: 16px;
    padding: 24px;
    color: #0f172a;
    box-shadow: 0 10px 28px rgba(2,6,23,.10);
    margin: 16px auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    position: relative;
    max-width: 720px;
    text-align: center;
}

.cfp-welcome-panel--login-prompt {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.03), rgba(220, 20, 20, 0.03));
    border: 1px solid rgba(220, 20, 20, 0.15);
}

.cfp-welcome-panel__login-btn {
    background: linear-gradient(135deg, #1d4ed8, #5b21b6);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.2s ease;
}

.cfp-welcome-panel__login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(29,78,216,.25);
}

.cfp-badge--new {
    animation: cfp-badge-award 0.6s ease-out;
}

@keyframes cfp-badge-award {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Message Modal */
.cfp-message-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cfp-message-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.cfp-message-modal__card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(2, 6, 23, 0.18);
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cfp-modal-in 0.25s ease-out;
}

@keyframes cfp-modal-in {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.cfp-message-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e6eaf3;
    background: linear-gradient(90deg, rgba(29, 78, 216, 0.06), rgba(91, 33, 182, 0.04));
}

.cfp-message-modal__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.2px;
}

.cfp-message-modal__close {
    background: rgba(15, 23, 42, 0.06);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    font-size: 20px;
    line-height: 1;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cfp-message-modal__close:hover {
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.cfp-message-modal__stats {
    padding: 8px 20px 0;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.2px;
}

.cfp-message-modal__list {
    overflow-y: auto;
    padding: 8px 0;
    flex: 1;
}

.cfp-message-modal__loading,
.cfp-message-modal__empty,
.cfp-message-modal__error {
    text-align: center;
    padding: 32px 20px;
    font-size: 13px;
    color: #64748b;
}

.cfp-message-modal__error {
    color: #ef4444;
}

.cfp-message-modal__item {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cfp-message-modal__item:last-child {
    border-bottom: none;
}

.cfp-message-modal__item:hover {
    background: #f8faff;
}

.cfp-message-modal__item.is-read {
    opacity: 0.7;
}

.cfp-message-modal__item.is-urgent {
    border-left: 3px solid #ef4444;
    padding-left: 17px;
}

.cfp-message-modal__item.is-urgent:not(.is-read) {
    background: rgba(239, 68, 68, 0.03);
}

.cfp-message-modal__item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.cfp-message-modal__sender {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cfp-message-modal__time {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.cfp-message-modal__subject {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 3px;
    line-height: 1.35;
}

.cfp-message-modal__item.is-read .cfp-message-modal__subject {
    font-weight: 500;
    color: #64748b;
}

.cfp-message-modal__snippet {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cfp-message-modal__badges {
    margin-top: 6px;
}

.cfp-message-modal__important {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

body.cfp-message-modal--open {
    overflow: hidden;
}
