/* =============================================
   GESFEDECAT - Estils per al frontend de clubs
   ============================================= */

/* Variables */
:root {
    --primary-color: #1e3c72;
    --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --secondary-color: #2d3748;
    --accent-color: #3182ce;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #e53e3e;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-body: #f0f4f8; /* Un gris blavós molt suau per al fons general */
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

/* Base */
body.gesf-club-logged-in {
    background: var(--bg-body) !important; /* Forçar el fons clar quan està loguejat */
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   PÀGINA DE LOGIN (Només quan NO estem loguejats)
   ============================================= */
body.gesf-club-page:not(.gesf-club-logged-in) {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.gesf-club-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.gesf-club-login-box {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 100%;
    padding: 40px;
}

.gesf-club-login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.gesf-club-login-logo img {
    max-height: 80px;
    width: auto;
}

.gesf-club-login-box h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 24px;
}

.gesf-club-login-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.gesf-club-login-form .gesf-form-group {
    margin-bottom: 20px;
}

.gesf-club-login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

.gesf-club-login-form input[type="text"],
.gesf-club-login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.gesf-club-login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.gesf-club-login-form .gesf-form-checkbox {
    display: flex;
    align-items: center;
}

.gesf-club-login-form .gesf-form-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    margin: 0;
}

.gesf-club-login-form .gesf-form-checkbox input {
    width: auto;
}

.gesf-club-login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.gesf-club-login-btn:hover {
    background: var(--primary-dark);
}

.gesf-club-login-links {
    text-align: center;
    margin-top: 20px;
}

.gesf-club-login-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
}

.gesf-club-login-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* =============================================
   CAPÇALERA
   ============================================= */
.gesf-club-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.gesf-club-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gesf-club-logo img {
    max-height: 50px;
    width: auto;
}

.gesf-club-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.gesf-club-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 20px;
    border-right: 1px solid var(--border-color);
}

.gesf-club-name {
    font-weight: 600;
    color: var(--text-color);
}

.gesf-club-logout {
    color: var(--danger-color);
    text-decoration: none;
    font-size: 14px;
}

.gesf-club-logout:hover {
    text-decoration: underline;
}

.gesf-club-menu {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gesf-club-menu li a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s;
}

.gesf-club-menu li a:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.gesf-club-menu li.active a {
    color: var(--primary-color);
    background: var(--bg-light);
    font-weight: 600;
}

.gesf-club-menu .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* =============================================
   CONTINGUT PRINCIPAL
   ============================================= */
.gesf-club-main {
    max-width: 1240px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: calc(100vh - 400px);
}

.gesf-section-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 30px;
    border: 1px solid var(--border-color);
}

/* Dashboard */
.gesf-club-welcome {
    margin-bottom: 40px;
}

.gesf-club-welcome h1 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 32px;
}

.gesf-club-welcome p {
    color: var(--text-light);
    font-size: 16px;
}

.gesf-club-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.gesf-stat-card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 24px;
    display: flex;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.03);
}

.gesf-stat-card:hover {
    transform: translateY(-5px);
}

.gesf-stat-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gesf-stat-icon .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
    color: var(--primary-color);
}

.gesf-stat-content {
    flex: 1;
}

.gesf-stat-content h3 {
    color: var(--text-light);
    font-size: 14px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.gesf-stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--text-color);
    margin: 0 0 5px 0;
}

.gesf-stat-detail {
    color: var(--text-light);
    font-size: 13px;
    margin: 0 0 10px 0;
}

.gesf-stat-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.gesf-stat-link:hover {
    text-decoration: underline;
}

