/**
 * 现代化按钮样式系统
 * 赛事管理系统 - 统一按钮配置
 * 更新日期: 2026-01-20
 */

/* ============================================
   全局按钮基础样式 - 紧凑版
   ============================================ */
.btn {
    position: relative;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 4px !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    box-shadow: none !important;
}

.btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn[disabled]:hover {
    transform: none;
}


/* ============================================
   主要按钮 - Primary
   ============================================ */
.btn-primary {
    color: #ffffff !important;
    background: #4073fa !important;
    border: none !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    color: #ffffff !important;
    background: #3461db !important;
}

.btn-primary[disabled] {
    background: #93b4fd !important;
}


/* ============================================
   成功按钮 - Success
   ============================================ */
.btn-success {
    color: #ffffff !important;
    background: #10b981 !important;
    border: none !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    color: #ffffff !important;
    background: #059669 !important;
}

.btn-success[disabled] {
    background: #6ee7b7 !important;
}


/* ============================================
   危险按钮 - Danger
   ============================================ */
.btn-danger {
    color: #ffffff !important;
    background: #ef4444 !important;
    border: none !important;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    color: #ffffff !important;
    background: #dc2626 !important;
}

.btn-danger[disabled] {
    background: #fca5a5 !important;
}


/* ============================================
   警告按钮 - Warning
   ============================================ */
.btn-warning {
    color: #ffffff !important;
    background: #f59e0b !important;
    border: none !important;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    color: #ffffff !important;
    background: #d97706 !important;
}

.btn-warning[disabled] {
    background: #fcd34d !important;
}


/* ============================================
   信息按钮 - Info
   ============================================ */
.btn-info {
    color: #ffffff !important;
    background: #0ea5e9 !important;
    border: none !important;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    color: #ffffff !important;
    background: #0284c7 !important;
}

.btn-info[disabled] {
    background: #7dd3fc !important;
}


/* ============================================
   默认按钮 - Default
   ============================================ */
.btn-default {
    color: #475569 !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
}

.btn-default:hover,
.btn-default:focus,
.btn-default:active {
    color: #1e293b !important;
    background: #f8fafc !important;
    border-color: #9ca3af !important;
}

.btn-default[disabled] {
    background: #f8fafc !important;
    color: #cbd5e1 !important;
}


/* ============================================
   按钮尺寸变体
   ============================================ */
.btn-lg {
    padding: 8px 16px;
    font-size: 14px;
    height: 36px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    height: 28px;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    height: 24px;
}


/* ============================================
   按钮块级显示
   ============================================ */
.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}


/* ============================================
   按钮组样式
   ============================================ */
.btn-group {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-group .btn {
    margin: 0;
}


/* ============================================
   带图标的按钮
   ============================================ */
.btn .glyphicon,
.btn .fa {
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.btn-sm .glyphicon,
.btn-sm .fa {
    font-size: 12px;
}

.btn-lg .glyphicon,
.btn-lg .fa {
    font-size: 16px;
}


/* ============================================
   加载状态按钮
   ============================================ */
.btn-loading {
    position: relative;
    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 rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: btn-spin 0.6s linear infinite;
}

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


/* ============================================
   轮廓按钮（空心）
   ============================================ */
.btn-outline-primary {
    color: #4f46e5;
    background: transparent;
    border: 2px solid #4f46e5;
    box-shadow: none;
}

.btn-outline-primary:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-color: #4f46e5;
}

.btn-outline-success {
    color: #10b981;
    background: transparent;
    border: 2px solid #10b981;
    box-shadow: none;
}

.btn-outline-success:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    border-color: #10b981;
}

.btn-outline-danger {
    color: #ef4444;
    background: transparent;
    border: 2px solid #ef4444;
    box-shadow: none;
}

.btn-outline-danger:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    border-color: #ef4444;
}

.btn-outline-warning {
    color: #f59e0b;
    background: transparent;
    border: 2px solid #f59e0b;
    box-shadow: none;
}

.btn-outline-warning:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border-color: #f59e0b;
}


/* ============================================
   下拉按钮样式
   ============================================ */
.btn.dropdown-toggle {
    padding-right: 28px;
}

.btn.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    border-top: 5px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}


/* ============================================
   响应式调整
   ============================================ */
@media (max-width: 768px) {
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .btn-sm {
        padding: 5px 12px;
        font-size: 12px;
    }
}


/* ============================================
   打印样式
   ============================================ */
@media print {
    .btn {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}


/* ============================================
   特殊场景按钮
   ============================================ */

/* 圆形按钮 */
.btn-circle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn-circle.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-circle.btn-lg {
    width: 48px;
    height: 48px;
}

/* 圆角按钮 */
.btn-pill {
    border-radius: 50px;
    padding-left: 24px;
    padding-right: 24px;
}

/* 渐变动画按钮 */
.btn-gradient-animated {
    background-size: 200% auto;
    transition: 0.5s;
}

.btn-gradient-animated:hover {
    background-position: right center;
}


/* ============================================
   主题色按钮（用于赛事系统特色）
   ============================================ */
.btn-race {
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    border: 1px solid #7c3aed;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-race:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #db2777 100%);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
    transform: translateY(-2px);
}

.btn-champion {
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
    border: 1px solid #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-champion:hover {
    background: linear-gradient(135deg, #d97706 0%, #ca8a04 100%);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px) scale(1.05);
}
