/* ============================================
   PPP NOUVELLE-CALEDONIE - Styles CSS
   Design mobile-first moderne et épuré
   ============================================ */

/* Variables CSS */
:root {
    --primary-color: #0066cc;
    --primary-dark: #004c99;
    --primary-light: #3385ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --white: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-menu {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
    gap: 0;
}

.nav-menu.open {
    display: flex;
}

.nav-item {
    padding: 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover {
    background-color: var(--light-bg);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--white);
    font-weight: 600;
}

/* Conteneur principal */
.main-container {
    flex: 1;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* En-têtes de page */
.page-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.page-header h2 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* PAGE 1 : ACCUEIL */
.home-container {
    text-align: center;
    padding: 2rem 1rem;
}

.logo-placeholder {
    margin-bottom: 2rem;
}

.logo-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.app-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.app-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 500;
}

.home-description {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.home-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.info-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: left;
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* PAGE 2 : CARTE */
.map-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map {
    height: 400px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1;
}

.map-info {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coordinate-display {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.coord-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--light-bg);
    border-radius: var(--radius);
}

.coord-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.coord-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* PAGE 3 : SAISIE MANUELLE */
.input-container {
    max-width: 500px;
    margin: 0 auto;
}

.coord-system-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.radio-option:hover {
    border-color: var(--primary-light);
}

.radio-option input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-color);
}

.radio-option input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

.radio-option:has(input:checked) {
    border-color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
}

.input-form {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.input-form.hidden {
    display: none;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.input-note {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.input-note p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* PAGE 4 : RÉSULTATS */
.results-container {
    max-width: 600px;
    margin: 0 auto;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.result-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.result-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.result-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.result-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.result-value.highlight {
    color: var(--success-color);
    font-size: 1.25rem;
}

.translation-values {
    background-color: rgba(40, 167, 69, 0.1);
    border: 2px solid var(--success-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.translation-values h4 {
    color: var(--success-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.info-note {
    background-color: rgba(0, 102, 204, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    padding: 1rem;
}

.info-note h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-note p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* PAGE 5 : INFORMATIONS */
.info-container {
    max-width: 700px;
    margin: 0 auto;
}

.info-section {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.info-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-section p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.info-section ul {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.info-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.info-section strong {
    color: var(--text-primary);
}

.grid-progress {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(0, 102, 204, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    text-align: center;
}

.grid-progress p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.grid-progress #progressPercent {
    font-weight: 700;
    color: var(--primary-color);
}

.code-section h4,
.request-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.code-input-group {
    display: flex;
    gap: 0.5rem;
}

.form-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group .form-input {
    width: 100%;
}

.success-message {
    color: var(--success-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Boutons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
}

/* Footer */
.footer {
    background-color: var(--dark-bg);
    color: var(--white);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Messages d'erreur et d'avertissement */
.error-message {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-color);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    color: var(--danger-color);
    font-weight: 600;
}

.warning-message {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    color: #856404;
    font-weight: 600;
}

.success-message {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success-color);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    color: var(--success-color);
    font-weight: 600;
}

/* Responsive - Tablettes */
@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }
    
    .nav-menu {
        display: flex;
        flex-direction: row;
        border-bottom: none;
        background: transparent;
    }
    
    .nav-item {
        border-bottom: none;
        border-radius: var(--radius);
        color: var(--white);
        padding: 0.5rem 1rem;
    }
    
    .nav-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-item.active {
        background-color: var(--white);
        color: var(--primary-color);
    }
    
    .home-actions {
        flex-direction: row;
        max-width: 500px;
    }
    
    .home-info {
        grid-template-columns: 1fr 1fr;
    }
    
    .coordinate-display {
        grid-template-columns: 1fr 1fr;
    }
    
    .coord-system-selector {
        flex-direction: row;
    }
    
    .radio-option {
        flex: 1;
    }
    
    .map {
        height: 500px;
    }
}

/* Responsive - Desktop */
@media (min-width: 1024px) {
    .main-container {
        padding: 2rem;
    }
    
    .app-title {
        font-size: 2.5rem;
    }
    
    .app-subtitle {
        font-size: 1.25rem;
    }
    
    .map {
        height: 600px;
    }
}

/* États de chargement */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utilitaires */
.hidden {
    display: none !important;
}

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

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}
