@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Orbitron:wght@400;700&display=swap');

:root {
    --primary: #00ff88;
    --primary-dark: #00cc6d;
    --bg-dark: #050a14;
    --bg-card: rgba(15, 23, 42, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --primary-rgb: 0, 255, 136;
    --secondary-rgb: 96, 165, 250;
    --accent: #60a5fa;
}

* {
    box-sizing: border-box;
    transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(var(--primary-rgb), 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(var(--secondary-rgb), 0.1) 0%, transparent 40%),
        linear-gradient(135deg, #050a14 0%, #0f172a 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

header .header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin: 0;
    background: linear-gradient(45deg, var(--primary), #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-box {
    flex: 1;
    max-width: 400px;
    margin: 0 40px;
}

.search-box input {
    width: 100%;
    padding: 10px 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: white;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav a:hover,
nav a.active {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

h2 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
    margin-bottom: 30px;
}

/* Glass Cards */
.card,
.jugador {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card::before,
.jugador::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover,
.jugador:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 20px rgba(var(--primary-rgb), 0.1);
}

.card:hover::before,
.jugador:hover::before {
    opacity: 1;
}

/* Grid System */
.grid-jugadores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--glass-border);
}

/* Specifics for Player Cards */
.jugador-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.jugador-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.jugador-info h3 {
    margin: 0;
    font-size: 1.2rem;
}

.jugador-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-value {
    color: var(--primary);
    font-weight: 700;
}

/* Dashboard / Hero */
.hero {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(96, 165, 250, 0.1));
}

.hero h2 {
    font-size: 2.5rem;
    border: none;
    padding: 0;
    margin-bottom: 10px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--bg-dark);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

.summary-content {
    font-size: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    margin-top: 10px;
}

/* Player Detail Page */
.player-profile-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.jugador-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.detail-team-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

.main-media {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: var(--primary);
    margin-top: 20px;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

@media (max-width: 768px) {
    .player-profile-container {
        grid-template-columns: 1fr;
    }
}

/* Skills Categories Grid */
.skills-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.skill-category h4 {
    color: var(--primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--glass-border);
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.skill-item .skill-name {
    color: var(--text-muted);
}

.skill-item .skill-value {
    color: var(--text-main);
    font-weight: 600;
}

.skill-item .skill-value.highlight {
    color: var(--primary);
}

/* Special Skill Checkbox */
.special-skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(var(--primary-rgb), 0.05);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.check-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
}

.check-icon.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

/* Teams Grid */
.grid-equipos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.equipo-content {
    text-align: center;
}

.equipo-logo-large {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.2));
}

.equipo-abrev {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.equipo-stats {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modern Tables */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.modern-table th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 15px;
    border-bottom: 2px solid var(--glass-border);
}

.modern-table td {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.small-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.pts-cell {
    font-weight: 800;
    color: var(--primary);
}

/* Form Badges */
.form-container {
    display: flex;
    gap: 5px;
}

.badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    font-size: 0.7rem;
    font-weight: 900;
    border-radius: 4px;
    color: white;
}

.badge-v {
    background: #10b981;
}

.badge-e {
    background: #f59e0b;
}

.badge-d {
    background: #ef4444;
}

/* Match Center */
.scorecard-flex {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 30px;
}

.team-side {
    text-align: center;
    flex: 1;
}

.match-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.match-info {
    text-align: center;
    flex: 1;
}

.vs {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--primary);
}

.stadium {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lineups-row {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.lineup-card {
    flex: 1;
}

.player-row {
    display: flex;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.dorsal {
    color: var(--primary);
    font-weight: 700;
    width: 25px;
}

.name {
    flex: 1;
}

.pos {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Page Headers & Filters */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.filters {
    display: flex;
    gap: 15px;
}

.filters select {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

.filters select:hover {
    border-color: var(--primary);
}

/* Auth Pages */
.auth-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

.auth-card h2 {
    text-align: center;
    border: none;
    padding: 0;
    margin-bottom: 30px;
    color: var(--primary);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
}

.auth-card .btn {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

.role-notice {
    background: rgba(0, 255, 136, 0.1);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    text-align: center;
}

/* Profile Page */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-header-card {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 40px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--bg-card), rgba(0, 255, 136, 0.05));
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--bg-dark);
    font-weight: 700;
}

.profile-content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    /* Esto fuerza a que todas las filas tengan la misma altura */
    gap: 20px;
    align-items: stretch;
    margin-top: 20px;
}

.profile-content-grid .card {
    display: flex;
    flex-direction: column;
    min-height: 320px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.05));
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-content-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.3);
    border-color: #fff;
}


