/**
 * ZenVote - Styles Responsive Globaux
 * Ce fichier contient les styles de base pour mobile qui s'appliquent à tout le site
 */

/* ============================================
   RESET ET BASE MOBILE
   ============================================ */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CONTENEURS PRINCIPAUX
   ============================================ */

.container {
    width: 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

.container-fluid {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
}

/* ============================================
   TYPOGRAPHIE MOBILE
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-top: 0;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* ============================================
   FORMULAIRES MOBILE
   ============================================ */

input, textarea, select {
    font-size: 16px !important; /* Empêche le zoom sur iOS */
    padding: 10px 12px !important;
    border-radius: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 10px !important;
}

label {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
    display: block !important;
}

button, .btn {
    font-size: 14px !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 10px !important;
}

/* ============================================
   CARTES ET BLOCS
   ============================================ */

.card, .event-card, .candidate-card, .poll-card {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 15px !important;
    padding: 15px !important;
    border-radius: 12px !important;
}

.card-body {
    padding: 15px !important;
}

/* ============================================
   IMAGES RESPONSIVES
   ============================================ */

img {
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important;
    display: block !important;
}

/* ============================================
   GRILLES MOBILE
   ============================================ */

.row {
    margin-left: -10px;
    margin-right: -10px;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
.col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
.col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    padding-left: 10px;
    padding-right: 10px;
}

.col-12, .col-sm-12, .col-md-12 {
    width: 100%;
}

/* ============================================
   ALERTES ET MESSAGES
   ============================================ */

.alert {
    padding: 12px 15px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    margin-bottom: 15px !important;
    width: 100% !important;
}

/* ============================================
   TABLEAUX
   ============================================ */

table {
    font-size: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    display: block !important;
}

th, td {
    padding: 8px !important;
    font-size: 12px !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar, .header, .top-bar {
    padding: 10px 15px !important;
}

.nav, .menu {
    flex-direction: column !important;
    width: 100% !important;
}

.nav-item, .menu-item {
    padding: 10px !important;
    width: 100% !important;
    text-align: center !important;
}

/* ============================================
   BOUTONS
   ============================================ */

.btn-group, .button-group {
    flex-direction: column !important;
    width: 100% !important;
}

.btn-group .btn, .button-group .btn {
    width: 100% !important;
    margin-bottom: 10px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ============================================
   MODALES
   ============================================ */

.modal {
    padding: 10px !important;
    width: 95% !important;
    max-width: 95% !important;
    margin: 10px auto !important;
}

.modal-content {
    padding: 15px !important;
    border-radius: 12px !important;
}

/* ============================================
   CORRECTIONS DE DEBORDEMENT
   ============================================ */

.overflow-hidden {
    overflow: hidden !important;
}

.text-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.d-block {
    display: block !important;
}

.w-100 {
    width: 100% !important;
}

/* ============================================
   MEDIA QUERIES POUR DIFFÉRENTS ÉCRANS
   ============================================ */

/* Petits mobiles */
@media (max-width: 375px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    input, button, .btn {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
}

/* Mobiles */
@media (max-width: 576px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .card, .event-card {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
}

/* Tablettes */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .container {
        max-width: 100%;
    }
}

/* ============================================
   UTILITAIRES FLEXBOX
   ============================================ */

.d-flex {
    display: flex !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

/* ============================================
   ESPACEMENTS
   ============================================ */

.m-0 { margin: 0 !important; }
.m-1 { margin: 5px !important; }
.m-2 { margin: 10px !important; }
.m-3 { margin: 15px !important; }
.m-4 { margin: 20px !important; }
.m-5 { margin: 25px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 5px !important; }
.mt-2 { margin-top: 10px !important; }
.mt-3 { margin-top: 15px !important; }
.mt-4 { margin-top: 20px !important; }
.mt-5 { margin-top: 25px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 5px !important; }
.mb-2 { margin-bottom: 10px !important; }
.mb-3 { margin-bottom: 15px !important; }
.mb-4 { margin-bottom: 20px !important; }
.mb-5 { margin-bottom: 25px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 5px !important; }
.p-2 { padding: 10px !important; }
.p-3 { padding: 15px !important; }
.p-4 { padding: 20px !important; }
.p-5 { padding: 25px !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 5px !important; }
.pt-2 { padding-top: 10px !important; }
.pt-3 { padding-top: 15px !important; }
.pt-4 { padding-top: 20px !important; }
.pt-5 { padding-top: 25px !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 5px !important; }
.pb-2 { padding-bottom: 10px !important; }
.pb-3 { padding-bottom: 15px !important; }
.pb-4 { padding-bottom: 20px !important; }
.pb-5 { padding-bottom: 25px !important; }
