/**
 * ObscuraCams Dating Platform - Button System
 *
 * Standardized button styles for consistent UX across the platform.
 * Requires variables.css to be loaded first.
 */

/* ============================================
   BASE BUTTON STYLES
   ============================================ */

.btn-dating {
    /* Reset */
    appearance: none;
    border: none;
    outline: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    user-select: none;

    /* Base styles */
    font-weight: 600;
    border-radius: var(--radius-pill);
    transition: all var(--transition-base);

    /* Default medium size */
    padding: var(--btn-padding-md);
    font-size: var(--btn-font-md);
    min-height: var(--btn-height-md);
}

.btn-dating:disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   PRIMARY BUTTON (Main CTAs)
   ============================================ */

.btn-dating-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-dating-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
    filter: brightness(1.1);
}

.btn-dating-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-primary);
}

/* ============================================
   SECONDARY BUTTON (Alternative actions)
   ============================================ */

.btn-dating-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-dating-secondary:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-dating-secondary:active:not(:disabled) {
    transform: translateY(0);
}

/* ============================================
   TERTIARY BUTTON (Subtle actions)
   ============================================ */

.btn-dating-tertiary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-subtle);
}

.btn-dating-tertiary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-border-subtle-hover);
    color: var(--color-text-primary);
}

/* ============================================
   GHOST BUTTON (Text-only)
   ============================================ */

.btn-dating-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: none;
    padding: var(--btn-padding-sm);
}

.btn-dating-ghost:hover:not(:disabled) {
    color: var(--color-primary);
    background: rgba(255, 145, 0, 0.1);
}

/* ============================================
   ACCENT VARIANTS
   ============================================ */

/* Dating Pink Accent */
.btn-dating-accent {
    background: var(--gradient-dating);
    color: white;
    border: none;
}

.btn-dating-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-dating);
    filter: brightness(1.1);
}

/* Success */
.btn-dating-success {
    background: var(--gradient-success);
    color: white;
    border: none;
}

.btn-dating-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    filter: brightness(1.1);
}

/* Error/Danger */
.btn-dating-danger {
    background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-light) 100%);
    color: white;
    border: none;
}

.btn-dating-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    filter: brightness(1.1);
}

/* Warning */
.btn-dating-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.btn-dating-warning:hover:not(:disabled) {
    background: rgba(255, 193, 7, 0.2);
    border-color: var(--color-warning);
}

/* ============================================
   SIZE VARIANTS
   ============================================ */

.btn-dating-sm {
    padding: var(--btn-padding-sm);
    font-size: var(--btn-font-sm);
    min-height: var(--btn-height-sm);
    gap: 6px;
}

.btn-dating-md {
    padding: var(--btn-padding-md);
    font-size: var(--btn-font-md);
    min-height: var(--btn-height-md);
    gap: 8px;
}

.btn-dating-lg {
    padding: var(--btn-padding-lg);
    font-size: var(--btn-font-lg);
    min-height: var(--btn-height-lg);
    gap: 10px;
}

/* ============================================
   SHAPE VARIANTS
   ============================================ */

.btn-dating-rounded {
    border-radius: var(--radius-md);
}

.btn-dating-square {
    border-radius: var(--radius-sm);
}

.btn-dating-pill {
    border-radius: var(--radius-pill);
}

/* ============================================
   ICON BUTTONS
   ============================================ */

.btn-dating-icon {
    padding: 0;
    width: var(--btn-height-md);
    height: var(--btn-height-md);
    border-radius: 50%;
}

.btn-dating-icon.btn-dating-sm {
    width: var(--btn-height-sm);
    height: var(--btn-height-sm);
}

.btn-dating-icon.btn-dating-lg {
    width: var(--btn-height-lg);
    height: var(--btn-height-lg);
}

/* ============================================
   BLOCK BUTTON (Full width)
   ============================================ */

.btn-dating-block {
    width: 100%;
    display: flex;
}

/* ============================================
   LOADING STATE
   ============================================ */

.btn-dating-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-dating-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: btn-spin 0.6s linear infinite;
    color: white;
}

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

/* ============================================
   BUTTON GROUPS
   ============================================ */

.btn-dating-group {
    display: inline-flex;
    gap: var(--space-sm);
}

.btn-dating-group-attached {
    display: inline-flex;
    gap: 0;
}

.btn-dating-group-attached .btn-dating {
    border-radius: 0;
}

.btn-dating-group-attached .btn-dating:first-child {
    border-top-left-radius: var(--radius-pill);
    border-bottom-left-radius: var(--radius-pill);
}

.btn-dating-group-attached .btn-dating:last-child {
    border-top-right-radius: var(--radius-pill);
    border-bottom-right-radius: var(--radius-pill);
}

/* ============================================
   LEGACY COMPATIBILITY (for gradual migration)
   ============================================ */

/* Map old class names to new system */
.btn-primary-dating {
    /* Old class - extends new system */
    background: var(--gradient-primary);
    color: white;
    padding: var(--btn-padding-md);
    border-radius: var(--radius-pill);
    border: none;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-primary-dating:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
    color: white;
    text-decoration: none;
}

.btn-secondary-dating {
    /* Old class - extends new system */
    background: transparent;
    color: var(--color-primary);
    padding: var(--btn-padding-md);
    border-radius: var(--radius-pill);
    border: 2px solid var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-secondary-dating:hover {
    background: var(--color-primary);
    color: white;
    text-decoration: none;
}

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

@media (max-width: 768px) {
    /* Slightly larger touch targets on mobile */
    .btn-dating {
        min-height: calc(var(--btn-height-md) + 4px);
    }

    .btn-dating-sm {
        min-height: calc(var(--btn-height-sm) + 4px);
    }

    /* Full width on mobile for primary CTAs */
    .btn-dating-primary {
        width: 100%;
    }

    /* Adjust padding for smaller screens */
    .btn-dating-lg {
        padding: var(--btn-padding-md);
        font-size: var(--btn-font-md);
    }
}

@media (max-width: 480px) {
    /* Even larger touch targets on small phones */
    .btn-dating {
        min-height: 48px;
    }

    /* Reduce text in button groups */
    .btn-dating-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-dating-group .btn-dating {
        width: 100%;
    }
}

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

.btn-dating:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-dating:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-dating {
        border-width: 2px;
    }

    .btn-dating-primary,
    .btn-dating-accent,
    .btn-dating-success,
    .btn-dating-danger {
        border: 2px solid currentColor;
    }
}
