/* ============================================================================
   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;
}

/* ──────────────────────────────────────────────
   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;
    }
}
