/**
 * ObscuraCams Dating Platform - Utility Classes
 *
 * Common utility classes for quick styling and interactions.
 * Requires variables.css to be loaded first.
 */

/* ============================================
   HOVER EFFECTS
   ============================================ */

/* Lift on hover */
.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Glow on hover */
.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 145, 0, 0.3);
}

/* Brighten on hover */
.hover-brighten {
    transition: filter var(--transition-base);
}

.hover-brighten:hover {
    filter: brightness(1.1);
}

/* Fade in on hover */
.hover-fade {
    opacity: var(--opacity-muted);
    transition: opacity var(--transition-base);
}

.hover-fade:hover {
    opacity: 1;
}

/* Border highlight on hover */
.hover-border {
    border: 1px solid var(--color-border-subtle);
    transition: border-color var(--transition-base);
}

.hover-border:hover {
    border-color: var(--color-border);
}

/* Background highlight on hover */
.hover-bg {
    transition: background-color var(--transition-base);
}

.hover-bg:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================
   INTERACTIVE STATES
   ============================================ */

/* Clickable cursor */
.clickable {
    cursor: pointer;
    user-select: none;
}

/* Disabled state */
.disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading state */
.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================
   CARD STYLES
   ============================================ */

.card-dating {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--color-border-subtle);
    transition: all var(--transition-base);
}

.card-dating:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-md);
}

.card-dating-interactive {
    cursor: pointer;
}

.card-dating-interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

/* ============================================
   BADGES & PILLS
   ============================================ */

.badge-dating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: var(--btn-font-sm);
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(255, 145, 0, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(255, 145, 0, 0.3);
}

.badge-success {
    background: rgba(76, 175, 80, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-error {
    background: rgba(244, 67, 54, 0.15);
    color: var(--color-error);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-info {
    background: rgba(33, 150, 243, 0.15);
    color: var(--color-info);
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.badge-dating-accent {
    background: rgba(233, 30, 99, 0.15);
    color: var(--color-dating-accent);
    border: 1px solid rgba(233, 30, 99, 0.3);
}

/* ============================================
   ONLINE STATUS INDICATORS
   ============================================ */

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: var(--btn-font-sm);
    font-weight: 600;
}

.status-online {
    background: rgba(76, 175, 80, 0.15);
    color: var(--color-online);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-online);
    animation: pulse-online 2s ease-in-out infinite;
}

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

.status-away {
    background: rgba(255, 193, 7, 0.15);
    color: var(--color-away);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-offline {
    background: rgba(102, 102, 102, 0.15);
    color: var(--color-offline);
    border: 1px solid rgba(102, 102, 102, 0.3);
}

/* ============================================
   COMPATIBILITY SCORES
   ============================================ */

.compatibility-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border: 2px solid;
}

.compatibility-high {
    border-color: var(--color-success);
    color: var(--color-success);
}

.compatibility-good {
    border-color: #8bc34a;
    color: #8bc34a;
}

.compatibility-medium {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.compatibility-low {
    border-color: var(--color-info);
    color: var(--color-info);
}

/* ============================================
   GRADIENTS & OVERLAYS
   ============================================ */

.gradient-overlay {
    position: relative;
}

.gradient-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: var(--gradient-dark);
    pointer-events: none;
}

.gradient-primary-bg {
    background: var(--gradient-primary);
}

.gradient-dating-bg {
    background: var(--gradient-dating);
}

/* ============================================
   TOOLTIPS
   ============================================ */

.tooltip-dating {
    position: relative;
}

.tooltip-dating::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    font-size: 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: var(--z-tooltip);
}

.tooltip-dating::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.tooltip-dating:hover::before,
.tooltip-dating:hover::after {
    opacity: 1;
}

/* ============================================
   ICEBREAKER PREVIEW (for cards)
   ============================================ */

.icebreaker-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 145, 0, 0.1);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: var(--space-sm);
}

.icebreaker-preview .icebreaker-icon {
    font-size: 16px;
}

.icebreaker-preview .icebreaker-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   MOBILE TOUCH TARGETS
   ============================================ */

@media (max-width: 768px) {
    /* Ensure minimum 44x44px touch targets on mobile */
    .clickable,
    .hover-lift,
    .hover-scale,
    .card-dating-interactive {
        min-width: 44px;
        min-height: 44px;
    }

    /* Larger badges on mobile */
    .badge-dating {
        padding: 8px 14px;
        font-size: 13px;
    }

    .status-indicator {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus styles */
.clickable:focus-visible,
.card-dating-interactive:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.clickable:focus:not(:focus-visible),
.card-dating-interactive:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }

    .loading::after,
    .status-online::before {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .badge-dating,
    .status-indicator {
        border-width: 2px;
    }

    .card-dating {
        border-width: 2px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .hover-lift,
    .hover-scale,
    .hover-glow,
    .hover-brighten {
        transform: none !important;
        box-shadow: none !important;
        filter: none !important;
    }
}
