/* Dashboard Styles */
:root {
    --primary-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #4CAF50;
    --success-color: #28a745;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196F3;
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    --border-radius: 12px;
    --border-radius-small: 8px;
    --box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1050;
}

.navbar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
}

/* Privacy badges */
.privacy-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
}

.privacy-badge i.fa-globe {
    color: var(--success-color);
}

.privacy-badge i.fa-lock {
    color: var(--warning-color);
}

/* Mobile club button variants */
.mobile-club-btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.nav-link:hover {
    transform: translateY(-1px);
}

.navbar-text {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Sidebar */
.sidebar {
    padding: 2rem 1rem;
}

.player-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
}

.player-avatar {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.player-card h4 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.player-stats {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
    padding: 2rem;
}

.welcome-section {
    margin-bottom: 2rem;
}

.welcome-section h1 {
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-section .lead {
    color: var(--text-muted);
}

/* Action Cards */
.action-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    height: 100%;
    margin-bottom: 1rem;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.action-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: var(--text-light);
}

.action-icon.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.action-icon.bg-success {
    background: linear-gradient(135deg, var(--accent-color), #45a049);
}

.action-icon.bg-info {
    background: linear-gradient(135deg, var(--info-color), #1976d2);
}

.action-card h5 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Section Cards */
.section-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.section-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-weight: 600;
    flex-grow: 1;
}

/* Club Cards */
.club-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    background: var(--bg-white);
}

.club-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.club-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.club-info h5 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.club-points {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.club-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.club-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Clubs Table Styling */
.clubs-table-container {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-card);
    overflow: hidden;
    margin-top: 0;
}

.clubs-table {
    margin: 0;
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

.clubs-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
}

.clubs-table th {
    padding: 16px 12px;
    font-weight: 600;
    border: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.clubs-table td {
    padding: 16px 12px;
    border: none;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

.club-table-row {
    transition: var(--transition);
}

.club-table-row:hover {
    background-color: rgba(30, 60, 114, 0.02);
}

.club-table-row:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

.club-table-row:nth-child(even):hover {
    background-color: rgba(30, 60, 114, 0.04);
}

.club-name-cell {
    max-width: 300px;
}

.club-name-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.club-name {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.current-club-badge {
    background: linear-gradient(135deg, var(--success-color), #20a037);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    align-self: flex-start;
    white-space: nowrap;
}

.club-description-small {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 2px;
    position: relative;
}

.club-description-small.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.club-description-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 4px;
    margin-top: 4px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.club-description-toggle:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.club-description-toggle i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.member-count {
    font-weight: 500;
    color: var(--text-dark);
}

.member-count.full-capacity {
    color: #dc3545 !important;
    font-weight: 600;
}

.member-count.near-capacity {
    color: #fd7e14 !important;
    font-weight: 600;
}

.points-display {
    font-weight: 600;
    color: var(--text-dark);
}

.points-display.high-points {
    color: var(--warning-color);
    font-weight: 700;
}

.table-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.table-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    transition: var(--transition);
}

.table-btn i {
    font-size: 0.75rem;
}

.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    font-weight: 500;
}

/* Responsive Table Design */
@media (max-width: 768px) {
    .clubs-table-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .clubs-table {
        font-size: 0.8rem;
    }
    
    .clubs-table th,
    .clubs-table td {
        padding: 12px 8px;
    }
    
    .club-name {
        font-size: 0.9rem;
    }
    
    .club-description-small {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .table-btn {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

@media (max-width: 640px) {
    .clubs-table {
        font-size: 0.75rem;
    }
    
    .clubs-table th,
    .clubs-table td {
        padding: 8px 4px;
    }
    
    .table-btn {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    
    .table-btn i {
        font-size: 0.6rem;
    }
    
    .member-count i,
    .points-display i,
    .trophies-display i {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    /* Hide the Points column on very small screens to make room */
    .clubs-table th:nth-child(3),
    .clubs-table td:nth-child(3) {
        display: none;
    }
    
    .clubs-table th,
    .clubs-table td {
        padding: 10px 6px;
    }
}

/* Responsive Design for Compact List */
@media (max-width: 768px) {
    .club-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }
    
    .club-actions {
        justify-content: space-between;
    }
    
    .club-info-grid {
        gap: 16px;
    }
    
    .action-buttons {
        flex: 1;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .club-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .club-info-grid {
        flex-direction: column;
        gap: 4px;
    }
    
    .club-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn-compact {
        flex: 1;
        justify-content: center;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a3461, #245287);
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-color), #45a049);
}

.btn-success:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #d32f2f);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f, #c62828);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dashboard-Specific Modal Enhancements */
/* These styles work with the uniform modal styles in global.css */

/* Enhanced Browse Clubs Modal - Additional Styles */
#browseClubsModal .modal-dialog {
    max-width: 900px;
}

/* Club Search Input Specific Styling */
#clubSearchInput {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    padding: 12px 16px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-white);
}

#clubSearchInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 60, 114, 0.25);
    outline: none;
}

#clubSearchInput::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Club Search Results Counter */
.search-results-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: var(--border-radius-small);
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #1565c0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-results-info i {
    color: #1976d2;
}

/* Dashboard-Specific Responsive Overrides */
@media (max-width: 768px) {
    #browseClubsModal .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }
}

/* Dashboard-Specific Table Styles */
.clubs-table-container {
    margin-top: 20px;
}

.clubs-table {
    background: var(--bg-white);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clubs-table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-dark);
    padding: 16px 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clubs-table tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.clubs-table tbody tr:hover {
    background-color: rgba(30, 60, 114, 0.02);
}

.club-table-row {
    transition: var(--transition);
}

.club-name-cell {
    min-width: 200px;
}

.club-name-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.club-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.current-club-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
    width: fit-content;
}

.club-description-small {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.3;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.member-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 500;
}

.points-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    color: var(--text-dark);
}

.points-display.high-points {
    color: var(--warning-color);
}

.trophies-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    color: var(--text-dark);
}

.trophies-display.high-trophies {
    color: #ffd700;
    font-weight: 700;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.table-btn {
    padding: 6px 12px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    border-radius: var(--border-radius-small) !important;
    transition: var(--transition) !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table-btn:hover {
    transform: translateY(-1px);
}

.table-btn i {
    font-size: 0.8rem;
}

/* ===================================================
   ENHANCED DASHBOARD MOBILE RESPONSIVENESS
   =================================================== */

/* Base Dashboard Layout Improvements */
@media (max-width: 991.98px) {
    .sbh-main-content {
        padding-top: 10px; /* Account for fixed navbar */
    }
    
    .col-lg-3.col-md-4.mb-4 {
        order: 1; /* Show sidebar first on mobile */
        margin-bottom: 2rem !important;
    }
    
    .col-lg-9.col-md-8 {
        order: 2;
    }
}

@media (max-width: 768px) {
    .sbh-main-content {
        padding-top: 10px;
    }
    
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Welcome section adjustments */
    .sbh-card .display-6 {
        font-size: 1.5rem !important;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .sbh-card .lead {
        font-size: 1rem !important;
        margin-bottom: 0;
    }
    
    /* Club section header improvements */
    .sbh-card-header .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }
    
    .sbh-card-header .sbh-card-title {
        text-align: center;
        margin-bottom: 0;
    }
    
    .sbh-card-header .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .sbh-main-content {
        padding-top: 10px;
    }
    
    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* More compact welcome section */
    .sbh-card .display-6 {
        font-size: 1.3rem !important;
        line-height: 1.2;
    }
    
    .sbh-card .lead {
        font-size: 0.95rem !important;
    }
    
    /* Improved card spacing */
    .sbh-card {
        margin-bottom: 1.5rem;
        padding: 16px;
    }
    
    .sbh-card-header {
        padding: 12px 16px;
    }
    
    .sbh-card-title {
        font-size: 1.1rem;
    }
    
    /* Better action button styling */
    .sbh-card-header .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .sbh-main-content {
        padding-top: 10px;
    }
    
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Ultra compact design */
    .sbh-card .display-6 {
        font-size: 1.2rem !important;
    }
    
    .sbh-card .lead {
        font-size: 0.9rem !important;
    }
    
    .sbh-card {
        padding: 14px;
        margin-bottom: 1.25rem;
    }
    
    .sbh-card-header {
        padding: 10px 14px;
    }
    
    .sbh-card-title {
        font-size: 1rem;
    }
    
    .sbh-card-header .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 375px) {
    /* iPhone SE and very small screens */
    .sbh-main-content {
        padding-top: 10px;
    }
    
    .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    .sbh-card .display-6 {
        font-size: 1.1rem !important;
        word-break: break-word;
    }
    
    .sbh-card .lead {
        font-size: 0.85rem !important;
    }
    
    .sbh-card {
        padding: 12px;
        margin-bottom: 1rem;
    }
    
    .sbh-card-header {
        padding: 8px 12px;
    }
    
    .sbh-card-title {
        font-size: 0.95rem;
    }
}

/* Enhanced Modal Responsiveness for Dashboard */
@media (max-width: 768px) {
    #browseClubsModal .modal-dialog {
        max-width: 95% !important;
        margin: 0.5rem !important;
        width: calc(100% - 1rem) !important;
    }
    
    #browseClubsModal .modal-content {
        border-radius: var(--border-radius-small);
    }
    
    #browseClubsModal .modal-header {
        padding: 16px 20px;
    }
    
    #browseClubsModal .modal-body {
        padding: 16px 20px;
    }
    
    .club-search-section .row {
        gap: 10px;
        margin: 0;
    }
    
    .club-search-section .col-md-8,
    .club-search-section .col-md-4 {
        padding: 0;
        flex: 1;
    }
    
    .club-search-section .col-md-4 {
        flex: 0 0 auto;
        min-width: 80px;
    }
}

