/*****************
*                *
*    Général     *
*                *
*****************/
/* Reset simple pour partir sur une bonne base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f8;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* Titre principal */
h1 {
    text-align: center;
    margin: 50px auto 0;
    color: #2c3e50;
}

#chapo {
    text-align: center;
    font-size: 12px;
    margin: 10px 0 10px;
    color: #777;
}

#depot {
    margin: 0px 0 30px;
    text-align: center;
    font-size: 18px;
}

#depot a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: bold;
}

#depot a:hover {
    color: #3498db;
}

#depot img {
    height: 20px;
    position: relative;
    top: 3px;
    margin-right: 3px;
}

/* Conteneur principal */
#mathfunc {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Formulaire de saisie de fonction */
#wrapForm {
    max-width: 600px;
    display: block;
    margin: 0 auto;
}

form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

form input[type="text"] {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

form button {
    padding: 10px 20px;
    font-size: 16px;
    background: #3498db;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

form button:hover {
    background: #2980b9;
}

/* Canvas pour le graphique */
canvas {
    width: 100% !important;
    height: 400px !important;
    margin: 30px 0;
}

/* HR de séparation */
hr {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* Zones "Image" et "Antécédents" */
.image {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.image input[type="number"] {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    flex: 0 0 150px;
}

.image button {
    padding: 8px 15px;
    background: #2ecc71;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.image button:hover {
    background: #27ae60;
}

.image span {
    font-weight: bold;
}

/* Tableau des coordonnées */
#coordTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#coordTable thead {
    background: #3498db;
    color: white;
}

#coordTable th, #coordTable td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 10px;
}

#coordTable tbody tr:nth-child(even) {
    background: #f9f9f9;
}

/* Responsive Design */
@media (max-width: 768px) {
    #mathfunc {
        padding: 20px;
    }

    form {
        flex-direction: column;
        align-items: stretch;
    }

    form input[type="text"], 
    form button {
        width: 100%;
    }

    .image {
        flex-direction: column;
        align-items: stretch;
    }

    .image input[type="number"] {
        flex: 0 0 50px;
    }

    .image input[type="number"],
    .image button,
    .image span {
        width: 100%;
        text-align: center;
    }

    canvas {
        height: 300px !important;
    }

    .table-responsive {
        overflow-x: auto;
    }
    
}

@media (max-width: 480px) {
    h1 {
        font-size: 22px;
    }

    form input[type="text"] {
        font-size: 14px;
    }

    form button {
        font-size: 14px;
    }

    .image input[type="number"] {
        font-size: 14px;
    }

    .image button {
        font-size: 14px;
    }

    #coordTable th, 
    #coordTable td {
        font-size: 12px;
        padding: 8px;
    }

    canvas {
        height: 250px !important;
    }
}
