/* ============================================================
   Cricket Manager — Home Page Styles
   ============================================================ */

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--cm-green-900, #0d2818) 0%, var(--cm-green-800, #1a472a) 30%, var(--cm-green-700, #1b4332) 70%, var(--cm-green-600, #2d6a4f) 100%);
    color: #fff;
    padding: 4rem 2rem 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -60%;
    left: -20%;
    width: 140%;
    height: 220%;
    background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cm-gold, #f59e0b), #e65100, var(--cm-gold, #f59e0b));
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 0.3rem 1.1rem;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    backdrop-filter: blur(4px);
    font-weight: 600;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    margin: 0 0 0.6rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.hero-tagline {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.85);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.5;
}

.hero-stats-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--cm-gold, #f59e0b);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.hero-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.6);
    margin-top: 0.3rem;
    font-weight: 500;
}

.hero-stat-divider {
    width: 1px;
    height: 2.5rem;
    background: rgba(255,255,255,0.15);
}

/* --- Section Titles --- */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--cm-green-800, #1a472a);
    border-bottom: none;
    padding-bottom: 0;
}

.section-subtitle {
    color: var(--cm-gray-500, #6b7280);
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}

/* --- Teams Section --- */
.teams-section {
    padding: 2.5rem 0 1rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.team-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.team-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.team-card {
    padding: 1.5rem;
    border-radius: var(--cm-radius, 8px);
    border: 1px solid var(--cm-gray-200, #e5e7eb);
    background: #fff;
    box-shadow: var(--cm-shadow, 0 1px 3px rgba(0,0,0,0.08));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.team-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cm-green-800, #1a472a), var(--cm-green-500, #40916c));
}

.team-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--cm-shadow-md, 0 8px 24px rgba(0,0,0,0.1));
}

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.team-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--cm-green-800, #1a472a);
}