/* Start showing mobile cards on tablets and smaller - including large phones like iPhone XR */
@media (max-width: 991px) {
    /* Convert table to mobile-friendly card layout */
    .clubs-table-container .table-responsive,
    .clubs-table-container .clubs-table {
        display: none !important; /* Hide the table on mobile */
    }
    
    /* Show mobile club cards */
    .mobile-clubs-container {
        display: block !important;
    }
}

@media (max-width: 576px) {
    .club-search-section .row {
        flex-direction: column;
    }
    
    .club-search-section .col-md-8,
    .club-search-section .col-md-4 {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .club-search-section .col-md-4 {
        margin-bottom: 0;
    }
}

/* Mobile Club Cards for phones like iPhone SE (375x667) */
@media (max-width: 480px) {
    #browseClubsModal .modal-dialog {
        max-width: 98% !important;
        margin: 0.25rem !important;
        width: calc(100% - 0.5rem) !important;
    }
    
    #browseClubsModal .modal-header {
        padding: 12px 16px;
    }
    
    #browseClubsModal .modal-body {
        padding: 12px 16px;
    }
    
    #browseClubsModal .modal-title {
        font-size: 1.1rem;
    }
    
    /* Force table to be hidden and show mobile cards */
    .clubs-table-container .table-responsive,
    .clubs-table-container .clubs-table {
        display: none !important;
    }
    
    .mobile-clubs-container {
        display: block !important;
    }
}

