:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --gray-light: #bdc3c7;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --gradient: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Hlavička podstránky */
.spare-hero {
    background: var(--gradient);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.spare-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}

.spare-hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.spare-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.spare-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Hlavný obsah */
.spare-main {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 60vh;
}

/* Filter a tabuľka sekcia */
.filter-table-section {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.section-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--light);
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
}

.section-title.center-title {
    justify-content: center;
}

.section-title i {
    color: var(--secondary);
    background: rgba(52, 152, 219, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parts-count {
    font-size: 1.2rem;
    color: var(--gray);
    font-weight: 500;
    margin-left: 10px;
}

/* Filtre - RESPONZÍVNE AKO HLAVNÁ STRÁNKA */
.filter-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    align-items: flex-end;
    justify-content: space-between;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.filter-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.filter-group label i {
    color: var(--secondary);
    width: 16px;
}

.filter-select,
.filter-input {
    padding: 0.9rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    width: 100%;
    min-width: 0;
}

.filter-input {
    min-width: 180px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

.filter-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    flex-shrink: 0;
}

.btn-filter {
    background: var(--light);
    color: var(--primary);
    border: 2px solid var(--gray-light);
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
    height: 50px;
}

.btn-filter:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

/* ZMENENÉ: Tabuľka - ÚPLNE AKO HLAVNÁ STRÁNKA */
.table-responsive {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 15px;
    border: 1px solid var(--light);
    -webkit-overflow-scrolling: touch;
}

.parts-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 300px;
}

.parts-table thead {
    background: var(--gradient);
}

.parts-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
    font-size: 1rem;
}

.parts-table th:hover {
    background: rgba(255, 255, 255, 0.1);
}

.parts-table th i {
    margin-right: 8px;
    font-size: 0.9rem;
}

.index-col {
    width: 60px;
    text-align: center !important;
}

/* Sort arrows - AKO HLAVNÁ STRÁNKA */
.sort-arrow {
    margin-left: 6px;
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(255, 255, 255, 0.7);
    opacity: 0.7;
}

.parts-table th.sort-asc .sort-arrow {
    border-bottom-color: white;
    opacity: 1;
}

.parts-table th.sort-desc .sort-arrow {
    border-top: 5px solid white;
    border-bottom: none;
    opacity: 1;
}

.parts-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light);
    vertical-align: middle;
    transition: var(--transition);
    font-size: 0.95rem;
}

.parts-table tbody tr {
    transition: var(--transition);
}

.parts-table tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.parts-table tbody tr:hover td {
    color: var(--primary);
}

.parts-table td:first-child {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    background: rgba(52, 152, 219, 0.05);
    font-family: 'Montserrat', monospace;
    font-size: 1rem;
}

.quantity-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.4rem 0.8rem;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.quantity-number {
    font-size: 1rem;
    color: #27ae60;
}

.quantity-display small {
    color: var(--gray);
    font-size: 0.8rem;
}

/* PAGINÁCIA - UPRAVENÉ: NA MOBILE VEDĽA SEBA, INFO POD */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light);
    flex-wrap: wrap;
}

.pagination-button {
    padding: 0.7rem 1.2rem;
    border: 2px solid var(--gray-light);
    background: white;
    color: var(--primary);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.pagination-button:hover:not(:disabled) {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.pagination-button.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    padding: 0.7rem 0.5rem;
    color: var(--gray);
}

.pagination-info {
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
    margin-top: 1rem;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
    background: var(--light);
    border-radius: 15px;
    margin: 2rem 0;
}

.no-results i {
    margin-bottom: 1.5rem;
    color: var(--gray-light);
}

.no-results h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.export-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light);
}

