/* Custom styles to complement Bootstrap theme */

:root {
    --club-red: #ef4444;
    --club-black: #1a1a1a;
    --club-white: #ffffff;
    --club-red-dark: #dc2626;
    --club-red-light: #fca5a5;
}

/* PWA Mobile App Styles */
html, body {
    height: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent text selection on UI elements but allow in forms */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Remove browser chrome on mobile */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* iOS Safari specific */
@supports (-webkit-touch-callout: none) {
    body {
        padding-top: constant(safe-area-inset-top);
        padding-bottom: constant(safe-area-inset-bottom);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Mobile-first navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    min-height: 38px;
    padding: 8px 12px;
}

/* Card improvements for mobile */
.card {
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 16px;
}

.card-header {
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
}

.card-body {
    padding: 20px;
}

/* Mobile table improvements */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 12px;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    
    .table {
        min-width: 800px !important;
        margin-bottom: 0;
    }
    
    .table th, .table td {
        padding: 12px 8px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .btn-group {
        display: flex;
        flex-direction: row;
        gap: 2px;
        min-width: 200px;
    }
    
    .btn-group .btn {
        margin: 0;
        border-radius: 6px;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .btn-group .btn i {
        font-size: 10px;
    }
    
    /* Ensure player name links are visible */
    .table td a {
        color: inherit;
        text-decoration: none;
    }
    
    .table td a:hover {
        color: var(--bs-primary);
        text-decoration: underline;
    }
}

/* Mobile container adjustments */
@media (max-width: 576px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .card {
        margin-left: -4px;
        margin-right: -4px;
    }
}

/* Fix for iOS double-tap zoom */
* {
    touch-action: manipulation;
}

/* Better form controls for mobile */
.form-control, .form-select {
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: var(--club-red);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

/* Fix dropdown/select options visibility */
.form-select option {
    background-color: #2d2d2d;
    color: #ffffff;
    padding: 10px;
}

.form-select option:checked,
.form-select option:hover {
    background-color: var(--club-red);
    color: #ffffff;
}

/* Mobile navigation improvements */
@media (max-width: 991px) {
    .navbar-nav {
        padding: 16px 0;
    }
    
    .nav-link {
        padding: 12px 0;
        font-size: 18px;
    }
}

/* Floating action button for mobile */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* Hide scrollbars but keep functionality */
.scroll-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-hidden::-webkit-scrollbar {
    display: none;
}

/* Mobile modal improvements */
@media (max-width: 768px) {
    .modal-bottom .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: none;
    }
    
    .modal-bottom .modal-content {
        border-radius: 24px 24px 0 0;
        border: none;
    }
    
    .modal-bottom .modal-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 20px;
    }
    
    .modal-bottom .modal-body {
        padding: 20px;
    }
}

/* Better mobile tables */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 14px;
    }
    
    .table th:not(:first-child),
    .table td:not(:first-child) {
        text-align: center;
    }
    
    /* Hide less important columns on mobile */
    .table .d-none.d-md-table-cell {
        display: none !important;
    }
}

/* Install prompt styles */
.install-prompt {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: var(--club-red);
    color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    display: none;
}

.install-prompt.show {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Pull to refresh indicator */
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--club-red);
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 12px 12px;
    font-size: 14px;
    z-index: 1060;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Custom club-themed colors */
.bg-club-red {
    background-color: var(--club-red) !important;
}

.bg-club-black {
    background-color: var(--club-black) !important;
}

.text-club-red {
    color: var(--club-red) !important;
}

.text-club-white {
    color: var(--club-white) !important;
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Stats cards specific styling */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
}

.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-info .card-body,
.card.bg-warning .card-body {
    color: white;
}

/* Table improvements */
.table th {
    border-top: none;
    font-weight: 600;
    background: var(--bs-dark);
    color: var(--bs-light);
}

/* Ensure table rows have proper background in dark theme */
.table tbody tr {
    background-color: transparent !important;
}

.table tbody tr td {
    background-color: transparent !important;
    color: var(--bs-light);
}

/* Fix striped table background in dark theme */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: transparent !important;
}

/* Button group spacing */
.btn-group .btn {
    margin-right: 0;
}

/* Form improvements */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        flex: 1;
        margin: 2px;
    }
}

/* Loading states */
.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 transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation improvements */
.navbar-brand {
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 8px;
}

/* Empty states */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

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

/* Evaluation cards */
.evaluation-card {
    border-left: 4px solid var(--bs-primary);
}

.evaluation-card:nth-child(even) {
    border-left-color: var(--bs-success);
}

/* Skills rating indicators */
.skill-rating {
    display: inline-flex;
    align-items: center;
}

.skill-rating .rating-stars {
    margin-left: 0.5rem;
}

.skill-rating .rating-stars i {
    color: #ffc107;
    margin-right: 2px;
}

.skill-rating .rating-stars i.far {
    color: #e9ecef;
}

/* Footer */
.footer {
    background-color: var(--bs-dark);
    color: var(--bs-gray-300);
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Club-themed buttons */
.btn-club-red {
    background-color: var(--club-red);
    border-color: var(--club-red);
    color: white;
}

.btn-club-red:hover {
    background-color: var(--club-red-dark);
    border-color: var(--club-red-dark);
    color: white;
}

.btn-club-black {
    background-color: var(--club-black);
    border-color: var(--club-black);
    color: white;
}

.btn-club-black:hover {
    background-color: #333;
    border-color: #333;
    color: white;
}

/* Enhanced primary button with club colors */
.btn-primary {
    background-color: var(--club-red);
    border-color: var(--club-red);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--club-red-dark);
    border-color: var(--club-red-dark);
}

/* Stats cards with club colors */
.stats-card-red {
    background: linear-gradient(135deg, var(--club-red), var(--club-red-dark));
    color: white;
    border: none;
}

.stats-card-black {
    background: linear-gradient(135deg, var(--club-black), #333);
    color: white;
    border: none;
}

/* Table headers with club theme */
.table th {
    background: var(--club-red);
    color: white;
    border-color: var(--club-red-dark);
}

/* Badge styles with club colors */
.badge.bg-club-red {
    background-color: var(--club-red) !important;
}

.badge.bg-club-black {
    background-color: var(--club-black) !important;
}