/* Mobile club card styles */
.mobile-clubs-container {
    display: none; /* Hidden by default, shown on mobile */
}

.mobile-club-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-small);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.mobile-club-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-club-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.mobile-club-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.mobile-club-badge {
    background: linear-gradient(135deg, var(--success-color), #20a037);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 8px;
}

.mobile-club-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 12px;
    position: relative;
}

.mobile-club-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-club-description-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 0;
    margin-top: 6px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    justify-content: center;
}

.mobile-club-description-toggle:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.mobile-club-description-toggle i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

/* Enhanced responsive improvements for description toggles */
@media (max-width: 991px) {
    /* Mobile-first approach: ensure mobile cards are visible on all mobile devices */
    .mobile-clubs-container {
        display: block !important;
    }
    
    .clubs-table-container {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .club-description-toggle,
    .mobile-club-description-toggle {
        font-size: 0.8rem;
        padding: 6px 8px;
        margin-top: 8px;
        background-color: rgba(30, 60, 114, 0.05);
        border-radius: 16px;
        border: 1px solid rgba(30, 60, 114, 0.1);
    }
    
    .club-description-toggle:hover,
    .mobile-club-description-toggle:hover {
        background-color: rgba(30, 60, 114, 0.1);
        transform: translateY(-1px);
    }
    
    .mobile-club-description,
    .club-description-small {
        font-size: 0.9rem;
        line-height: 1.5;
        padding-bottom: 4px;
    }
}

/* Smooth animation for description expansion */
.mobile-club-description,
.club-description-small {
    transition: all 0.3s ease;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Enhanced touch targets for mobile - increased breakpoint for large phones */
@media (max-width: 991px) {
    .club-description-toggle,
    .mobile-club-description-toggle {
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(30, 60, 114, 0.1);
    }
    
    /* Ensure mobile cards are always visible on mobile devices */
    .mobile-clubs-container {
        display: block !important;
    }
    
    /* Better spacing for mobile */
    .mobile-club-card {
        margin-bottom: 16px;
        padding: 20px;
    }
    
    .mobile-club-description {
        margin-bottom: 16px;
    }
}

.mobile-club-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-top: 1px solid #f1f3f4;
    border-bottom: 1px solid #f1f3f4;
    gap: 8px;
}

.mobile-club-stat {
    text-align: center;
    flex: 1;
    min-width: 0; /* Allow flex items to shrink */
}

.mobile-club-stat-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    display: block;
}

