/* --- FOND GLOBAL --- */
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: white;
    text-align: center;
    min-height: 100vh;
}

/* Fond animé UNIQUEMENT sur la page d’accueil */
body.homepage {
    background: linear-gradient(135deg, #002366, #0047ab, #1e90ff, #00c896, #4caf50);
    background-size: 300% 300%;
    animation: gradientMove 12s ease infinite;
}

/* Fond statique (login et dashboard) : même palette mais fixe */
body.otherpage {
    background: linear-gradient(135deg, #002366, #0047ab, #1e90ff, #00c896, #4caf50);
    background-size: cover;
}

/* Animation du dégradé du fond */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- BARRE DU HAUT --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0047ab, #1e90ff); /* fixed blue header */
    padding: 20px 32px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    height: 100px;
}

.logo {
    display: flex;
    height: 95px;
    object-fit: contain;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Néon */
    filter: drop-shadow(0 0 6px #76ff00)
            drop-shadow(0 0 12px #76ff00)
            drop-shadow(0 0 18px #76ff00);
}

/* --- BOUTON VITREUX --- */
.login-btn, .btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

/* Hover : légère montée + vert */
.login-btn:hover, .btn:hover {
    transform: translateY(-6px) scale(1.02);
    background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.12));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Clic : effet "press" */
.login-btn:active, .btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* small utility */
.container {
    width: 92%;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- CONTENT --- */
.content {
    padding: 40px 20px 80px 20px;
}

/* --- TABLE / CARDS --- */
.table-container {
    width: 90%;
    max-width: 1000px;
    margin: 30px auto 80px auto;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    color: white;
}

.table-header {
    display: grid;
    grid-template-columns: 60px 1fr 180px 140px;
    gap: 0;
    align-items: center;
    padding: 12px 18px;
    background: rgba(255,255,255,0.9);
    color: #0047ab;
    font-weight: 700;
}

.table-row {
    display: grid;
    grid-template-columns: 60px 1fr 180px 140px;
    gap: 0;
    align-items: center;
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.table-row:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

/* actions */
.row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.small-btn {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
}

/* --- FORMULAIRES & LOGIN BOX --- */
.login-box {
    max-width: 420px;
    margin: 50px auto;
    padding: 28px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    color: white;
    animation: appearUp 0.5s ease;
}

.form-field {
    width: 100%;
    margin: 10px 0;
}

.form-field input,
.form-field textarea {
    width: 96%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.95);
    font-size: 14px;
}

/* add button style */
.add-button {
    margin-top: 12px;
    background: linear-gradient(135deg, #0047ab, #00c896);
}

/* small messages */
.flash {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.flash.success {
    background: rgba(0,200,120,0.15);
    color: #eafff0;
    border: 1px solid rgba(0,200,120,0.25);
}

.flash.error {
    background: rgba(255,80,80,0.12);
    color: #ffecec;
    border: 1px solid rgba(255,80,80,0.18);
}

.flash.info {
    background: rgba(255,255,255,0.06);
    color: #f0f8ff;
    border: 1px solid rgba(255,255,255,0.06);
}

/* --- Animations --- */
@keyframes appearUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE TABLE */
@media (max-width: 800px) {
    .table-header {
        display: none; /* on cache l'entête sur mobile */
    }

    .table-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        border-top: 1px solid rgba(255,255,255,0.06);
    }

    .table-row > div {
        margin-bottom: 8px;
    }

    .table-row > div:first-child {
        font-size: 18px;
        color: #76ff00; /* prix en évidence */
    }

    .row-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 6px;
    }
}


/* --- FOOTER --- */
footer {
    background-color: rgba(26, 26, 46, 0.5); /* plus transparent pour effet vitreux */
    color: #ffffff;
    text-align: center;
    padding: 7px 0; /* réduit la hauteur */
    width: 100%;
    position: fixed;
    bottom: 0px;
    font-family: Arial, sans-serif;
    backdrop-filter: blur(20px); /* flou plus prononcé */
    -webkit-backdrop-filter: blur(20px); /* Safari */
    border-top: 1px solid rgba(255,255,255,0.1); /* bordure subtile */
    box-shadow: 0 -1px 5px rgba(0,0,0,0.2);
}

/* --- NAVIGATION PAR DÉFAUT (grand écran) --- */
nav {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-right: 20px;
}

nav a {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(6px);
    transition: all 0.3s ease;
}
nav a:hover {
    background: rgba(255,255,255,0.25);
}

/* --- bouton hamburger --- */
.menu-toggle {
    display: none; /* caché par défaut (desktop) */
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 200;
    position: relative;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    transition: all 0.4s ease;
}

/* Transformation en croix parfaite ✖ */
.menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* --- responsive mobile --- */
@media (max-width: 900px) {
    nav {
        display: none; /* on cache le menu normal */
        flex-direction: column;
        position: absolute;
        top: 100px;
        right: 20px;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(15px);
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    }

    nav.show {
        display: flex;
        animation: fadeIn 0.6s ease forwards;
    }

    .menu-toggle { display: flex; }
}


.section-title {
    margin-top: 40px;
    font-size: 36px;
    text-align: center;
}

.section-intro {
    opacity: 0.95;
    margin-top: 14px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-text {
    opacity: 0.95;
    margin-top: 14px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-align: justify;
}

/* Onglets */
.tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px auto 20px auto;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #0047ab, #00c896);
    color: white;
    border: none;
}

/* Amélioration des inputs et du select */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-weight: 600;
  font-size: 14px;
  color: #e0f7e9;
}

.select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.select-wrapper select {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: white;
  cursor: pointer;
  appearance: none; /* supprime la flèche native */
  outline: none;
}

.select-wrapper::after {
  content: "▼";
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Splash Screen */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff; /* ou noir selon ton style */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* conteneur logo splash */
.splash-logo {
  position: relative;
  width: 200px;
  height: 200px;
}

/* flèches animées */
.splash-arrows {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  animation: rotate 3s linear infinite;
  z-index: 0;
}

/* logo central */
.splash-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  z-index: 1;
}

/* animation rotation */
@keyframes rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* effet de disparition */
#splash.fade-out {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* Fond spécial pour inventaire */
body.inventairepage {
    background: linear-gradient(135deg, #002366, #0047ab, #1e90ff, #00c896, #4caf50);
    background-size: 300% 300%;
    animation: gradientMove 12s ease infinite;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.product-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

.product-card img {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    margin-bottom: 12px;
}

.product-card .prix {
    font-size: 20px;
    font-weight: bold;
    color: #76ff00;
}

/* === MODE SOMBRE === */
body.dark-mode {
    background: linear-gradient(135deg, #171edb, #1b0033, #240046, #3c096c, #5a189a, #7b2cbf);
    background-size: 300% 300%;
    animation: gradientMove 12s ease infinite;
    color: #e0dfff;
}

/* boutons vitreux */
body.dark-mode .btn,
body.dark-mode .login-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e0dfff;
}

body.dark-mode .btn:hover,
body.dark-mode .login-btn:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
}

/* Header violet */
body.dark-mode .header {
    background: linear-gradient(135deg, #3c096c, #5a189a, #171edb);
}

/* Table et éléments vitreux */
body.dark-mode .table-container,
body.dark-mode .login-box,
body.dark-mode nav,
body.dark-mode footer {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Texte du footer et nav */
body.dark-mode footer,
body.dark-mode nav a {
    color: #e0dfff;
}

/* Accent violet */
body.dark-mode .tab-btn.active,
body.dark-mode .add-button {
    background: linear-gradient(135deg, #5a189a, #9d4edd);
}

/* Sélecteurs et input */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: rgba(255,255,255,0.1);
    color: #e0dfff;
}

.theme-toggle {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}
