<?php include_once "encabezado1.php"; ?>

<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Registro de Almacén 📦</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        /* Estilos generales */
        body {
            font-family: 'Montserrat', sans-serif;
            background: url('https://source.unsplash.com/random/1600x900') no-repeat center center fixed;
            background-size: cover;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            color: #333;
        }

        .container {
            background-color: #ffffffcc;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            padding: 30px;
            max-width: 800px;
            animation: fadeIn 1s ease-in-out;
        }

        h2 {
            font-size: 2.5em;
            color: #2c3e50;
            font-weight: 600;
            text-align: center;
            margin-bottom: 20px;
        }

        /* Efectos para la tabla */
        .table {
            background-color: #ffffffcc;
            border-radius: 10px;
            overflow: hidden;
        }

        .table th, .table td {
            font-weight: 500;
            color: #34495e;
            background-color: #ffffffcc;
            text-align: center;
        }

        .table-hover tbody tr:hover {
            background-color: rgba(46, 204, 113, 0.2);
            transition: background-color 0.3s ease;
        }

        /* Efecto de sombra y bordes */
        .table-striped tbody tr:nth-of-type(odd) {
            background-color: rgba(255, 255, 255, 0.7);
        }

        .table-info {
            background: linear-gradient(135deg, #6dd5ed 0%, #2193b0 100%);
            color: #fff;
            font-weight: bold;
        }

        /* Animaciones y microinteracciones */
        @keyframes fadeIn {
            from { opacity: 0; transform: scale(0.9); }
            to { opacity: 1; transform: scale(1); }
        }

        /* Botones flotantes de acción */
        .btn-action {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: linear-gradient(135deg, #6dd5ed 0%, #2193b0 100%);
            color: white;
            border-radius: 50%;
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5em;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
            cursor: pointer;
            transition: transform 0.3s ease, background 0.3s ease;
        }

        .btn-action:hover {
            transform: scale(1.1);
            background: linear-gradient(135deg, #6dd5ed 0%, #34c6eb 100%);
        }

        /* Estilos de iconos y emojis */
        .icon {
            font-size: 1.2em;
            color: #3498db;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>📦 Registro de Almacén</h2>
        <?php
            date_default_timezone_set("America/Lima"); 
            include 'conexion1.php';

            $conectar = mysqli_connect($servidor, $nombre, $clave, $base);
            $sql = "SELECT * from cod_almacen";
            $result = mysqli_query($conectar, $sql);
        ?>
        <table class="table table-striped table-bordered table-hover">
            <thead>
                <tr class="table-info">
                    <td>ID</td>
                    <td>Fecha Registro</td>
                    <td>Hora Registro</td>
                    <td>Código</td>
                    <td>Bien</td>
                </tr>
            </thead>
            <tbody>
                <?php while($mostrar = mysqli_fetch_array($result)) { ?>
                    <tr>
                        <td><?php echo $mostrar["ID"]; ?></td>
                        <td><?php echo $mostrar["FECHA_REGISTRO"]; ?></td>
                        <td><?php echo $mostrar["HORA_REGISTRO"]; ?></td>
                        <td><?php echo $mostrar["CODIGO"]; ?></td>
                        <td><?php echo $mostrar["BIEN"]; ?></td>
                    </tr>
                <?php } ?>
            </tbody>
        </table>
    </div>

    <!-- Botón de acción flotante -->
    <div class="btn-action" title="Agregar nuevo registro">
        <i class="fas fa-plus"></i>
    </div>

    <!-- Scripts de jQuery y Bootstrap -->
    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</body>
</html>