.mobile-club-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-club-actions {
    display: flex;
    gap: 8px;
}

.mobile-club-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: var(--border-radius-small);
    border: none;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mobile-club-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.mobile-club-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 60, 114, 0.3);
    color: white;
}

.mobile-club-btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.mobile-club-btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

.mobile-club-btn-secondary:disabled {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Very small screens (like iPhone SE in portrait) */
@media (max-width: 375px) {
    #browseClubsModal .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
        width: 100% !important;
        height: 100vh;
    }
    
    #browseClubsModal .modal-content {
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    #browseClubsModal .modal-body {
        padding: 8px 12px;
        overflow-y: auto;
    }
    
    .mobile-club-card {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .mobile-club-header {
        margin-bottom: 8px;
    }
    
    .mobile-club-name {
        font-size: 0.95rem;
    }
    
    .mobile-club-description {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .mobile-club-stats {
        margin-bottom: 8px;
        padding: 6px 0;
        gap: 4px;
    }
    
    .mobile-club-stat-value {
        font-size: 1rem;
    }
    
    .mobile-club-stat-label {
        font-size: 0.7rem;
    }
    
    .mobile-club-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .club-search-section input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ===================================================
   NO CLUB MEMBERSHIP STATE STYLING
   =================================================== */

.no-club-state {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f1f3f4 100%);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed var(--border-color);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.no-club-state::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(30, 60, 114, 0.05) 0%, transparent 70%);
    z-index: 1;
    animation: pulse-background 4s ease-in-out infinite;
}

@keyframes pulse-background {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.1; }
}

.no-club-state:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(30, 60, 114, 0.15);
}

