/* ===================================
   COMPONENTS.CSS - Rey de la Cancha
   Reusable UI Components: Badges, Cards, Alerts, Modals, Forms
   =================================== */

/* ===== BADGES ===== */
.badge-custom {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.badge-attendance-high {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.badge-attendance-medium {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.badge-attendance-low {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.badge-status-active {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
}

.badge-status-suspended {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
}

.badge-status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.badge-position {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}

.badge-ghost {
    background: linear-gradient(135deg, #fecaca 0%, #fee2e2 100%);
    color: #991b1b;
    border: 2px solid #dc2626;
}

/* ===== CARDS ===== */
.card-player {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: var(--bg-primary, white);
    color: var(--text-primary, #212529);
}

[data-theme="dark"] .card-player {
    background: #2d2d2d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-player:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .card-player:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.card-player-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e5e7eb 100%);
    border-bottom: 3px solid #667eea;
}

[data-theme="dark"] .card-player-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.card-player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.card-team {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-primary, white);
    color: var(--text-primary, #212529);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

[data-theme="dark"] .card-team {
    background: #2d2d2d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-team:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .card-team:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.card-team-badge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    margin: 0 auto;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.card-match {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-primary, white);
    color: var(--text-primary, #212529);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

[data-theme="dark"] .card-match {
    background: #2d2d2d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-match::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.card-match-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

[data-theme="dark"] .card-match-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.card-stats {
    border: none;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    z-index: 1;
}

.card-stats > * {
    position: relative;
    z-index: 2;
}

.card-stats-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.card-stats-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-stats-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* ===== ALERTS ===== */
.alert-modern {
    border: none;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-modern-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-success-modern {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
    color: #065f46;
}

.alert-warning-modern {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-danger-modern {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: #ef4444;
    color: #991b1b;
}

.alert-info-modern {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #3b82f6;
    color: #1e3a8a;
}

/* ===== BUTTONS EXTRA ===== */
.btn-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.btn-gradient-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
}

.btn-gradient-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
    color: white;
}

.btn-outline-modern {
    border: 2px solid #667eea;
    color: #667eea;
    background: white;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-modern:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
}

/* ===== FORMS ===== */
.form-control-modern {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary, white);
    color: var(--text-primary, #212529);
}

[data-theme="dark"] .form-control-modern {
    background: #2d2d2d;
    border-color: #4b5563;
    color: #e2e8f0;
}

.form-control-modern:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

[data-theme="dark"] .form-control-modern:focus {
    background: #3a3a3a;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.form-label-modern {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

[data-theme="dark"] .form-label-modern {
    color: #e2e8f0;
}

.form-select-modern {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary, white);
    color: var(--text-primary, #212529);
    cursor: pointer;
}

[data-theme="dark"] .form-select-modern {
    background: #2d2d2d;
    border-color: #4b5563;
    color: #e2e8f0;
}

.form-select-modern:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

[data-theme="dark"] .form-select-modern:focus {
    background: #3a3a3a;
}

.form-check-modern {
    padding-left: 2rem;
}

.form-check-modern .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    cursor: pointer;
}

.form-check-modern .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-group-modern {
    margin-bottom: 1.5rem;
}

.input-group-modern {
    display: flex;
    gap: 0.5rem;
}

.input-group-modern .form-control-modern {
    flex: 1;
}

/* ===== MODALS ===== */
.modal-modern .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-modern .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 2rem;
    border: none;
}

.modal-modern .modal-title {
    font-weight: 700;
    font-size: 1.5rem;
}

.modal-modern .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-modern .modal-body {
    padding: 2rem;
    background: var(--bg-primary, white);
    color: var(--text-primary, #212529);
}

[data-theme="dark"] .modal-modern .modal-body {
    background: #2d2d2d;
}

.modal-modern .modal-footer {
    border: none;
    padding: 1rem 2rem 2rem 2rem;
    background: var(--bg-primary, white);
}

[data-theme="dark"] .modal-modern .modal-footer {
    background: #2d2d2d;
}

/* ===== PROGRESS BARS ===== */
.progress-modern {
    height: 12px;
    border-radius: 10px;
    background: #f1f5f9;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .progress-modern {
    background: #1a1a1a;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-modern .progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
}

.progress-modern-success .progress-bar {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.progress-modern-warning .progress-bar {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.progress-modern-danger .progress-bar {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

/* ===== TOOLTIPS ===== */
.tooltip-modern {
    position: relative;
    display: inline-block;
}

.tooltip-modern .tooltip-text {
    visibility: hidden;
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip-modern .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}

.tooltip-modern:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ===== PAGINATION ===== */
.pagination-modern {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.pagination-modern .page-item {
    margin: 0;
}

.pagination-modern .page-link {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    background: var(--bg-primary, white);
}

[data-theme="dark"] .pagination-modern .page-link {
    background: #2d2d2d;
    border-color: #4b5563;
    color: #818cf8;
}

.pagination-modern .page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* ===== TABS ===== */
.nav-tabs-modern {
    border: none;
    gap: 0.5rem;
}

.nav-tabs-modern .nav-link {
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 1rem 2rem;
    color: #64748b;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #f8fafc;
}

[data-theme="dark"] .nav-tabs-modern .nav-link {
    background: #1a1a1a;
    color: #94a3b8;
}

.nav-tabs-modern .nav-link:hover {
    background: #e5e7eb;
    color: #667eea;
}

[data-theme="dark"] .nav-tabs-modern .nav-link:hover {
    background: #2d2d2d;
    color: #818cf8;
}

.nav-tabs-modern .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-content-modern {
    border: 2px solid #e5e7eb;
    border-radius: 0 12px 12px 12px;
    padding: 2rem;
    background: var(--bg-primary, white);
    color: var(--text-primary, #212529);
}

[data-theme="dark"] .tab-content-modern {
    background: #2d2d2d;
    border-color: #4b5563;
}

/* ===== LOADING SPINNER ===== */
.spinner-modern {
    width: 50px;
    height: 50px;
    border: 5px solid #f1f5f9;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(26, 26, 26, 0.95);
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .empty-state-title {
    color: #f1f5f9;
}

.empty-state-description {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

[data-theme="dark"] .empty-state-description {
    color: #94a3b8;
}

/* ===================================
   RESPONSIVE UTILITIES
   =================================== */

/* Utilidades de display responsive */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* Stack buttons vertically on mobile */
    .btn-group-mobile {
        flex-direction: column;
        width: 100%;
    }

    .btn-group-mobile .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Full width cards on mobile */
    .card-mobile-full {
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
    }

    /* Hide unnecessary text on mobile */
    .hide-mobile-text {
        font-size: 0;
    }

    .hide-mobile-text::before {
        font-size: 1rem;
    }

    /* Adjust table for mobile */
    .table-responsive-mobile {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Reduce padding on mobile */
    .px-mobile-0 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .py-mobile-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    /* Center text on mobile */
    .text-mobile-center {
        text-align: center !important;
    }

    /* Adjust image sizes */
    .img-mobile-responsive {
        max-width: 100%;
        height: auto;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .tablet-hidden {
        display: none !important;
    }

    .tablet-visible {
        display: block !important;
    }
}

/* Touch-friendly sizing */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets for touch devices */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem !important;
    }

    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .card {
        margin-bottom: 1rem;
    }
}

/* Hover effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
}

[data-theme="dark"] .hover-lift:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.5) !important;
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Print styles */
@media print {
    .navbar-custom,
    .footer-custom,
    .back-to-top,
    .scroll-progress,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .card {
        border: 1px solid #dee2e6;
        box-shadow: none;
        page-break-inside: avoid;
    }
}

