/* ================================================
   SexDark.com — Componentes Reutilizáveis
   Badges, Botões, Tooltips, Modais, etc
   ================================================ */

/* ============================
   BADGES
   ============================ */
.badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: auto;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-grey { background-color: var(--badge-bg-grey); color: var(--text-primary); }
.badge-purple { background-color: var(--badge-bg-purple); color: var(--badge-text-purple); }
.badge-orange { background-color: var(--badge-bg-orange); color: var(--text-primary); }
.badge-pink { background-color: var(--btn-pink); color: #ffffff; }
.badge-green { background-color: var(--btn-green); color: #ffffff; }

/* Badge online (bolinha verde) */
.online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--online-green);
    display: inline-block;
    flex-shrink: 0;
}

.online-dot-sm {
    width: 8px;
    height: 8px;
}

.online-dot-lg {
    width: 14px;
    height: 14px;
    border: 2px solid var(--bg-main);
}

/* Badge premium (estrela verde) */
.premium-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--btn-green);
    color: #ffffff;
    font-size: 10px;
    border: 1px solid #ffffff;
    flex-shrink: 0;
}

/* ============================
   BOTÕES
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--btn-pink);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--btn-pink-hover);
    color: #ffffff;
}

.btn-success {
    background-color: var(--btn-green);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #159c52;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

/* Amigo mútuo — verde */
.btn-friend {
    background: rgba(29, 185, 84, .12);
    border: 1px solid rgba(29, 185, 84, .5);
    color: #1db954;
}
.btn-friend:hover {
    background: rgba(29, 185, 84, .22);
    color: #1db954;
}

.btn-white {
    background-color: #ffffff;
    color: #1a1c20;
}

.btn-white:hover {
    opacity: 0.9;
    color: #1a1c20;
}

.btn-danger {
    background-color: var(--btn-danger);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

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

.btn-block {
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-base);
}

.btn-icon:hover {
    background-color: var(--hover-bg);
}

/* ============================
   TOOLTIPS MOBILE
   ============================ */
.m-icon-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.m-tooltip {
    position: absolute;
    background-color: var(--badge-bg-grey);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    border: 1px solid var(--border-color);
    z-index: var(--z-tooltip);
}

.m-tooltip::after {
    content: '';
    position: absolute;
    border-width: 5px;
    border-style: solid;
}

.tt-down {
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
}

.tt-down::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-color: transparent transparent var(--badge-bg-grey) transparent;
}

.tt-up {
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
}

.tt-up::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-color: var(--badge-bg-grey) transparent transparent transparent;
}

.m-icon-box:focus .m-tooltip,
.m-icon-box:active .m-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================
   AVATAR
   ============================ */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #333;
    flex-shrink: 0;
}

.avatar-sm { width: 26px; height: 26px; }
.avatar-md { width: 42px; height: 42px; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }

/* ============================
   FORMULÁRIOS
   ============================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    transition: border-color var(--transition-base);
}

.form-input:focus {
    border-color: var(--btn-pink);
}

.form-select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371767b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--btn-pink);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--btn-pink);
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.form-error {
    color: var(--btn-danger);
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* ============================
   MODAIS GLOBAIS
   ============================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-main);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 800;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================
   LOADING / SPINNER
   ============================ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--btn-pink);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* ============================
   EMPTY STATE / PLACEHOLDER
   ============================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 300px;
}

/* Em desenvolvimento */
.dev-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
    text-align: center;
}

.dev-placeholder i {
    font-size: 64px;
    color: var(--btn-pink);
    margin-bottom: 20px;
}

.dev-placeholder h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
}

.dev-placeholder p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ============================
   ALERT / TOAST
   ============================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}

.toast-success { border-left: 4px solid var(--btn-green); }
.toast-error { border-left: 4px solid var(--btn-danger); }
.toast-warning { border-left: 4px solid var(--like-yellow); }
.toast-info { border-left: 4px solid var(--btn-pink); }

@media (max-width: 900px) {
    .toast-container {
        top: auto;
        bottom: 100px;
        left: 20px;
        right: 20px;
    }
    .toast {
        min-width: auto;
    }
}

/* ============================
   REALTIME BADGES (SSE)
   ============================ */
.realtime-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--btn-pink);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-main);
    animation: badgePulse 0.3s ease;
    z-index: 5;
}

@keyframes badgePulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ============================
   LIGHTBOX DE FOTO
   ============================ */
#photoLightbox {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 99999 !important;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: 60px 16px 16px;
    box-sizing: border-box;
}

.lightbox-inner img {
    max-width: min(90vw, 1200px);
    max-height: calc(100vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    animation: fadeIn 0.2s ease;
    display: block;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

.lightbox-close {
    position: fixed !important;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 100000 !important;
    transition: background var(--transition-base), transform var(--transition-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .lightbox-inner {
        padding: 56px 8px 8px;
    }

    .lightbox-inner img {
        max-width: 98vw;
        max-height: calc(100vh - 70px);
    }
}

@media (max-width: 480px) {
    .lightbox-inner img {
        max-width: 100vw;
        max-height: calc(100svh - 60px);
        border-radius: 0;
    }

    .lightbox-inner {
        padding: 52px 0 0;
    }
}

/* ============================
   SIDEBAR DIREITA — SALDO + PREMIUM
   ============================ */
.sr-wallet-premium {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 12px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sr-wallet-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sr-wallet-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.sr-wallet-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.sr-premium-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    background: linear-gradient(135deg, #1a9e52, #17b85f);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
    white-space: nowrap;
    width: 100%;
    max-width: 200px;
    box-shadow: 0 2px 10px rgba(29,185,84,.25);
}

.sr-premium-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #ffffff;
}

.sr-premium-btn .fa-shield {
    font-size: 13px;
}

.shield-dollar-sm {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 7px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
}
