/* Header actions container (PayPal + profile) */
.header-actions {
    position: fixed;
    top: 20px;
    right: 5%;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

.profile-menu {
    position: relative;
    top: auto;
    right: auto;
    z-index: auto;
}

.profile-menu.floating {
    position: relative;
    top: auto;
    right: auto;
    z-index: auto;
}

/* PayPal donation button */
.donate-button {
    padding: 10px 18px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.donate-button:hover {
    background: linear-gradient(135deg, #2c5282 0%, #2b6cb0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.4), 0 0 0 2px rgba(201, 169, 97, 0.3);
}

.donate-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.3);
}

.donate-button:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .profile-menu {
        display: none;
    }

    .donate-button {
        display: none;
    }

    .header-actions {
        display: none;
    }
}

/* Voir section "Navbar Avatar Button" en bas pour .profile-avatar */

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 250px;
    max-width: 280px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.profile-menu:hover .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-content {
    padding: var(--space-md);
}

.profile-info {
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.profile-email {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.profile-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-md) 0;
}

.profile-dropdown-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    font-size: 0.95rem;
}

.profile-dropdown-item:hover {
    background: var(--color-hover);
    color: var(--color-primary);
}

.profile-dropdown-item-button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    font-size: 0.95rem;
}

.profile-dropdown-item-button:hover {
    background: var(--color-hover);
    color: var(--color-primary);
}

.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px var(--space-lg) var(--space-2xl);
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--space-2xl);
    gap: var(--space-lg);
}

/* Container pour l'avatar - pas de style propre, utilise unified-avatar */
.profile-avatar-large {
    position: relative;
}

.profile-userinfo h1 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin: 0.5rem 0;
}

.profile-userinfo p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.profile-content {
    display: grid;
    gap: var(--space-xl);
}

.profile-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.profile-section h2 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 250px));
    gap: var(--space-lg);
}

.profile-info-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}

.profile-info-item p {
    font-size: 1.1rem;
    color: var(--color-text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 150px));
    gap: var(--space-lg);
}

.stat-item {
    text-align: center;
    padding: var(--space-lg);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .profile-menu {
        display: none;
    }

    .profile-header {
        flex-direction: column;
    }

    .profile-avatar-large {
        width: 100px;
        height: 100px;
    }

    .profile-userinfo h1 {
        font-size: 1.5rem;
    }

    .profile-container {
        padding: 80px var(--space-md) var(--space-xl);
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-actions {
        display: none;
    }

    .donate-button {
        display: none;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

/* ============================================
   Unified Avatar Styles
   Style unique pour TOUT le site
   Bordures par rôle: admin=blanc, modo=vert, premium=doré, user=rien
   ============================================ */

.unified-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2440 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.2);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.unified-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.3);
}

