/* =============================================================================
   PMTNM Button System - Wikipedia Style
   =============================================================================
   Single source of truth for all button styles. WCAG AA compliant.
   
   Classes:
   - .btn                  Base button (Wikipedia-style gray)
   - .btn-primary          Primary action (Wikipedia gray with clear border)
   - .btn-secondary        Secondary action (White with blue border)
   - .btn-action           High-emphasis action (Dark blue, white text)
   - .btn-success          Positive action (Green)
   - .btn-danger           Destructive action (Red border)
   - .btn-sm               Small size
   - .btn-lg               Large size
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Base Button
   ----------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid #d0d0d0;
    border-radius: 0;
    background-color: #f8f9fa;
    color: #000000;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    background-color: #eaf3ff;
    text-decoration: none;
    color: #000000;
}

.btn:focus {
    outline: 1px solid #000000;
    outline-offset: 1px;
}

.btn:active {
    background-color: #d8e6ff;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* -----------------------------------------------------------------------------
   Button Variants
   ----------------------------------------------------------------------------- */

/* Primary - Default Wikipedia style (gray background, black text) */
.btn-primary {
    background-color: #f8f9fa;
    color: #000000;
    border: 1px solid #d0d0d0;
}

.btn-primary:hover {
    background-color: #eaf3ff;
    color: #000000;
}

.btn-primary:active {
    background-color: #d8e6ff;
}

/* Fix visited link color override */
.btn-primary:link,
.btn-primary:visited {
    color: #000000;
}

/* Secondary - White with blue accent border */
.btn-secondary {
    background-color: #ffffff;
    color: #0645ad;
    border: 1px solid #a7d7f9;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
    color: #0645ad;
}

.btn-secondary:link,
.btn-secondary:visited {
    color: #0645ad;
}

/* Action - High-emphasis dark button (for CTAs that need to stand out) */
.btn-action {
    background-color: #183661;
    color: #ffffff;
    border: 1px solid #183661;
}

.btn-action:hover {
    background-color: #0f2441;
    color: #ffffff;
}

.btn-action:link,
.btn-action:visited {
    color: #ffffff;
}

/* Success - Positive actions */
.btn-success {
    background-color: #d5fdf4;
    color: #046c4e;
    border: 1px solid #0e9f6e;
}

.btn-success:hover {
    background-color: #bcf0de;
    color: #046c4e;
}

.btn-success:link,
.btn-success:visited {
    color: #046c4e;
}

/* Danger - Destructive actions */
.btn-danger {
    background-color: #f8f9fa;
    color: #ba0000;
    border: 1px solid #ba0000;
}

.btn-danger:hover {
    background-color: #fde8e8;
    color: #ba0000;
}

.btn-danger:link,
.btn-danger:visited {
    color: #ba0000;
}

/* Warning - Caution actions */
.btn-warning {
    background-color: #fef6e7;
    color: #8e4b10;
    border: 1px solid #e3a008;
}

.btn-warning:hover {
    background-color: #fde68a;
    color: #8e4b10;
}

.btn-warning:link,
.btn-warning:visited {
    color: #8e4b10;
}

/* Warn (legacy alias for danger) */
.btn.warn {
    background-color: #f8f9fa;
    color: #ba0000;
    border: 1px solid #ba0000;
}

.btn.warn:hover {
    background-color: #fde8e8;
}

/* -----------------------------------------------------------------------------
   Button Sizes
   ----------------------------------------------------------------------------- */

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* -----------------------------------------------------------------------------
   Button Groups
   ----------------------------------------------------------------------------- */

.btn-group {
    display: inline-flex;
}

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

.btn-group .btn:not(:last-child) {
    border-right: none;
}

/* -----------------------------------------------------------------------------
   Link Buttons (button that looks like a link)
   ----------------------------------------------------------------------------- */

.btn-link {
    background: transparent;
    border: none;
    color: #0645ad;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    background: transparent;
    color: #0b0080;
}

/* -----------------------------------------------------------------------------
   Accessibility: Focus States
   ----------------------------------------------------------------------------- */

.btn:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .btn {
        transition: none;
    }
}