.no-club-icon {
    position: relative;
    z-index: 2;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(30, 60, 114, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.no-club-icon i {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.no-club-content {
    position: relative;
    z-index: 2;
}

.no-club-title {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.no-club-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.no-club-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.no-club-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem !important;
    border-radius: var(--border-radius) !important;
    font-weight: 600 !important;
    transition: var(--transition) !important;
    border: none !important;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.no-club-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.no-club-btn:hover::before {
    left: 100%;
}

.no-club-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

.no-club-btn i {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.no-club-btn:hover i {
    transform: scale(1.1);
}

.no-club-btn span {
    font-size: 0.9rem;
    font-weight: 500;
}

.sbh-btn-success {
    background: linear-gradient(135deg, var(--accent-color), #45a049) !important;
    color: white !important;
}

.sbh-btn-success:hover {
    background: linear-gradient(135deg, #45a049, var(--accent-color)) !important;
    color: white !important;
}

.sbh-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: white !important;
}

.sbh-btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    color: white !important;
}

.sbh-btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268) !important;
    color: white !important;
}

.sbh-btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #6c757d) !important;
    color: white !important;
}

/* Mobile Responsiveness for No Club State */
@media (max-width: 768px) {
    .no-club-state {
        padding: 2rem 1.5rem;
    }
    
    .no-club-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }
    
    .no-club-icon i {
        font-size: 2rem;
    }
    
    .no-club-title {
        font-size: 1.3rem;
    }
    
    .no-club-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .no-club-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .no-club-btn {
        width: 100%;
        max-width: 280px;
        padding: 0.875rem 1.25rem !important;
    }
}

@media (max-width: 576px) {
    .no-club-state {
        padding: 1.5rem 1rem;
    }
    
    .no-club-icon {
        width: 60px;
        height: 60px;
    }
    
    .no-club-icon i {
        font-size: 1.75rem;
    }
    
    .no-club-title {
        font-size: 1.2rem;
    }
    
    .no-club-description {
        font-size: 0.95rem;
    }
    
    .no-club-btn {
        padding: 0.75rem 1rem !important;
        min-width: 100px;
    }
    
    .no-club-btn i {
        font-size: 1.1rem;
    }
    
    .no-club-btn span {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .no-club-actions {
        gap: 0.5rem;
    }
    
    .no-club-btn {
        flex-direction: row;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .no-club-btn i {
        margin-bottom: 0;
        font-size: 1rem;
    }
    
    .no-club-btn span {
        font-size: 0.8rem;
    }
}

/* Club Chat Styles */
.club-chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background: var(--bg-white);
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
    border-radius: var(--border-radius-small) var(--border-radius-small) 0 0;
}

.chat-header h6 {
    margin-bottom: 4px;
    color: var(--primary-color);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 350px;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    word-wrap: break-word;
}

.chat-message.own {
    align-self: flex-end;
}

.chat-message.other {
    align-self: flex-start;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-sender {
    font-weight: 600;
    font-size: 0.85rem;
}

.message-sender.own {
    color: var(--primary-color);
}

.message-sender.other {
    color: var(--secondary-color);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-role {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
}

.message-role.owner {
    background-color: var(--danger-color);
}

.message-role.admin {
    background-color: var(--warning-color);
}

.message-role.member {
    background-color: var(--text-muted);
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message.own .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-bottom-right-radius: 6px;
}

.chat-message.other .message-content {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 6px;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    border-radius: 0 0 var(--border-radius-small) var(--border-radius-small);
}

.chat-input-footer {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.chat-empty i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.chat-date-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.chat-date-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.chat-date-separator span {
    background: var(--bg-white);
    padding: 0 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
}

/* Chat input enhancements */
#chatMessageInput {
    border-radius: 25px;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    resize: none;
}

#chatMessageInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
    outline: none;
}

#sendMessageBtn {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: var(--transition);
    border: none;
}

#sendMessageBtn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

#sendMessageBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Chat message animations */
.chat-message {
    animation: messageSlideIn 0.3s ease-out;
    transform-origin: left center;
}

.chat-message.own {
    animation: messageSlideInRight 0.3s ease-out;
    transform-origin: right center;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes messageSlideInRight {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Improved chat empty state */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius-small);
}

.chat-empty i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.6;
    color: var(--primary-color);
}

.chat-empty p:first-of-type {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* Enhanced chat error state */
.chat-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--danger-color);
    text-align: center;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-radius: var(--border-radius-small);
    border: 1px solid #feb2b2;
}

.chat-error i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.chat-error p:first-of-type {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Typing indicator (future feature) */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.typing-indicator .dots {
    display: inline-flex;
    margin-left: 5px;
}

.typing-indicator .dots span {
    height: 4px;
    width: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    margin: 0 1px;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator .dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator .dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat notification badge (future feature) */
.chat-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Scrollbar styling for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive chat design */
@media (max-width: 768px) {
    .club-chat-container {
        height: 400px;
    }
    
    .chat-messages {
        max-height: 280px;
        padding: 10px;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    .message-content {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .chat-input-container {
        padding: 10px;
    }
    
    #chatMessageInput {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    #sendMessageBtn {
        width: 40px;
        height: 40px;
    }
}
