/* FC Clébard Padel - Styles Mobile-First V2 */

/* ===== Variables & Reset ===== */
:root {
    --primary: #2E7D32;
    --primary-dark: #1B5E20;
    --primary-light: #4CAF50;
    --win: #4CAF50;
    --win-bg: rgba(76, 175, 80, 0.15);
    --loss: #F44336;
    --loss-bg: rgba(244, 67, 54, 0.15);
    --bg-dark: #f5f5f7;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #888888;
    --border: #e0e0e0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Page Container ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #e0e0eb 100%);
}

.login-logo-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 24px;
    border: 4px solid var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.login-form {
    width: 100%;
    max-width: 320px;
}

.login-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.2);
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-error {
    color: var(--loss);
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.login-error.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-danger {
    background: var(--loss);
    color: white;
}

.btn-danger:hover {
    background: #D32F2F;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
    width: auto;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.form-actions .btn {
    flex: 1;
}

/* ===== Header ===== */
.header {
    background: var(--bg-card);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.header-title span {
    font-size: 20px;
}

/* ===== Navigation Tabs ===== */
.nav-tabs {
    display: flex;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 52px;
    z-index: 99;
}

.nav-tab {
    flex: 1;
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--primary-light);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary-light);
    border-radius: 3px 3px 0 0;
}

.nav-tab-icon {
    display: block;
    font-size: 18px;
    margin-bottom: 2px;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 80px;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Form ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.15);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ===== Result Toggle ===== */
.result-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.result-option {
    padding: 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-option:hover {
    border-color: var(--text-secondary);
}

.result-option.win.selected {
    background: var(--win-bg);
    border-color: var(--win);
    color: var(--win);
}

.result-option.loss.selected {
    background: var(--loss-bg);
    border-color: var(--loss);
    color: var(--loss);
}

.result-option input {
    display: none;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card.large {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-value.win {
    color: var(--win);
}

.stat-value.loss {
    color: var(--loss);
}

.stat-value.primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Match Card ===== */
.match-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid var(--border);
    position: relative;
    transition: all 0.3s ease;
}

.match-card.win {
    border-left-color: var(--win);
}

.match-card.loss {
    border-left-color: var(--loss);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.match-date {
    font-size: 12px;
    color: var(--text-muted);
}

.match-result {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.match-result.win {
    background: var(--win-bg);
    color: var(--win);
}

.match-result.loss {
    background: var(--loss-bg);
    color: var(--loss);
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.match-team {
    flex: 1;
}

.match-team-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.match-team-names {
    font-weight: 600;
    font-size: 14px;
}

.match-vs {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.match-score {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-light);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.match-comment {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 10px;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    margin-top: 10px;
    display: none;
}

.match-comment.show {
    display: block;
}

.match-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}

.match-actions .btn-icon {
    opacity: 0.6;
    background: transparent;
    border: none;
}

.match-actions .btn-icon:hover {
    opacity: 1;
    background: var(--bg-dark);
}

/* ===== Binôme Card ===== */
.binome-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    position: relative;
}

.binome-names {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}

.binome-info {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.binome-phone {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
}

.binome-phone:hover {
    text-decoration: underline;
}

.binome-level {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.binome-level.debutant {
    background: #e3f2fd;
    color: #1976d2;
}

.binome-level.intermediaire {
    background: #fff3e0;
    color: #f57c00;
}

.binome-level.avance {
    background: #fce4ec;
    color: #c2185b;
}

.binome-level.expert {
    background: #f3e5f5;
    color: #7b1fa2;
}

.binome-comment {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

.binome-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}

.binome-actions .btn-icon {
    opacity: 0.6;
    background: transparent;
    border: none;
}

.binome-actions .btn-icon:hover {
    opacity: 1;
    background: var(--bg-dark);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state-text {
    font-size: 14px;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--win);
}

.toast.error {
    border-color: var(--loss);
}

/* ===== Loading ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Sync Indicator ===== */
.sync-indicator {
    position: fixed;
    top: 60px;
    right: 16px;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 50;
}

.sync-indicator.show {
    opacity: 1;
}

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ===== Partner/Nemesis Items ===== */
.list-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.partner-item,
.nemesis-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.partner-name,
.nemesis-name {
    font-weight: 600;
    font-size: 14px;
}

.partner-stats,
.nemesis-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.partner-badge,
.nemesis-badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.partner-badge {
    background: var(--win-bg);
    color: var(--win);
}

.nemesis-badge {
    background: var(--loss-bg);
    color: var(--loss);
}

/* ===== Responsive ===== */
@media (min-width: 600px) {
    .main-content {
        max-width: 600px;
        margin: 0 auto;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .stat-card.large {
        grid-column: span 4;
    }
}