/* Floors Page Styles */

.floors-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 1rem;
}

.floors-header .view-toggle {
    justify-self: center;
}

.floors-header .floors-add-btn {
    justify-self: end;
}

.floors-grid {
    display: none;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 1.5rem;
}

.floor-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 0.75rem;
}

.floor-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.floor-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
}

.floor-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.floor-card-meta-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.floor-card-meta-row.level {
    grid-column: 1 / -1;
}

.floor-card-meta-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.floor-card-meta-value {
    color: var(--text-color);
    font-weight: 600;
    text-align: left;
}

.floor-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.floors-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: auto;
}

.floors-table th,
.floors-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    white-space: nowrap;
}

.floors-table th:first-child,
.floors-table td:first-child {
    white-space: normal;
    min-width: 240px;
    width: 30%;
}

.floors-table thead {
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.floors-table th {
    padding: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.floors-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.floors-table th.sortable:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.sort-icon {
    display: inline-block;
    margin-left: 0.5rem;
    width: 0;
    height: 0;
    opacity: 0.3;
}

.sort-icon::before {
    content: '↕';
}

.floors-table th.sort-asc .sort-icon::before {
    content: '↑';
    opacity: 1;
    color: var(--primary-color);
}

.floors-table th.sort-desc .sort-icon::before {
    content: '↓';
    opacity: 1;
    color: var(--primary-color);
}

.floors-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

.floors-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.floors-table tbody tr:last-child td {
    border-bottom: none;
}

.floors-table .actions-cell {
    white-space: nowrap;
    min-width: 96px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.floors-table .actions-cell .btn {
    margin-right: 0;
}

.empty-state-cell {
    padding: 3rem 1rem !important;
    text-align: center;
}

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }

    .floors-table {
        font-size: 0.75rem;
    }

    .floors-table th,
    .floors-table td {
        padding: 0.5rem;
    }

    .floors-header {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title button"
            "toggle toggle";
        row-gap: 0.75rem;
    }

    .floors-header .section-title-group {
        grid-area: title;
    }

    .floors-header .floors-add-btn {
        grid-area: button;
    }

    .floors-header .view-toggle {
        grid-area: toggle;
        width: 100%;
        justify-content: center;
        grid-column: 1 / -1;
    }

    .floors-grid {
        grid-template-columns: 1fr;
    }
}
