/* ============================================================================
   RSL Button Component
   ============================================================================
   Versatile button styles with multiple variants, sizes, and states.
   Supports both <button> and <a> elements for flexibility.

   Variants: primary, success, danger, warning, info, default
   Sizes: large, standard (default), small
   ============================================================================ */

/* ──────────────────────────────────────────────
   Base Button Styles
   ────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    line-height: 1.5;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.btn:hover {
    opacity: 0.85;
}

.btn:focus {
    outline: 2px solid #6E7BFF;
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(1px);
}

/* ──────────────────────────────────────────────
   Disabled State
   ────────────────────────────────────────────── */
.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

.btn:disabled:hover,
.btn[disabled]:hover {
    opacity: 0.6;
}

/* ──────────────────────────────────────────────
   Size Variants
   ────────────────────────────────────────────── */
.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ──────────────────────────────────────────────
   Color Variants
   ────────────────────────────────────────────── */

/* Primary - Blue */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

/* Success - Green */
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Danger - Red */
.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Warning - Yellow */
.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

/* Info - Cyan */
.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Default - Gray */
.btn-default {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.btn-default:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* ──────────────────────────────────────────────
   Outline Variants
   ────────────────────────────────────────────── */
.btn-outline-primary {
    background-color: transparent;
    border-color: #007bff;
    color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    color: #fff;
}

.btn-outline-success {
    background-color: transparent;
    border-color: #28a745;
    color: #28a745;
}

.btn-outline-success:hover {
    background-color: #28a745;
    color: #fff;
}

.btn-outline-danger {
    background-color: transparent;
    border-color: #dc3545;
    color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: #fff;
}

/* ──────────────────────────────────────────────
   Button Wrapper / Button Groups
   ────────────────────────────────────────────── */
.btn-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    border-top: 1px solid transparent;
}

/* Alignment modifiers */
.btn-wrapper-left {
    justify-content: flex-start;
}

.btn-wrapper-right {
    justify-content: flex-end;
}

/* Show border line above buttons */
.btn-wrapper-line {
    border-color: #ddd;
}

/* Spacing between buttons */
.btn-wrapper .btn:not(:last-child) {
    margin-right: 20px;
}

/* Button group for connected buttons */
.btn-group {
    display: inline-flex;
}

.btn-group .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.btn-group .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* ──────────────────────────────────────────────
   Dark Mode Support
   ────────────────────────────────────────────── */
[data-theme="dark"] .btn-wrapper-line {
    border-color: #444;
}

[data-theme="dark"] .btn-default {
    background-color: #4a4a4a;
    border-color: #4a4a4a;
}

[data-theme="dark"] .btn-default:hover {
    background-color: #5a5a5a;
    border-color: #5a5a5a;
}

/* ──────────────────────────────────────────────
   Glass-warm Pill Variant (Studio-pillow direction)
   Translucent warm-grey glass pill with gradient border.
   Requires a non-opaque background behind it to work.
   ────────────────────────────────────────────── */
.btn-glass-warm {
    position: relative;
    padding: 0.65rem 1.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(242, 242, 240, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #2c2c2a;
    font-weight: 400;
    letter-spacing: 0.02em;
    box-shadow:
        0 2px 12px rgba(60, 55, 50, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-glass-warm:hover {
    opacity: 1;
    background: rgba(242, 242, 240, 0.32);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow:
        0 4px 20px rgba(60, 55, 50, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-glass-warm:focus {
    outline: 2px solid rgba(100, 90, 80, 0.4);
    outline-offset: 3px;
}

.btn-glass-warm:active {
    transform: translateY(1px);
    background: rgba(242, 242, 240, 0.38);
}

/* Dark variant — for glass-warm on dark/forest-green backgrounds */
.btn-glass-warm-dark {
    position: relative;
    padding: 0.65rem 1.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(20, 20, 18, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f2f2f0;
    font-weight: 400;
    letter-spacing: 0.02em;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-glass-warm-dark:hover {
    opacity: 1;
    background: rgba(20, 20, 18, 0.38);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-glass-warm-dark:focus {
    outline: 2px solid rgba(242, 242, 240, 0.4);
    outline-offset: 3px;
}

.btn-glass-warm-dark:active {
    transform: translateY(1px);
}

/* ──────────────────────────────────────────────
   Responsive Adjustments
   ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .btn-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-wrapper .btn:not(:last-child) {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
