/* Custom styles for Sports Club Manager with Bootstrap 5 */

/* Payment warning tooltip */
.payment-warning {
    color: #ff9800;
    font-size: 1.2em;
    margin-left: 8px;
    cursor: help;
    position: relative;
    display: inline-block;
}

.payment-warning::before {
    content: "Saldo: " attr(data-balance) " zł";
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #333;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
}

.payment-warning::after {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.payment-warning:hover::before,
.payment-warning:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px !important;
}

.sortable:hover {
    background-color: #f8f9fa !important;
}

.sort-indicator {
    position: absolute;
    right: 8px;
    opacity: 0.3;
    font-size: 0.9em;
}

.sort-indicator::before {
    content: '⇅';
}

.sortable.asc .sort-indicator {
    opacity: 1;
}

.sortable.asc .sort-indicator::before {
    content: '↑';
}

.sortable.desc .sort-indicator {
    opacity: 1;
}

.sortable.desc .sort-indicator::before {
    content: '↓';
}

/* Responsive table wrapper */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .table-responsive td,
    .table-responsive th {
        padding: 0.5rem !important;
    }
}

/* Additional Bootstrap customizations */
body {
    background-color: #f8f9fa;
}

.navbar-brand {
    font-size: 1.25rem;
}

/* Sticky footer spacing */
main {
    min-height: calc(100vh - 80px);
}

/* Card hover effect */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Button loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Table row hover */
tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Form focus state */
.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Alert animations */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge styles */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