.export-info {
    color: var(--gray);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-info i {
    color: var(--secondary);
    font-size: 1.1rem;
}

/* ==================== RESPOZÍVNY DIZAJN AKO HLAVNÁ STRÁNKA ==================== */

/* Tablety */
@media (max-width: 992px) {
    .filter-controls {
        flex-wrap: wrap;
        gap: 1.2rem;
    }
    
    .filter-group {
        flex: 1 1 45%;
        min-width: 200px;
    }
    
    .filter-buttons {
        flex: 1 1 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* Malé tablety a veľké mobily */
@media (max-width: 768px) {
    .spare-title {
        font-size: 2.2rem;
    }
    
    .spare-subtitle {
        font-size: 1.2rem;
    }
    
    .filter-table-section {
        padding: 1.5rem;
        margin-top: -30px;
    }
    
    .section-title {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .parts-count {
        margin-left: 0;
    }
    
    /* Responzívne štýly pre filtre */
    .filter-controls {
        gap: 1rem;
    }
    
    .filter-group {
        flex: 1 1 calc(50% - 0.5rem);
    }
    
    .filter-buttons {
        margin-top: 0.5rem;
    }
    
    .export-section {
        flex-direction: column;
        text-align: center;
    }
    
    .export-info {
        justify-content: center;
    }
    
    /* PAGINÁCIA NA MOBILE VEDĽA SEBA, INFO POD */
    .pagination {
        flex-direction: row;
        gap: 0.3rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        justify-content: flex-start;
    }
    
    .pagination-info {
        width: 100%;
        margin-top: 1rem;
        text-align: center;
        order: 1; /* POSUNIE SA POD TLAČIDLÁ */
    }
}

/* Mobily */
@media (max-width: 576px) {
    .spare-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .btn-filter {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }
    
    /* UPRAVENÉ: Tabuľka plne responzívna na mobile AKO HLAVNÁ STRÁNKA */
    .filter-controls {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .filter-group {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
        min-width: 100%;
    }
    
    .filter-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .parts-table {
        font-size: 0.85rem;
        min-width: 100% !important;
    }
    
    .parts-table th,
    .parts-table td {
        padding: 0.8rem 0.5rem;
        white-space: normal;
    }
    
    .parts-table th {
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .parts-table th i {
        margin-right: 5px;
        font-size: 0.8rem;
    }
    
    .quantity-display {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .quantity-number {
        font-size: 0.9rem;
    }
    
    .index-col {
        width: 50px;
    }
    
    /* PAGINÁCIA NA MALÝCH MOBILOCH - MENŠIE TLAČIDLÁ */
    .pagination-button {
        padding: 0.5rem 0.8rem;
        min-width: 40px;
        font-size: 0.85rem;
    }
    
    .pagination-dots {
        padding: 0.5rem 0.3rem;
    }
    
    .pagination-info {
        margin-top: 0.8rem;
        font-size: 0.85rem;
    }
}

/* Veľmi malé mobily */
@media (max-width: 375px) {
    .spare-title {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .btn-filter {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
    
    /* UPRAVENÉ: Ešte kompaktnejšia tabuľka pre malé mobily AKO HLAVNÁ STRÁNKA */
    .parts-table {
        font-size: 0.8rem;
    }
    
    .parts-table th,
    .parts-table td {
        padding: 0.5rem 0.4rem;
    }
    
    .parts-table th {
        font-size: 0.85rem;
    }
    
    .quantity-display {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .quantity-number {
        font-size: 0.85rem;
    }
    
    .index-col {
        width: 45px;
    }
    
    /* PAGINÁCIA NA VEĽMI MALÝCH MOBILOCH - EŠTE MENŠIE */
    .pagination-button {
        padding: 0.4rem 0.6rem;
        min-width: 35px;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
        margin-top: 0.7rem;
    }
}

/* Veľmi úzke obrazovky */
@media (max-width: 320px) {
    .parts-table {
        font-size: 0.75rem;
    }
    
    .parts-table th {
        font-size: 0.8rem;
        padding: 0.5rem 0.3rem;
    }
    
    .parts-table td {
        padding: 0.5rem 0.3rem;
    }
    
    .index-col {
        width: 40px;
    }
    
    /* PAGINÁCIA NA VEĽMI ÚZKÝCH OBRAZOVKÁCH */
    .pagination {
        gap: 0.2rem;
    }
    
    .pagination-button {
        padding: 0.3rem 0.5rem;
        min-width: 30px;
        font-size: 0.75rem;
    }
    
    .pagination-info {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }
}

/* Zariadenia s malou výškou */
@media (max-height: 600px) {
    .spare-hero {
        padding: 3rem 0 1.5rem;
    }
    
    .spare-title {
        font-size: 2rem;
    }
}

@media print {
    .navbar,
    .spare-hero,
    .filter-controls,
    .pagination,
    .export-section,
    .footer,
    .back-to-top {
        display: none !important;
    }
    
    .spare-main {
        padding: 0;
        background: white;
    }
    
    .filter-table-section {
        box-shadow: none;
        padding: 0;
        margin-top: 0;
    }
    
    .table-responsive {
        border: none;
    }
    
    .parts-table {
        border: 1px solid #000;
    }
    
    .parts-table th {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .parts-table th,
    .parts-table td {
        border: 1px solid #000;
    }
}