/**
 * KOL Features - Styles for Interactive Components
 * Mini-profiles, Modals, Notifications, etc.
 */

/* =================== */
/* MINI-PROFILE TOOLTIP */
/* =================== */

.mini-profile-tooltip {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0;
    min-width: 320px;
    max-width: 400px;
    animation: tooltipFadeIn 0.2s ease-out;
    overflow: hidden;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mini-profile-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close-mini {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
}

.btn-close-mini:hover {
    opacity: 1;
}

.mini-profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.mini-profile-stats .stat-item {
    text-align: center;
}

.mini-profile-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.mini-profile-stats .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mini-profile-details {
    padding: 1rem;
    font-size: 0.9rem;
}

.mini-profile-actions {
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.mini-profile-actions .btn {
    flex: 1;
}

/* =================== */
/* MODAL OVERLAYS */
/* =================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content {
    padding: 0;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.btn-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background: var(--bg-tertiary);
}

/* =================== */
/* SIMULATION RESULTS */
/* =================== */

.simulation-summary {
    margin-top: 1rem;
}

.stat-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value-sm {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

/* =================== */
/* TOAST NOTIFICATIONS */
/* =================== */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.5rem;
    transform: translateX(500px);
    opacity: 0;
    transition: all 0.3s ease-out;
    z-index: 10001;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.toast-success {
    border-left: 4px solid var(--success);
}

.toast-notification.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-notification.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-notification.toast-info {
    border-left: 4px solid var(--info);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-content i {
    font-size: 1.5rem;
}

.toast-success .toast-content i {
    color: var(--success);
}

.toast-error .toast-content i {
    color: var(--danger);
}

.toast-warning .toast-content i {
    color: var(--warning);
}

.toast-info .toast-content i {
    color: var(--info);
}

/* =================== */
/* WATCHLIST BUTTONS */
/* =================== */

[data-watchlist-btn] {
    transition: all 0.2s ease;
}

[data-watchlist-btn]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-watchlist-btn] i {
    transition: transform 0.2s ease;
}

[data-watchlist-btn]:hover i {
    transform: scale(1.2);
}

/* =================== */
/* HOVERABLE INFLUENCER NAMES */
/* =================== */

[data-influencer-id] {
    position: relative;
    display: inline-block;
}

[data-influencer-id]:hover {
    color: var(--primary) !important;
    text-decoration: underline;
}

/* =================== */
/* REPORT BUTTON */
/* =================== */

.btn-report {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-report:hover {
    color: var(--danger);
}

/* =================== */
/* LOADING STATES */
/* =================== */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    border-radius: 8px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.3rem solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* =================== */
/* FORM IMPROVEMENTS */
/* =================== */

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* =================== */
/* RESPONSIVE */
/* =================== */

@media (max-width: 768px) {
    .mini-profile-tooltip {
        min-width: 280px;
    }

    .modal-dialog {
        width: 95%;
    }

    .toast-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }

    .mini-profile-actions {
        flex-direction: column;
    }

    .mini-profile-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .mini-profile-tooltip {
        min-width: auto;
        width: 100%;
        border-radius: 16px;
    }

    .toast-notification {
        width: 100%;
        left: 0;
        right: 0;
        border-radius: 0;
    }
}

/* =================== */
/* DARK MODE SUPPORT */
/* =================== */

[data-theme="dark"] .mini-profile-tooltip,
[data-theme="dark"] .modal-dialog,
[data-theme="dark"] .toast-notification {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background: var(--bg-secondary);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.9);
}
