body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
}

.header-cell {
    position: relative;
    cursor: default;
}

.header-icon {
    font-size: 14px;
    color: #333;
}

.grid-container-wrapper {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.grid-container {
    display: none;
    grid-gap: 1px;
    background-color: #ccc;
    border: 1px solid #ccc;
    margin: 20px auto;
}

.grid-container.active {
    display: grid;
}

.grid-12x12 {
    grid-template-columns: 30px repeat(12, 30px);
    grid-template-rows: 30px repeat(12, 30px);
}

.grid-6x6 {
    grid-template-columns: 40px repeat(6, 40px);
    grid-template-rows: 40px repeat(6, 40px);
}

.grid-cell {
    width: 30px;
    height: 30px;
    background-color: white;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    font-size: 25px;
}

.grid-6x6 .grid-cell {
    width: 40px;
    height: 40px;
    font-size: 30px;
}


/* Fijamos los encabezados de la primera columna */
.grid-12x12 .grid-cell.header-cell:first-child,
.grid-12x12 .grid-cell:nth-child(13n + 1) {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1); /* Sombra sutil para distinguir */
}

/* Fijamos los encabezados de la primera fila */
.grid-12x12 .grid-cell.header-cell:nth-child(-n+13) {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* La esquina superior izquierda debe mantenerse siempre visible */
.grid-12x12 .grid-cell.header-cell:first-child {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 3;
}

.grid-cell.interactive {
    cursor: pointer;
}

.grid-cell.interactive:hover {
    background-color: #f9f9f9;
}

.grid-cell.disabled {
    background-color: #888;
    cursor: not-allowed;
}

.controls {
    margin: 20px 0;
}

.icon-x {
    color: red;
    font-weight: bold;
}

.icon-check {
    color: green;
    font-weight: bold;
}

h1, h2 {
    color: #333;
    margin-bottom: 20px;
}

.zone-border-top {
    border-top: 2px solid #333;
}

.zone-border-right {
    border-right: 2px solid #333;
}

.zone-border-bottom {
    border-bottom: 2px solid #333;
}

.zone-border-left {
    border-left: 2px solid #333;
}

/* Estilos para las pestañas */
.tab-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ccc;
}

.tab-button {
    padding: 10px 15px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: bold;
}

.tab-button.active {
    background-color: white;
    border-bottom: 2px solid white;
    margin-bottom: -1px;
}

.tab-content {
    display: none;
    padding: 15px;
    border: 1px solid #ccc;
    border-top: none;
    text-align: center;
}

.tab-content.active {
    display: block;
}

/* Estilos para el selector de iconos */
.icon-selector {
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    z-index: 100;
}

.icon-option {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #eee;
}

.icon-option:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.header-cell {
    background-color: #f0f0f0;
}

.header-cell:hover {
    background-color: #e0e0e0;
}

.header-cell i {
    color: #555;
    font-size: 14px;
}

/* Estilos para los selectores de iconos */
.icon-selectors-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 800px;
}

.icon-selector-category {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    min-width: 100px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.icon-selector-category h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.icon-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.icon-slot {
    width: 40px;
    height: 40px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-slot:nth-child(4) {
    transition: all 0.3s ease;
}

.icon-slot.hidden {
    display: none;
}

.icon-slot:hover {
    border-color: #999;
    background-color: #f9f9f9;
}

.icon-slot i {
    font-size: 18px;
    color: #666;
}

/* Estilos para el toggle switch */
.toggle-container {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-left: 10px;
    pointer-events: auto !important;
}

.toggle-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.toggle-switch:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-switch {
    background-color: #2196F3;
}

input:checked + .toggle-switch:before {
    transform: translateX(20px);
}

.icon-selector-category.disabled {
    opacity: 0.5;
}

.icon-selector-category.disabled .icon-slots {
    pointer-events: none;
}

/* Estilos para el selector de iconos de FontAwesome */
.fa-icon-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    width: 80%;
    max-width: 600px;
    max-height: 400px;
    overflow-y: auto;
}

.fa-icon-search {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.fa-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
}

.fa-icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
}

.fa-icon-option:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.fa-icon-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Estilos para los botones selectores de símbolos */
.symbol-selector-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.symbol-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.symbol-button:hover {
    background-color: #e5e5e5;
}

.symbol-button.active {
    border-color: #2196F3;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.5);
}

.symbol-button .icon-check {
    font-size: 22px;
}

.symbol-button .icon-x {
    font-size: 22px;
}

/* Estilo para el botón de reset */
.reset-button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.reset-button:hover {
    background-color: #d32f2f;
}

.reset-button:active {
    transform: scale(0.98);
}
