/* ============================================
   PapouBasket PWA - Styles principaux
   ============================================ */

/* Variables CSS */
:root {
    --primary-color: #5cbbf6;
    --primary-dark: #4a9fd8;
    --primary-light: #89cffa;
    --secondary-color: gold;
    --secondary-dark: #d4a500;
    --text-color: #333;
    --text-light: #666;
    --text-white: #fff;
    --bg-color: #f5f5f5;
    --bg-white: #fff;
    --border-color: #e0e0e0;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --header-height: 60px;
    --bottom-nav-height: 65px;
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset et base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ============================================
   Header
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-medium);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.app-header h1 {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 24px;
    height: 3px;
    background-color: var(--text-white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   Navigation latérale
   ============================================ */
.side-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-white);
    z-index: 200;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-heavy);
}

.side-nav.open {
    left: 0;
}

.nav-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.nav-header h2 {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(92, 187, 246, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

.nav-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Contenu principal
   ============================================ */
.main-content {
    margin-top: var(--header-height);
    margin-bottom: var(--bottom-nav-height);
    padding: 16px;
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

/* ============================================
   Section Hero
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--text-white);
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.hero .highlight {
    color: var(--secondary-color);
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    font-style: italic;
}

.hero-image {
    margin-top: 16px;
}

.basketball-icon {
    font-size: 4rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   Sections
   ============================================ */
.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
    padding-left: 4px;
}

/* ============================================
   Cartes de nouvelles
   ============================================ */
.news-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.news-date {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.news-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.news-text {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 12px;
}

.news-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.news-link:hover {
    color: var(--primary-dark);
}

/* ============================================
   Cartes de stages
   ============================================ */
.stages-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stage-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-light);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stage-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.stage-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: #333;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    padding-right: 60px;
}

.stage-dates {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 4px;
}

.stage-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* ============================================
   Section rappels
   ============================================ */
.reminder-section {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    padding: 16px;
}

.reminder-section .section-title {
    color: #856404;
}

.reminder-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   Barre de navigation inférieure
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background-color: var(--bg-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s ease;
    text-align: center;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-icon {
    font-size: 1.5rem;
}

/* ============================================
   Footer
   ============================================ */
.app-footer {
    background-color: var(--text-color);
    color: var(--text-white);
    padding: 20px 16px;
    text-align: center;
    font-size: 0.8rem;
    margin-bottom: var(--bottom-nav-height);
}

.app-footer p {
    opacity: 0.8;
    margin-bottom: 4px;
}

/* ============================================
   Prompt d'installation PWA
   ============================================ */
.install-prompt {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 16px;
    right: 16px;
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-heavy);
    z-index: 300;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.install-content p {
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.install-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 768px) {
    .main-content {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .stages-preview {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a2e;
        --bg-white: #16213e;
        --text-color: #e0e0e0;
        --text-light: #a0a0a0;
        --border-color: #2a2a4a;
    }

    .app-header {
        background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    }

    .news-card,
    .stage-card {
        background-color: var(--bg-white);
    }

    .bottom-nav {
        background-color: var(--bg-white);
    }
}