/* Taula d'últims elements */
.gesf-club-recent {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.gesf-recent-card h3 {
    color: var(--text-color);
    margin-bottom: 20px;
}

.gesf-recent-table {
    width: 100%;
    border-collapse: collapse;
}

.gesf-recent-table th {
    text-align: left;
    padding: 12px;
    background: var(--bg-light);
    color: var(--text-color);
    font-weight: 600;
}

.gesf-recent-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.gesf-recent-table tr:hover td {
    background: var(--bg-light);
}

.gesf-view-all {
    display: inline-block;
    margin-top: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.gesf-view-all:hover {
    text-decoration: underline;
}

/* Badges d'estat */
.gesf-estat-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.gesf-estat-validada {
    background: #d4edda;
    color: #155724;
}

.gesf-estat-facturada {
    background: #fff3cd;
    color: #856404;
}

.gesf-estat-tramitada {
    background: #d1ecf1;
    color: #0c5460;
}

.gesf-estat-pendiente {
    background: #fff3cd;
    color: #856404;
}

.gesf-estat-pagado {
    background: #d4edda;
    color: #155724;
}

/* =============================================
   PEU DE PÀGINA
   ============================================= */
.gesf-club-footer {
    background: var(--secondary-color);
    color: white;
    padding: 20px 0;
    margin-top: 40px;
}

.gesf-club-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gesf-club-footer a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.gesf-club-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .gesf-club-header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .gesf-club-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .gesf-club-user-info {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 15px;
        width: 100%;
        justify-content: space-between;
    }
    
    .gesf-club-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .gesf-club-stats {
        grid-template-columns: 1fr;
    }
    
    .gesf-club-footer-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* =============================================
   MODALS
   ============================================= */
.gesf-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.gesf-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: gesfModalFadeIn 0.3s ease-out;
}

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

.gesf-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gesf-modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 20px;
}

.gesf-modal-close {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    background: none;
    border: none;
    cursor: pointer;
}

.gesf-modal-close:hover {
    color: var(--danger-color);
}

.gesf-modal-body {
    padding: 30px;
}

/* =============================================
   FORMULARIS ESTÀNDARD
   ============================================= */
.gesf-form-standard .gesf-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.gesf-form-group {
    margin-bottom: 15px;
}

.gesf-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.gesf-form-group input,
.gesf-form-group select,
.gesf-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s;
}

.gesf-form-group input:focus,
.gesf-form-group select:focus,
.gesf-form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.gesf-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
    font-size: 14px;
    color: white;
}

.gesf-button-primary {
    background: var(--primary-gradient);
}

.gesf-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    opacity: 0.9;
}

.gesf-icon-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.gesf-icon-button:hover {
    background: var(--bg-body);
    color: var(--primary-color);
}

.gesf-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--bg-body);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

/* PREMIUM SOCIS MODULE */
.gesf-premium-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 30px;
    border-radius: 16px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.gesf-premium-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.gesf-premium-title h1 {
    color: white !important;
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.gesf-premium-title p {
    color: #94a3b8;
    margin: 5px 0 0 0;
    font-size: 14px;
}

.gesf-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gesf-stat-card-premium {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gesf-stat-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.04);
}

.gesf-stat-card-premium .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gesf-stat-card-premium .stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 5px;
}

.gesf-table-premium {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.gesf-table-premium th {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 12px 20px;
}

.gesf-table-premium tr td {
    background: white;
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
}

.gesf-table-premium tr td:first-child {
    border-left: 1px solid #f1f5f9;
    border-radius: 12px 0 0 12px;
}

.gesf-table-premium tr td:last-child {
    border-right: 1px solid #f1f5f9;
    border-radius: 0 12px 12px 0;
}

.gesf-table-premium tr:hover td {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.gesf-badge-premium {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-senior { background: #dcfce7; color: #166534; }
.badge-veterano { background: #fef9c3; color: #854d0e; }
.badge-juvenil { background: #dbeafe; color: #1e40af; }
.badge-infantil { background: #fce7f3; color: #9d174d; }

.gesf-btn-premium {
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.gesf-btn-primary-p { background: #3b82f6; color: white; }
.gesf-btn-primary-p:hover { background: #2563eb; transform: translateY(-2px); }

.gesf-btn-secondary-p { background: rgba(255,255,255,0.1); color: white; backdrop-filter: blur(4px); }
.gesf-btn-secondary-p:hover { background: rgba(255,255,255,0.2); }

.gesf-btn-danger-p { background: #fee2e2; color: #dc2626; }
.gesf-btn-danger-p:hover { background: #fecaca; color: #b91c1c; }

@media (max-width: 768px) {
    .gesf-premium-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .gesf-header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.gesf-template-link {
    font-size: 11px;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s;
}

.gesf-template-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .gesf-form-standard .gesf-form-grid {
        grid-template-columns: 1fr;
    }
}