.unified-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unified-avatar__initial,
.unified-avatar__fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Size variants */
.unified-avatar--sm {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.unified-avatar--md {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.unified-avatar--lg {
    width: 120px;
    height: 120px;
    font-size: 2.5rem;
}

/* Role-based border styles */
/* Admin: bordure blanche */
.unified-avatar--admin {
    box-shadow: 0 0 0 3px #ffffff, 0 4px 12px rgba(26, 54, 93, 0.2);
}

.unified-avatar--admin:hover {
    box-shadow: 0 0 0 3px #ffffff, 0 6px 20px rgba(255, 255, 255, 0.3);
}

/* Modérateur: vert sobre */
.unified-avatar--moderator {
    box-shadow: 0 0 0 3px #059669, 0 4px 12px rgba(26, 54, 93, 0.2);
}

.unified-avatar--moderator:hover {
    box-shadow: 0 0 0 3px #059669, 0 6px 20px rgba(5, 150, 105, 0.4);
}

/* Premium: doré */
.unified-avatar--premium {
    box-shadow: 0 0 0 3px #c9a961, 0 4px 12px rgba(26, 54, 93, 0.2);
}

.unified-avatar--premium:hover {
    box-shadow: 0 0 0 3px #c9a961, 0 6px 20px rgba(201, 169, 97, 0.4);
}

/* ============================================
   Profile Avatar Upload Container
   ============================================ */

.profile-avatar-upload {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    pointer-events: none;
    z-index: 2;
}

.profile-avatar-upload:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-avatar-upload--loading .profile-avatar-overlay {
    opacity: 1;
}

.profile-avatar-upload--loading .profile-avatar-overlay svg {
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Navbar Avatar Button
   Le bouton = exactement la taille de l'avatar
   ============================================ */

.profile-avatar {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    outline: none;
    cursor: pointer;
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    -webkit-appearance: none;
    appearance: none;
}

.profile-avatar:focus,
.profile-avatar:focus-visible {
    outline: none;
}

/* ============================================
   Profile Section Description
   ============================================ */

.profile-upload-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.profile-upload-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.profile-upload-toast--success {
    background: #10b981;
    color: white;
}

.profile-upload-toast--error {
    background: #ef4444;
    color: white;
}

/* ============================================
   Profile Section Description
   ============================================ */

.profile-section-desc {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ============================================
   Referral Section
   ============================================ */

.referral-user,
.referral-admin {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* DEPRECATED - Old referral styles (replaced by compact version)
.referral-no-code {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.referral-code-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.referral-code-display label {
    font-weight: 600;
    color: #1a365d;
    font-size: 0.9rem;
}

.referral-code-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.referral-code {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #1a365d;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.1) 0%, rgba(201, 169, 97, 0.05) 100%);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md, 8px);
    border: 2px solid rgba(201, 169, 97, 0.3);
}

.referral-hint {
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
}
*/

.copy-code-btn {
    padding: 0.5rem;
    border-radius: var(--radius-md, 8px);
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(201, 169, 97, 0.2);
}

/* Admin referral code item with actions */
.referral-code-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e8e4df;
    border-radius: var(--radius-md, 8px);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.referral-code-item:hover {
    border-color: rgba(201, 169, 97, 0.4);
    background: rgba(201, 169, 97, 0.03);
}

.referral-code-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.referral-code-item:hover .referral-code-actions {
    opacity: 1;
}

.delete-code-btn {
    padding: 0.5rem;
    border-radius: var(--radius-md, 8px);
    transition: all 0.2s ease;
    color: #6b7280;
}

.delete-code-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.delete-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Admin referral codes list */
.referral-codes-list {
    margin-top: 1rem;
}

.referral-codes-list h4 {
    color: #1a365d;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* DEPRECATED - Old referral-code-item styles (replaced by compact version)
.referral-code-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e8e4df;
    border-radius: var(--radius-md, 8px);
    margin-bottom: 0.5rem;
}

.referral-code-item .referral-code {
    font-size: 1rem;
    padding: 0.35rem 0.65rem;
}

.referral-code-item.used {
    opacity: 0.6;
}

.referral-code-item.used .referral-code {
    text-decoration: line-through;
}

.referral-used-date {
    color: #6b7280;
    font-size: 0.8rem;
    margin-left: auto;
}

.referral-codes-used {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e8e4df;
}

.referral-more {
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.referral-used-by {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #1a365d;
    font-weight: 500;
}

.referral-used-by svg {
    color: #6b7280;
}

.referral-code-item.used {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.referral-code-item.used .referral-code {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    opacity: 0.6;
    text-decoration: none;
}
*/

/* DEPRECATED - Old extra slots/slots info styles (replaced by compact version)
.referral-extra-slots {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #059669;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(5, 150, 105, 0.08);
    border-radius: var(--radius-md, 8px);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.referral-extra-slots svg {
    flex-shrink: 0;
}

.referral-slots-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1a365d;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(26, 54, 93, 0.05);
    border-radius: var(--radius-md, 8px);
    border: 1px solid rgba(26, 54, 93, 0.1);
}

.referral-slots-info svg {
    flex-shrink: 0;
    color: #6b7280;
}

.referral-slots-info strong {
    color: #1a365d;
}

.referral-no-slots-hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.75rem;
    text-align: center;
}

.referral-no-slots-hint a {
    color: #c9a961;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.referral-no-slots-hint a:hover {
    color: #b8983f;
}
*/

/* Disabled generate button */
#generateReferralBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #9ca3af;
}

/* ============================================
   Profile Section Header (with button)
   ============================================ */

.profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.profile-section-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
}

/* ============================================
   Requests Section (Mes demandes)
   ============================================ */

.requests-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #6b7280;
}

.requests-empty svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.requests-empty p {
    margin: 0;
    font-size: 1rem;
}

.requests-empty-hint {
    font-size: 0.875rem !important;
    margin-top: 0.5rem !important;
    opacity: 0.7;
}

/* DEPRECATED - Old requests-list styles (replaced by table)
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.requests-list--full {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.requests-more {
    margin-top: 1rem;
    text-align: center;
}
*/

/* DEPRECATED - Old Request Card styles (replaced by table rows)
.request-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.request-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.1);
    transform: translateY(-1px);
}

.request-card--unread {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.05) 0%, rgba(201, 169, 97, 0.02) 100%);
    border-color: rgba(201, 169, 97, 0.4);
}

.request-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.request-card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.request-card-date {
    font-size: 0.8rem;
    color: #6b7280;
}

.request-card-content {
    margin-bottom: 0.5rem;
}

.request-card-preview {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    margin: 0;
}

.request-card-response {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px dashed var(--color-border);
    font-size: 0.8rem;
    color: #059669;
    font-weight: 500;
}

.request-card-response svg {
    flex-shrink: 0;
}
*/

.requests-list--full {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.requests-more {
    margin-top: 1rem;
    text-align: center;
}

/* Request Card */
.request-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.request-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.1);
    transform: translateY(-1px);
}

.request-card--unread {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.05) 0%, rgba(201, 169, 97, 0.02) 100%);
    border-color: rgba(201, 169, 97, 0.4);
}

.request-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.request-card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.request-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.request-unread-dot {
    width: 8px;
    height: 8px;
    background: #dc2626;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.request-card-date {
    font-size: 0.8rem;
    color: #6b7280;
}

.request-card-content {
    margin-bottom: 0.5rem;
}

.request-card-preview {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    margin: 0;
}

.request-card-response {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px dashed var(--color-border);
    font-size: 0.8rem;
    color: #059669;
    font-weight: 500;
}

.request-card-response svg {
    flex-shrink: 0;
}

/* ============================================
   Request Detail Modal
   ============================================ */

.request-detail-modal .modal-content--md {
    max-width: 600px;
}

.request-all-modal .modal-content--lg {
    max-width: 700px;
}

.request-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.request-detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.request-detail-badges {
    display: flex;
    gap: 0.5rem;
}

.request-detail-date {
    font-size: 0.85rem;
    color: #6b7280;
}

.request-detail-message h4,
.request-detail-response h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.request-detail-response h4 {
    color: #059669;
}

.request-detail-response-date {
    font-weight: 400;
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: auto;
}

.request-detail-content {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.request-detail-content--response {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.05) 0%, rgba(5, 150, 105, 0.02) 100%);
    border-color: rgba(5, 150, 105, 0.2);
}

.request-detail-pending {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(201, 169, 97, 0.08);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: var(--radius-md);
    color: #92700c;
}

.request-detail-pending svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.request-detail-pending p {
    margin: 0;
    font-size: 0.9rem;
}

/* ============================================
   Admin Response Section (in admin modal)
   ============================================ */

.message-detail-response-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.message-detail-response-section label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.message-detail-response-section label svg {
    color: #059669;
}

.message-response-date {
    font-weight: 400 !important;
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.message-detail-response-section textarea {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
}

.message-detail-response-section textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.message-detail-response-section small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
}

/* ============================================
   Referral Compact Section (User view)
   ============================================ */

.referral-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.referral-compact .btn {
    align-self: flex-start;
}

.referral-empty {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
}

/* DEPRECATED - Old referral-request-link styles (replaced by button)
.referral-request-link {
    color: #c9a961;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.referral-request-link:hover {
    color: #b8983f;
}
*/

.referral-codes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.referral-code-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    transition: all 0.2s ease;
}