.team-card-record {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.record-item {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    background: var(--cm-gray-100, #f3f4f6);
    letter-spacing: 0.02em;
}

.record-item.win {
    background: rgba(22, 163, 74, 0.12);
    color: var(--cm-win, #16a34a);
}

.record-item.loss {
    background: rgba(220, 38, 38, 0.1);
    color: var(--cm-loss, #dc2626);
}

.win-bar-container {
    height: 4px;
    background: var(--cm-gray-100, #f3f4f6);
    border-radius: 2px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.win-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cm-win, #16a34a), var(--cm-green-400, #52b788));
    border-radius: 2px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.team-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.team-btn-primary,
.team-btn-secondary {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}

.team-btn-primary {
    background: var(--cm-green-800, #1a472a);
    color: #fff;
    border: none;
}

.team-btn-primary:hover {
    background: var(--cm-green-600, #2d6a4f);
    color: #fff;
    transform: translateY(-1px);
}

.team-btn-secondary {
    color: var(--cm-green-800, #1a472a);
    border: 1px solid var(--cm-green-800, #1a472a);
    background: transparent;
}

.team-btn-secondary:hover {
    background: var(--cm-green-50, #f0fdf4);
    color: var(--cm-green-800, #1a472a);
    transform: translateY(-1px);
}

/* --- Features Grid --- */
.features-section {
    padding: 2rem 0 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.features-section .feature-card {
    background: #fff;
    border: 1px solid var(--cm-gray-200, #e5e7eb);
    border-radius: var(--cm-radius, 8px);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.features-section .feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cm-green-800, #1a472a), var(--cm-green-500, #40916c));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.features-section .feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cm-shadow-md, 0 6px 20px rgba(0,0,0,0.08));
    border-color: var(--cm-green-400, #52b788);
}

.features-section .feature-card:hover::before {
    opacity: 1;
}

.features-section .feature-icon {
    font-size: 2rem;
    margin-bottom: 0.6rem;
    line-height: 1;
}

.features-section .feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cm-green-800, #1a472a);
    margin: 0 0 0.4rem;
}

.features-section .feature-card p {
    font-size: 0.88rem;
    color: var(--cm-gray-500, #6b7280);
    margin: 0;
    line-height: 1.5;
}

/* --- Data Section (Recent Matches + Leaderboards) --- */
.data-section {
    padding: 1rem 0 2.5rem;
}

.recent-matches {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.recent-match-card {
    display: block;
    background: #fff;
    border: 1px solid var(--cm-gray-200, #e5e7eb);
    border-radius: var(--cm-radius, 8px);
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.recent-match-card:hover {
    border-color: var(--cm-green-400, #52b788);
    box-shadow: var(--cm-shadow, 0 2px 8px rgba(0,0,0,0.06));
    color: inherit;
    transform: translateY(-1px);
}

.match-date {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cm-gray-400, #9ca3af);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    flex-wrap: wrap;
}

.match-team {
    font-weight: 500;
    color: var(--cm-gray-700, #374151);
}

.match-winner {
    font-weight: 700;
    color: var(--cm-green-800, #1a472a);
}

.match-score {
    font-weight: 700;
    color: var(--cm-gray-900, #111827);
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
}

.match-vs {
    color: var(--cm-gray-400, #9ca3af);
    font-size: 0.8rem;
    font-style: italic;
}

.match-grade {
    font-size: 0.72rem;
    color: var(--cm-gray-400, #9ca3af);
    margin-top: 0.2rem;
}

/* --- Leaderboards --- */
.leaderboard-heading {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cm-gray-700, #374151);
    margin: 1.2rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.leaderboard-heading:first-of-type {
    margin-top: 0;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.leaderboard-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cm-gray-400, #9ca3af);
    font-weight: 600;
    padding: 0.4rem 0.5rem;
    border-bottom: 2px solid var(--cm-gray-200, #e5e7eb);
    background: transparent;
}

.leaderboard-table tbody td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--cm-gray-100, #f3f4f6);
}

.leaderboard-table tbody tr:hover {
    background: var(--cm-green-50, rgba(26, 71, 42, 0.03));
}

.rank-cell {
    width: 2rem;
    text-align: center;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--cm-gray-100, #f3f4f6);
    color: var(--cm-gray-500, #6b7280);
}

.rank-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.4);
}

.rank-silver {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}

.rank-bronze {
    background: linear-gradient(135deg, #b45309, #92400e);
    color: #fff;
}

.lb-player {
    display: block;
    font-weight: 600;
    color: var(--cm-green-800, #1a472a);
}

.lb-team {
    display: block;
    font-size: 0.72rem;
    color: var(--cm-gray-400, #9ca3af);
}

.lb-stat {
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--cm-gray-700, #374151);
}

/* --- Pipeline Section --- */
.pipeline-section {
    padding: 2rem 0;
}

.pipeline-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    background: linear-gradient(135deg, var(--cm-green-50, #f0fdf4), #ecfdf5);
    border: 1px solid var(--cm-green-100, #bbf7d0);
    border-radius: var(--cm-radius, 8px);
    padding: 1.5rem 2rem;
}

.pipeline-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.pipeline-inner h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cm-green-800, #1a472a);
    margin: 0 0 0.4rem;
    border-bottom: none;
    padding-bottom: 0;
}

.pipeline-inner p {
    font-size: 0.88rem;
    color: var(--cm-gray-700, #374151);
    margin: 0;
    line-height: 1.5;
}

/* --- Footer --- */
.home-footer {
    margin-top: 1rem;
    padding: 1.5rem 0;
    text-align: center;
    color: var(--cm-gray-400, #9ca3af);
    border-top: 1px solid var(--cm-gray-200, #e5e7eb);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .hero {
        padding: 2.5rem 1.2rem 2rem;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-tagline {
        font-size: 1rem;
    }
    .hero-stats-row {
        gap: 1rem;
    }
    .hero-stat-number {
        font-size: 1.5rem;
    }
    .hero-stat-divider {
        display: none;
    }
    .team-card-header {
        flex-direction: column;
        gap: 0.4rem;
    }
    .match-teams {
        font-size: 0.8rem;
    }
    .pipeline-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 0.6s ease-out;
}

.team-card {
    animation: fadeInUp 0.5s ease-out both;
}

.team-card:nth-child(1) { animation-delay: 0.1s; }
.team-card:nth-child(2) { animation-delay: 0.2s; }
.team-card:nth-child(3) { animation-delay: 0.3s; }

.features-section .feature-card {
    animation: fadeInUp 0.5s ease-out both;
}

.features-section .feature-card:nth-child(1) { animation-delay: 0.05s; }
.features-section .feature-card:nth-child(2) { animation-delay: 0.1s; }
.features-section .feature-card:nth-child(3) { animation-delay: 0.15s; }
.features-section .feature-card:nth-child(4) { animation-delay: 0.2s; }
.features-section .feature-card:nth-child(5) { animation-delay: 0.25s; }
.features-section .feature-card:nth-child(6) { animation-delay: 0.3s; }
