/**
 * Style frontendowe S-Manager
 * 
 * @package S_Manager
 * @since 1.0.1
 */

/* ===== CONTAINER GŁÓWNY ===== */
.s-manager-services {
    width: 100%;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1d2327;
}

/* ===== FILTRY ===== */
.s-manager-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.s-manager-filter {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.s-manager-filter label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d2327;
    font-size: 14px;
}

.s-manager-filter select,
.s-manager-filter input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.s-manager-filter select:focus,
.s-manager-filter input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
    outline: none;
}

.s-manager-filter-buttons {
    display: flex;
    gap: 10px;
    align-items: end;
}

.s-manager-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.s-manager-btn-primary {
    background: #2271b1;
    color: white;
}

.s-manager-btn-primary:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.4);
}

.s-manager-btn-secondary {
    background: #6c757d;
    color: white;
}

.s-manager-btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* ===== WIDOK TABELI ===== */
.s-manager-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.s-manager-table th {
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.s-manager-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.s-manager-table th.sortable:hover {
    background: linear-gradient(135deg, #1e5a8a, #0f4c73);
}

.s-manager-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    font-size: 12px;
}

.s-manager-table th.sorted-asc::after {
    content: '↑';
    opacity: 1;
}

.s-manager-table th.sorted-desc::after {
    content: '↓';
    opacity: 1;
}

.s-manager-table td {
    padding: 18px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
    transition: background-color 0.3s ease;
}

.s-manager-table tr:hover td {
    background-color: #f8f9fa;
}

.s-manager-table tr:last-child td {
    border-bottom: none;
}

.service-thumbnail {
    width: 142px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.service-domain {
    margin-top: 5px;
    display: block;
    font-size: 13px;
}

.service-domain a {
    color: #2271b1;
    text-decoration: none;
    font-weight: normal;
    transition: color 0.3s ease;
}

.service-domain a:hover {
    color: #135e96;
    text-decoration: underline;
}

.s-manager-table td.name-col {
    vertical-align: middle;
}

.service-name {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
}

.service-language {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: #e9ecef;
    border-radius: 15px;
    font-size: 12px;
    color: #495057;
    border: 1px solid #ced4da;
}

.main-taxonomy {
    display: inline-block;
    margin-bottom: 4px;
    padding: 2px 8px;
    background: #2271b1;
    border-radius: 12px;
    font-size: 11px;
    color: #fff;
    font-weight: 600;
}



.main-taxonomy-label {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #2271b1;
}

.main-category,
.main-theme,
.main-location {
    display: inline-block;
    margin-top: 4px;
    margin-right: 8px;
    padding: 3px 8px;
    background: #d1e7dd;
    border-radius: 12px;
    font-size: 11px;
    color: #0f5132;
    border: 1px solid #badbcc;
    margin-left: 10px;
}

.service-description {
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    max-width: 300px;
    margin-bottom: 0;
    overflow: hidden;
}

/* Style dla podpisu "Główna" w różnych widokach */
.main-taxonomy-label {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #2271b1;
}

.main-category,
.main-theme,
.main-location {
    display: inline-block;
    margin-top: 4px;
    margin-right: 8px;
    padding: 3px 8px;
    background: #d1e7dd;
    border-radius: 12px;
    font-size: 11px;
    color: #0f5132;
    border: 1px solid #badbcc;
    margin-left: 10px;
}

.s-manager-table td.description-col {
    max-width: 300px;
    vertical-align: middle;
}

.s-manager-table td.location-col {
    max-width: 250px;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.4;
}

.s-manager-table .main-location {
    color: #0073aa;
    font-weight: 600;
}

.service-categories,
.service-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.service-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.service-tag:hover {
    background: #dee2e6;
    transform: scale(1.05);
}

.service-tag.category {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border-color: #90caf9;
}

.service-tag.theme {
    background: linear-gradient(135deg, #f3e5f5, #ce93d8);
    color: #7b1fa2;
    border-color: #ba68c8;
}

.service-language {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.service-language::before {
    content: '🌐';
    font-size: 16px;
}

.service-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.service-offers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 250px;
}

.service-offer {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.service-offer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.offer-title {
    font-weight: 600;
    color: #856404;
    margin-bottom: 4px;
    font-size: 13px;
}

.offer-description {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 6px;
}

.offer-price {
    font-weight: 700;
    color: #155724;
    font-size: 14px;
    text-align: right;
}

.no-offers {
    color: #6c757d;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 10px;
}

/* ===== WIDOK SIATKI ===== */
.s-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.service-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #e9ecef;
    transition: all 0.4s ease;
    position: relative;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.service-card-header {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.service-card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.service-card:hover .service-card-thumbnail {
    transform: scale(1.1);
}

.service-card-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.service-card-body {
    padding: 25px;
}

.service-card-domain {
    font-size: 18px;
    font-weight: 700;
    color: #2271b1;
    text-decoration: none;
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}

.service-card-domain:hover {
    color: #135e96;
}

.service-card-name {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
    font-weight: 500;
}

.service-card-description {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.service-card-language {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 15px;
    font-size: 12px;
    color: #495057;
}

.service-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.service-card-offers {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
}

.service-card-offers h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #495057;
    font-weight: 600;
}

.service-card-offer {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.service-card-offer:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.service-card-offer:last-child {
    margin-bottom: 0;
}

/* ===== WIDOK LISTY ===== */
.s-manager-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.service-list-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.service-list-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: #2271b1;
}

.service-list-thumbnail {
    width: 142px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.service-list-content {
    flex: 1;
    min-width: 0;
}

.service-list-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.service-list-domain {
    font-size: 20px;
    font-weight: 700;
    color: #2271b1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.service-list-domain:hover {
    color: #135e96;
}

.service-list-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
}

.service-list-description {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 15px;
}

.service-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.service-list-offers {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    max-width: 300px;
}

/* ===== PAGINACJA ===== */
.s-manager-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

.pagination-btn:hover {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
    transform: translateY(-2px);
}

.pagination-btn.current {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
    font-weight: 700;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== LOADING STATES ===== */
.s-manager-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #6c757d;
}

.s-manager-loading::before {
    content: '';
    width: 30px;
    height: 30px;
    margin-right: 15px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== EMPTY STATE ===== */
.s-manager-empty {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.s-manager-empty h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #495057;
}

.s-manager-empty p {
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .s-manager-filters {
        flex-direction: column;
    }
    
    .s-manager-filter {
        min-width: auto;
    }
    
    .s-manager-grid {
        grid-template-columns: 1fr;
    }
    
    .s-manager-table {
        font-size: 13px;
    }
    
    .s-manager-table th,
    .s-manager-table td {
        padding: 12px 8px;
    }
    
    .service-list-item {
        flex-direction: column;
        text-align: center;
    }
    
    .service-list-content {
        text-align: left;
    }
    
    .service-list-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .service-list-meta {
        justify-content: center;
    }
    
    .service-list-offers {
        max-width: none;
    }
    
    .s-manager-pagination {
        gap: 5px;
    }
    
    .pagination-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .service-card-body {
        padding: 20px;
    }
    
    .service-list-item {
        padding: 20px;
    }
    
    .s-manager-table,
    .s-manager-table tbody,
    .s-manager-table th,
    .s-manager-table td,
    .s-manager-table tr {
        display: block;
    }
    
    .s-manager-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .s-manager-table tr {
        border: 1px solid #dee2e6;
        border-radius: 12px;
        margin-bottom: 20px;
        padding: 20px;
        background: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .s-manager-table td {
        border: none;
        position: relative;
        padding: 10px 0;
        text-align: left;
    }
    
    .s-manager-table td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #495057;
        display: block;
        margin-bottom: 5px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.s-manager-services :focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.s-manager-services .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .s-manager-services {
        color: #1a1a1a;
    }
    
    .s-manager-filters {
        background: #343a40;
        border-color: #495057;
    }
    
    .s-manager-filter input,
    .s-manager-filter select {
        background: #495057;
        border-color: #6c757d;
        color: #e9ecef;
    }
    
    .s-manager-table {
        background: #495057;
        border-color: #6c757d;
    }
    
    .s-manager-table td {
        border-color: #6c757d;
    }
    
    .s-manager-table tr:hover td {
        background-color: #5a6268;
    }
    
    .service-card {
        background: #495057;
        border-color: #6c757d;
    }
    
    .service-list-item {
        background: #495057;
        border-color: #6c757d;
    }
    
    .pagination-btn {
        background: #495057;
        border-color: #6c757d;
        color: #e9ecef;
    }
}

/* ===== TABELA SERWISÓW ===== */
.s-manager-services-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e1e5e9;
}

.s-manager-services-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 12px;
}

.s-manager-services-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.s-manager-services-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.s-manager-services-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

/* Wymuś 12px dla całej zawartości tabeli usług */
.s-manager-services-table * {
    font-size: 12px;
}

.s-manager-services-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.s-manager-services-table tbody tr.even {
    background-color: #fdfdfd;
}

.s-manager-services-table tbody tr.odd {
    background-color: white;
}

/* ===== KOLUMNY TABELI ===== */
.thumbnail-col {
    width: 140px;
    text-align: center;
}

.thumbnail-col img {
    max-width: 124px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
}

.thumbnail-col img.large {
    max-width: 280px;
    max-height: 157px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
}

.no-thumbnail {
    width: 124px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    color: #6c757d;
    margin: 0 auto;
}

.name-col {
    min-width: 200px;
    font-weight: 600;
}

.domain-col {
    min-width: 180px;
}

.domain-col a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.domain-col a:hover {
    text-decoration: underline;
    color: #005177;
}