.referral-code-row.active {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, rgba(201, 169, 97, 0.03) 100%);
    border-color: rgba(201, 169, 97, 0.3);
}

.referral-code-row.active:hover {
    border-color: rgba(201, 169, 97, 0.5);
}

.referral-code-row.used {
    opacity: 0.7;
    background: var(--color-bg);
}

.referral-code-value {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #1a365d;
    background: rgba(26, 54, 93, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.referral-code-row.used .referral-code-value {
    text-decoration: line-through;
    opacity: 0.6;
}

.referral-used-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #059669;
    font-weight: 500;
}

.referral-used-info svg {
    color: #6b7280;
    flex-shrink: 0;
}

.referral-date {
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: auto;
}

.referral-request-more {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--color-border);
    display: flex;
    justify-content: center;
}

/* DEPRECATED - Old referral-request-more link styles (replaced by button)
.referral-request-more a {
    color: #c9a961;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.referral-request-more a:hover {
    color: #b8983f;
}
*/

/* ============================================
   Referral Slots Indicator
   ============================================ */

.referral-slots-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, rgba(201, 169, 97, 0.03) 100%);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: var(--radius-md, 8px);
    margin-bottom: 1rem;
}

.referral-slots-label {
    font-weight: 600;
    color: #1a365d;
    font-size: 0.9rem;
}