.action-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 600;
}

.action-item:hover {
    border-color: var(--primary);
    background: rgba(0, 255, 136, 0.05);
}

.action-item.admin {
    border-left: 4px solid var(--primary);
}

/* Auth Enhancements */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s;
}

.toggle-password:hover {
    color: var(--primary);
}

.radio-group.horizontal {
    display: flex;
    flex-direction: row;
    gap: 30px;
    margin-top: 10px;
}

.checkbox-group {
    margin-top: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.alert.warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #f59e0b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Profile Enhancements */
.read-only input {
    background: rgba(255, 255, 255, 0.05);
    border-color: transparent;
    cursor: not-allowed;
    color: var(--text-muted);
}

.special-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.disabled-btn {
    opacity: 0.7;
    cursor: default;
    background: var(--glass);
    border: 1px dashed var(--glass-border);
    pointer-events: none;
}


/* Owner Panel Specifics */
.owner-panel {
    /* Base styles now inherited from .profile-content-grid .card */
}

.owner-team-container {
    flex: 1;
    /* Empuja el contenido para llenar el espacio */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.owner-team-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
    background: var(--glass);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.owner-team-button:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.3);
}

.owner-team-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.owner-team-button:hover .owner-team-logo {
    transform: scale(1.1);
}

.owner-team-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    text-align: center;
}




/* Club Management Styles */
.club-management-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.club-header-card {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.05));
    border: 2px solid var(--primary);
}

.club-logo-container {
    flex-shrink: 0;
}

.club-logo-large {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.club-info h1 {
    margin: 0 0 10px 0;
    font-size: 2rem;
    color: var(--primary);
}

.management-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--glass);
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    text-align: center;
    padding: 30px;
}

.stat-card h3 {
    margin: 0 0 15px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.stat-value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0;
}

.player-item {
    display: grid;
    grid-template-columns: 60px 1fr 100px 60px;
    gap: 15px;
    padding: 15px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.player-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-align: center;
}

.player-name {
    font-weight: 500;
}

.player-position {
    text-align: center;
    color: var(--text-muted);
}

.player-rating {
    text-align: center;
    font-weight: bold;
    color: var(--secondary);
}




/* Responsive: 2 columns on tablets */
@media (max-width: 850px) {
    .profile-content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive: 1 column on mobile */
@media (max-width: 550px) {
    .profile-content-grid {
        grid-template-columns: 1fr;
    }
}

/* Updated Player List with Finance Columns */
.player-item {
    display: grid;
    grid-template-columns: 80px 1fr 100px 100px 100px 60px;
    gap: 15px;
    padding: 12px 15px;
    align-items: center;
}

.player-item.header {
    background: rgba(var(--primary-rgb), 0.1);
    font-weight: bold;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.player-salary {
    color: #fbbf24;
    /* Amber color for money */
    font-weight: 600;
}

.player-contract {
    color: #60a5fa;
    /* Blue color for contracts */
    font-weight: 600;
}


/* Finance Styles */
.finances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.finance-card {
    padding: 25px;
}

.finance-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.finance-item.total {
    margin-top: 15px;
    font-weight: bold;
    font-size: 1.3rem;
}

.finance-item .value.salary {
    color: #ef4444;
}

.finance-item .value.positive {
    color: var(--primary);
}

.finance-item .value.negative {
    color: #ef4444;
}

.finance-card hr {
    border: 0;
    border-top: 1px solid var(--glass-border);
    margin: 15px 0;
}