<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cuadrícula</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            font-family: Arial, sans-serif;
        }
        .cuadricula-container {
            display: inline-block;
        }
        .cuadricula {
            display: grid;
            grid-template-columns: repeat({{ $columnas ?? 10 }}, 1cm);
            grid-template-rows: repeat({{ $filas ?? 10 }}, 1cm);
            border: 1px solid #00FFFF;
            box-sizing: border-box;
        }
        .cuadro {
            width: 1cm;
            height: 1cm;
            border-right: 1px solid #FF00FF45;
            border-bottom: 1px solid #FF00FF45;
            box-sizing: border-box;
        }
        @php
            $cols = $columnas ?? 10;
            $rows = $filas ?? 10;
        @endphp
        .cuadricula .cuadro:nth-child({{ $cols }}n) {
            border-right: none;
        }
        .cuadricula .cuadro:nth-child(n + {{ ($rows - 1) * $cols + 1 }}) {
            border-bottom: none;
        }
    </style>
</head>
<body>
    <div class="cuadricula-container">
        <div class="cuadricula">
            @for($i = 0; $i < ($filas ?? 10) * ($columnas ?? 10); $i++)
                <div class="cuadro"></div>
            @endfor
        </div>
    </div>
</body>
</html>