.referral-slots-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.referral-slots-value.has-slots {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.referral-slots-value.no-slots {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.referral-slots-indicator .btn {
    margin-left: auto;
}

/* ============================================
   Requests Compact Table Section
   ============================================ */

.requests-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.requests-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.requests-table thead th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom: 2px solid var(--color-border);
}

.requests-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.requests-table tbody tr:hover {
    background: rgba(26, 54, 93, 0.03);
}

.requests-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

/* Unread row highlight */
.request-row--unread {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.06) 0%, rgba(201, 169, 97, 0.02) 100%);
}

.request-row--unread:hover {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.1) 0%, rgba(201, 169, 97, 0.04) 100%) !important;
}

/* Hidden rows (beyond 5) */
.request-row--hidden {
    display: none;
}

.requests-table.expanded .request-row--hidden {
    display: table-row;
}

/* Badge styles */
.request-subject-badge,
.request-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
}

/* Preview cells */
.request-preview-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
}

.request-response-cell {
    max-width: 150px;
}

.request-response-preview {
    font-size: 0.85rem;
    color: #059669;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.request-response-preview.unread {
    font-weight: 600;
    position: relative;
    padding-left: 0.75rem;
}

.request-response-preview.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #dc2626;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.request-no-response {
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Expand button */
.requests-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md, 8px);
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.requests-expand-btn:hover {
    background: rgba(26, 54, 93, 0.03);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.requests-expand-btn svg {
    transition: transform 0.2s ease;
}

/* ============================================
   Responsive adjustments
   ============================================ */

@media (max-width: 768px) {
    .profile-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .request-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .request-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Requests table responsive */
    .requests-table {
        font-size: 0.8rem;
    }
    
    .requests-table thead th,
    .requests-table td {
        padding: 0.5rem;
    }
    
    .request-preview-cell {
        max-width: 120px;
    }
    
    .request-response-cell {
        max-width: 100px;
    }
    
    /* Referral code rows responsive */
    .referral-code-row {
        flex-wrap: wrap;
    }
    
    .referral-date {
        margin-left: 0;
        width: 100%;
        margin-top: 0.25rem;
    }
}

@media (max-width: 480px) {
    /* Hide response column on very small screens */
    .requests-table thead th:nth-child(4),
    .requests-table td:nth-child(4) {
        display: none;
    }
    
    .request-preview-cell {
        max-width: 100px;
    }
}
