/* Football Club Management System - Main Stylesheet */

:root {
    --primary-green: #1e7e34;
    --secondary-green: #28a745;
    --accent-color: #667eea;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    font-size: 14px;
}

/* Navigation */
.navbar-custom {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    padding: 15px 20px;
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
}

.navbar-custom .nav-link {
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 8px;
    margin: 0 5px;
}

.navbar-custom .nav-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.navbar-custom .nav-link.active {
    background: rgba(255,255,255,0.25);
}

/* Mobile navbar fix */
@media (max-width: 991.98px) {
    .navbar-custom {
        position: relative;
        z-index: 1000;
    }
    
    .navbar-collapse {
        background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
        border-radius: 10px;
        margin-top: 10px;
        padding: 10px;
        position: relative;
        z-index: 999;
    }
    
    .navbar-custom .nav-link {
        margin: 5px 0;
    }
}

/* Dashboard Header - Legacy (keeping for backward compatibility) */
.dashboard-header {
    text-align: center;
    padding: 15px 20px 25px;
    color: white;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card .icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.stat-card .number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-green);
}

.stat-card .player-list {
    list-style: none;
    padding: 0;
}

.stat-card .player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-card .player-item:last-child {
    border-bottom: none;
}

.stat-card .player-name {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.stat-card .player-stat {
    background: var(--primary-green);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.stat-card.assists .player-stat {
    background: var(--secondary-green);
}

/* Last Match Section */
.last-match-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.last-match-header {
    text-align: center;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.match-details {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    text-align: center;
}

.match-detail {
    color: white;
}

.match-detail-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.match-detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.result-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.6rem;
    font-weight: 700;
}

.result-win {
    background: #28a745;
    color: white;
}

.result-draw {
    background: #ffc107;
    color: #333;
}

.result-loss {
    background: #dc3545;
    color: white;
}

.motm-text {
    font-size: 0.9rem;
    margin-top: 5px;
}

.weather-icon {
    font-size: 1.8rem;
}

/* Content Card */
.content-card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: white;
    padding: 30px;
    margin-bottom: 30px;
}

/* Tables */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(90deg, var(--secondary-green) 0%, var(--primary-green) 100%);
    border: none;
    opacity: 0.9;
    color: white;
}

.btn-login {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    border: none;
    color: white;
    padding: 12px;
    font-weight: bold;
}

.btn-login:hover {
    opacity: 0.9;
    color: white;
}

/* Admin Stats */
.admin-stats {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.stat-box {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Nav Pills */
.nav-pills .nav-link {
    color: var(--primary-green);
    border: 2px solid transparent;
    margin-right: 10px;
    font-weight: 500;
}

.nav-pills .nav-link:hover {
    background: #f0f0f0;
}

.nav-pills .nav-link.active {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.section-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--primary-green);
}

/* Player Row */
.player-row {
    display: grid;
    grid-template-columns: 80px 250px 120px 120px 120px 140px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

.player-row > div {
    padding: 5px;
}

.player-row:hover {
    background: #f8f9fa;
}

.player-row.with-cards {
    grid-template-columns: 80px 250px 120px 120px 120px 140px 190px;
}

/* Special Goals Section */
.special-goals-section {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.special-goals-section h5 {
    color: #856404;
    margin-bottom: 15px;
}

/* Color Preview */
.color-preview {
    width: 60px;
    height: 40px;
    border-radius: 5px;
    border: 2px solid #ddd;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

/* Logo Preview */
.logo-preview {
    max-width: 110px;
    max-height: 90px;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 6px;
    background: white;
}

/* Settings Section */
.settings-section {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eceff4;
}

.settings-section:last-child {
    border-bottom: none;
}

/* Login Card */
.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 40px;
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header img {
    max-height: 80px;
    margin-bottom: 15px;
}

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Password Card */
.password-card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: white;
    padding: 40px;
    max-width: 500px;
    width: 100%;
}

/* Match Cards - Matches Page */
.matches-grid {
    display: grid;
    gap: 20px;
}

.match-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.match-card-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-green);
}

.match-card-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    gap: 10px;
    align-items: flex-start;
}

.match-card-row:last-child {
    border-bottom: none;
}

.match-card-label {
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
    min-width: 80px;
}

.match-card-value {
    color: #333;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    flex: 1;
}

