/* Hero Section dla Bazy Gmin */
.gminy-hero {
    background:
        linear-gradient(135deg, rgba(26, 35, 50, 0.88) 0%, rgba(44, 57, 71, 0.80) 50%, rgba(26, 35, 50, 0.88) 100%),
        url('https://images.pexels.com/photos/51191/stack-letters-letter-handwriting-family-letters-51191.jpeg') center/cover no-repeat;
    color: #ffffff;
    padding: 80px 0;
    text-align: center;
    border-bottom: 3px solid var(--border-light);
    position: relative;
}

.gminy-hero h1 {
    font-size: 2.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.gminy-hero p {
    font-size: 1.125rem;
    color: #f5f5f5;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .gminy-hero {
        padding: 2.7778rem 1.1111rem 2.2222rem;
    }

    .gminy-hero h1 {
        font-size: 1.6667rem;
    }

    .gminy-hero p {
        font-size: 1rem;
    }
}

.psi-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    background: #f5f5f5;
}

@media (max-width: 768px) {
    .psi-page {
        padding: 30px 15px;
    }
}

.gminy-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 40px;
}

.gminy-wrapper {
    margin-bottom: 50px;
}

.controls {
    padding: 25px 30px;
    background: #f5f5f5;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

@media (max-width: 768px) {
    .controls {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .filter-group label {
        font-size: 0.9em;
    }

    .filter-group select {
        min-width: 100%;
    }

    .clear-btn {
        width: 100%;
    }
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--navy-dark);
    box-shadow: 0 0 0 3px rgba(35, 39, 46, 0.1);
}

.search-box input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-group label {
    font-weight: 600;
    color: #2c2c2c;
}

.filter-group select {
    padding: 10px 15px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 200px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--navy-dark);
    box-shadow: 0 0 0 3px rgba(35, 39, 46, 0.1);
}

.filter-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.clear-btn {
    padding: 10px 20px;
    background-color: var(--accent-red);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-btn:hover {
    background-color: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(223, 63, 63, 0.3);
}

.loading-message {
    padding: 60px 30px;
    text-align: center;
    color: #5a5a5a;
    font-size: 1.2em;
}

.loading-message p {
    margin: 0;
}

.hint-message {
    padding: 12px 30px;
    text-align: center;
    color: #5a5a5a;
    font-size: 0.9rem;
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    font-style: italic;
}

.hint-message.hidden {
    display: none;
}

.table-container {
    padding: 30px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table-container {
        padding: 15px;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

@media (max-width: 768px) {
    table {
        min-width: 600px;
        font-size: 0.9em;
    }

    th,
    td {
        padding: 12px 8px;
        font-size: 0.85em;
    }
}

table.hidden {
    display: none;
}

thead {
    background: #1a2332;
    color: white;
}

th {
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(224, 224, 224, 0.3);
}

th:last-child {
    border-right: none;
}

tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
    cursor: pointer;
}

tbody tr:hover {
    background-color: rgba(35, 39, 46, 0.03);
}

td {
    padding: 16px 15px;
    font-size: 0.95em;
}

/* Dyskretny kod TERYT w tabeli */
.teryt-kod {
    font-size: 0.75em;
    color: #6b6b6b;
    opacity: 0.9;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
    text-align: center;
    min-width: 60px;
}

@media (max-width: 768px) {
    .badge {
        padding: 5px 10px;
        font-size: 0.8em;
        min-width: 50px;
    }
}

.badge-0 {
    background: #e9ecef;
    color: #495057;
}

.badge-15 {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-25 {
    background: #d4edda;
    color: #155724;
}

.badge-30 {
    background: #fff3cd;
    color: #856404;
}

.badge-35 {
    background: #f8d7da;
    color: #721c24;
}

.badge-40 {
    background: #cce5ff;
    color: #004085;
}

.badge-50 {
    background: #e2d9f3;
    color: #4a2c6d;
}

.badge-45 {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-60 {
    background: #d4edda;
    color: #155724;
}

.badge-65 {
    background: #c3e6cb;
    color: #155724;
}

.badge-70 {
    background: #b8daff;
    color: #004085;
}

.rodzaj {
    font-weight: 600;
    color: #5a5a5a;
    font-size: 0.85em;
}

.expandable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.expandable-row:hover {
    background-color: rgba(35, 39, 46, 0.05) !important;
}

.expand-icon {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.3s;
    color: var(--navy-dark);
    font-size: 0.9em;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.details-row {
    display: none;
    background-color: #f5f5f5;
}

.details-row.show {
    display: table-row;
}

.details-cell {
    padding: 25px 30px !important;
    border-left: 4px solid var(--navy-dark);
}

@media (max-width: 768px) {
    .details-cell {
        padding: 15px !important;
    }
}

.details-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .details-content {
        padding: 15px;
    }
}

.details-header {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.firm-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .firm-types-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.firm-type-card {
    background: #ffffff;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
}

@media (max-width: 768px) {
    .firm-type-card {
        padding: 12px;
    }
}

.firm-type-card:hover {
    border-color: var(--navy-dark);
    box-shadow: 0 2px 8px rgba(35, 39, 46, 0.15);
}

.firm-type-header {
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 10px;
}

.firm-detail {
    margin: 8px 0;
    font-size: 0.9em;
}

.firm-detail-label {
    color: #5a5a5a;
    font-size: 0.85em;
    display: block;
    margin-bottom: 3px;
}

.firm-detail-value {
    color: #2c2c2c;
    font-weight: 600;
    font-size: 1em;
}

.firm-detail-secondary {
    font-size: 0.9em;
    color: #5a5a5a;
    margin-top: 4px;
}

.range-display {
    color: #5a5a5a;
    font-size: 0.9em;
}

.gmina-tracaca-badge {
    display: inline-block;
    background: var(--navy-dark);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 10px;
}

@media (max-width: 768px) {
    .gmina-tracaca-badge {
        display: block;
        margin-left: 0;
        margin-top: 8px;
        text-align: center;
        padding: 6px 12px;
        font-size: 0.7em;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.gmina-tracaca-info {
    background: rgba(35, 39, 46, 0.05);
    border-left: 4px solid var(--navy-dark);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    color: #2c2c2c;
    font-weight: 500;
}

@media (max-width: 768px) {
    .gmina-tracaca-info {
        padding: 12px;
        font-size: 0.9em;
    }
}

.gmina-tracaca-info strong {
    color: var(--navy-dark);
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

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

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    table {
        font-size: 0.85em;
    }

    th,
    td {
        padding: 10px 8px;
    }
}

