/**
 * UNIFIED BUTTON DESIGN SYSTEM
 * 
 * Ensures all buttons across the site have consistent, professional styling
 * Applies to: Review pages, App pages, Club pages, Article pages
 * 
 * Design Philosophy: Premium gold gradient for primary actions, 
 * purple gradient for secondary, clean states for tertiary
 */

/* ========================================
   PRIMARY BUTTONS - Gold Gradient (Main CTA)
   ======================================== */

/* Primary button classes */
.btn-primary,
.btn-play,
.app-hero-btn,
.club-hero-btn,
.hero-cta,
.site-cta-btn,
.download-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: #0f172a !important;
    padding: 16px 32px !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.4) !important;
    cursor: pointer !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Hover effect */
.btn-primary:hover,
.btn-play:hover,
.app-hero-btn:hover,
.club-hero-btn:hover,
.hero-cta:hover,
.site-cta-btn:hover,
.download-btn-primary:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 40px rgba(251, 191, 36, 0.6) !important;
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Active/pressed state */
.btn-primary:active,
.btn-play:active,
.app-hero-btn:active,
.club-hero-btn:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 15px rgba(251, 191, 36, 0.4) !important;
}

/* ========================================
   SECONDARY BUTTONS - Purple Gradient
   ======================================== */

/* Secondary button classes */
.btn-secondary,
.btn-review,
.app-info-btn,
.review-link-btn,
.download-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: white !important;
    padding: 14px 28px !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3) !important;
    cursor: pointer !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    white-space: nowrap;
}

/* Hover effect */
.btn-secondary:hover,
.btn-review:hover,
.app-info-btn:hover,
.review-link-btn:hover,
.download-btn-secondary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4) !important;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa) !important;
}

/* Active state */
.btn-secondary:active,
.btn-review:active,
.app-info-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

/* ========================================
   TERTIARY BUTTONS - Clean Gray/White
   ======================================== */

/* Tertiary/outline button classes */
.btn-tertiary,
.btn-outline,
.club-card-btn,
.back-button,
.view-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f1f5f9 !important;
    color: #6366f1 !important;
    padding: 12px 24px !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    white-space: nowrap;
}

/* Hover effect */
.btn-tertiary:hover,
.btn-outline:hover,
.club-card-btn:hover,
.view-all-btn:hover {
    background: white !important;
    border-color: #6366f1 !important;
    color: #4f46e5 !important;
    transform: translateY(-1px) !important;
}

/* ========================================
   BUTTON GROUPS - Side by side buttons
   ======================================== */

.site-actions,
.btn-group,
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* Grid layout for equal-width buttons */
.site-actions.grid,
.btn-group.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ========================================
   BUTTON SIZES - Small, Medium, Large
   ======================================== */

/* Small buttons */
.btn-sm,
.btn-primary.btn-sm,
.btn-secondary.btn-sm {
    padding: 10px 20px !important;
    font-size: 0.875rem !important;
    border-radius: 8px !important;
}

/* Large buttons */
.btn-lg,
.btn-primary.btn-lg,
.btn-secondary.btn-lg {
    padding: 18px 40px !important;
    font-size: 1.1rem !important;
    border-radius: 14px !important;
}

/* ========================================
   BUTTON STATES - Disabled, Loading
   ======================================== */

/* Disabled state */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-tertiary:disabled,
.btn-primary[disabled],
.btn-secondary[disabled],
.btn-tertiary[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

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

.btn-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-color: white white white transparent;
    animation: btn-spin 0.6s linear infinite;
}

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

/* ========================================
   ICON BUTTONS - With arrow, download icons
   ======================================== */

/* Right arrow icon */
.btn-with-arrow::after {
    content: '→';
    margin-left: 4px;
    font-size: 1.2em;
    transition: transform 0.2s ease;
}

.btn-with-arrow:hover::after {
    transform: translateX(3px);
}

/* Download icon */
.btn-download::before {
    content: '⬇';
    margin-right: 6px;
    font-size: 1.1em;
}

/* External link icon */
.btn-external::after {
    content: '↗';
    margin-left: 4px;
    font-size: 0.9em;
    opacity: 0.7;
}

/* ========================================
   FULL-WIDTH BUTTONS - Mobile friendly
   ======================================== */

.btn-block,
.btn-full-width {
    width: 100% !important;
    justify-content: center !important;
}

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

@media (max-width: 768px) {
    /* Stack button groups vertically on mobile */
    .site-actions,
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .site-actions > *,
    .btn-group > * {
        width: 100%;
    }
    
    /* Slightly smaller padding on mobile */
    .btn-primary,
    .btn-secondary {
        padding: 14px 24px !important;
        font-size: 0.95rem !important;
    }
}

/* ========================================
   SPECIAL BUTTON VARIANTS
   ======================================== */

/* Success button (green) */
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3) !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.4) !important;
}

/* Danger button (red) */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3) !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.4) !important;
}

/* Ghost button (transparent with border) */
.btn-ghost {
    background: transparent !important;
    color: white !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    box-shadow: none !important;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.5) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* ========================================
   CARD BUTTONS - For use inside cards
   ======================================== */

.card .btn-primary,
.card .btn-secondary,
.site-card .btn-primary,
.site-card .btn-secondary {
    margin-top: auto; /* Push to bottom of flex container */
}

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

/* Focus states for keyboard navigation */
.btn-primary:focus,
.btn-secondary:focus,
.btn-tertiary:focus {
    outline: 3px solid #fbbf24 !important;
    outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-secondary,
    .btn-tertiary {
        border: 2px solid currentColor !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btn-primary,
    .btn-secondary,
    .btn-tertiary {
        transition: none !important;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-tertiary:hover {
        transform: none !important;
    }
}