.match-card-value.scorers-value {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Mobile Player Cards */
.mobile-player-card {
    display: none;
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.player-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.desktop-player-table {
    display: table;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
        font-size: 13px;
    }
    
    .container-fluid > nav.navbar-custom {
        margin: 10px !important;
        margin-bottom: 20px !important;
    }

    /* Ensure navbar is properly styled on mobile */
    nav.navbar.navbar-custom {
        border-radius: 15px !important;
        -webkit-border-radius: 15px !important;
        padding: 12px 15px !important;
        width: auto !important;
        overflow: visible !important;
        position: relative !important;
    }
    
    nav.navbar.navbar-custom > .container-fluid {
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-box-orient: horizontal !important;
        -webkit-box-direction: normal !important;
        -ms-flex-direction: row !important;
        flex-direction: row !important;
        -ms-flex-wrap: nowrap !important;
        flex-wrap: nowrap !important;
        -webkit-box-align: center !important;
        -ms-flex-align: center !important;
        align-items: center !important;
        -webkit-box-pack: justify !important;
        -ms-flex-pack: justify !important;
        justify-content: space-between !important;
        padding: 0 !important;
    }
    
    nav.navbar.navbar-custom .navbar-brand {
        font-size: 1rem !important;
        -webkit-box-flex: 0 !important;
        -ms-flex: 0 1 auto !important;
        flex: 0 1 auto !important;
        min-width: 0 !important;
        margin-right: 10px !important;
        margin-bottom: 0 !important;
    }
    
    nav.navbar.navbar-custom .navbar-brand img {
        height: 24px !important;
        margin-right: 6px !important;
    }
    
    nav.navbar.navbar-custom .navbar-toggler {
        padding: 5px 8px !important;
        font-size: 1.2rem !important;
        -webkit-box-flex: 0 !important;
        -ms-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
        margin-left: auto !important;
        margin-bottom: 0 !important;
        border: 1px solid rgba(255,255,255,0.5) !important;
    }
    
    /* Navbar collapse menu positioning */
    nav.navbar.navbar-custom .navbar-collapse {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%) !important;
        margin-top: 10px !important;
        border-radius: 15px !important;
        -webkit-border-radius: 15px !important;
        padding: 15px !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
        z-index: 1000 !important;
    }
    
    nav.navbar.navbar-custom .navbar-nav {
        width: 100% !important;
    }
    
    nav.navbar.navbar-custom .nav-item {
        margin: 5px 0 !important;
    }
    
    nav.navbar.navbar-custom .nav-link {
        padding: 12px 15px !important;
        border-radius: 8px !important;
        text-align: left !important;
    }
    
    .container, .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .dashboard-header {
        padding: 10px 0 20px;
    }

    .dashboard-header h1 {
        font-size: 1.3rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .player-row {
        grid-template-columns: 50px 1fr;
        gap: 8px;
    }
    
    .player-row > div:nth-child(3),
    .player-row > div:nth-child(4),
    .player-row > div:nth-child(5),
    .player-row > div:nth-child(6),
    .player-row > div:nth-child(7) {
        grid-column: 2;
    }
    
    .player-row.with-cards {
        grid-template-columns: 50px 1fr;
    }
    
    .desktop-player-table {
        display: none;
    }
    
    .mobile-player-card {
        display: block;
    }
    
    .content-card {
        padding: 15px;
    }

    /* Hide table on mobile, show card view */
    .desktop-table {
        display: none;
    }

    .mobile-match-card {
        display: block;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        overflow: hidden;
        word-wrap: break-word;
    }

    .mobile-match-card.match-row-win {
        background-color: #d4edda;
        border-left: 5px solid #28a745;
    }

    .mobile-match-card.match-row-draw {
        background-color: #fff3cd;
        border-left: 5px solid #ffc107;
    }

    .mobile-match-card.match-row-loss {
        background-color: #f8d7da;
        border-left: 5px solid #dc3545;
    }
}

/* Extra small screens - stack scorers vertically if needed */
@media (max-width: 400px) {
    .match-card-value.scorers-value {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .match-card-label {
        min-width: 70px;
        font-size: 0.9rem;
    }
}

/* Desktop - hide mobile cards */
@media (min-width: 769px) {
    .mobile-match-card {
        display: none;
    }

    .mobile-player-card {
        display: none;
    }

    .desktop-table {
        display: table;
    }

    .desktop-player-table {
        display: table;
    }
}

/* Additional mobile-specific fixes for iPhone and small devices */
@media (max-width: 576px) {
    nav.navbar.navbar-custom {
        border-radius: 15px !important;
        -webkit-border-radius: 15px !important;
        overflow: visible !important;
        position: relative !important;
    }
    
    nav.navbar.navbar-custom > .container-fluid {
        -webkit-box-orient: horizontal !important;
        -webkit-box-direction: normal !important;
        -ms-flex-direction: row !important;
        flex-direction: row !important;
        -ms-flex-wrap: nowrap !important;
        flex-wrap: nowrap !important;
    }
    
    nav.navbar.navbar-custom .navbar-brand {
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: calc(100vw - 120px) !important;
        display: -webkit-inline-box !important;
        display: -ms-inline-flexbox !important;
        display: inline-flex !important;
        -webkit-box-align: center !important;
        -ms-flex-align: center !important;
        align-items: center !important;
    }
    
    nav.navbar.navbar-custom .navbar-toggler {
        display: block !important;
        position: relative !important;
    }
    
    /* Dropdown menu positioning for small screens */
    nav.navbar.navbar-custom .navbar-collapse {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin-top: 10px !important;
    }
}

/* Match-specific styles (matches.php) */
.match-row-win {
    background-color: #d4edda !important;
}

.match-row-draw {
    background-color: #fff3cd !important;
}

.match-row-loss {
    background-color: #f8d7da !important;
}

.league-selector {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.match-type-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.match-type-pill {
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
}

.match-type-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    color: #333;
}

.match-type-pill.active {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    border-color: var(--primary-green);
}

.og-badge {
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-left: 5px;
}

/* Tournament status badges */
.status-upcoming {
    background-color: #0dcaf0;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background-color: #198754;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-completed {
    background-color: #ffc107;
    color: black;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}
