/**
 * Telemedicine Provider Table Styles
 * 
 * @package Telemedicine
 * @since 2.0.0
 */

/* ==========================================================================
   Variables & Root
   ========================================================================== */

:root {
    
	/* GENERAL-COLORS */
	--tm-color-primary: #2ed131;
    --tm-color-secondary: #ff7c38;
    --tm-color-danger: #ea4e5c;
    --tm-color-warning: #f59e0b;
    --tm-color-info: #3b82f6;
    
	/* BG-COLORS */
	--tm-bg-primary: #ffffff;
    --tm-bg-secondary: #f5f5f5;
	--tm-bg-alt-primary: #000000;
    --tm-bg-alt-secondary: #222222;
	--tm-bg-hover: #f3f4f6;
    
	/* TEXT-COLORS */
    --tm-text-headline: #222222;
	--tm-text-text: #353531;
    --tm-text-faded: #6a6a6a;
	--tm-text-alt-headline: #ffffff;
	--tm-text-alt-text: #ffffff;
    --tm-text-alt-faded: #9c9c9c;
	
	/* ICON-COLORS */
	--tm-icon-succes: #56ac14;
	--tm-icon-error: #ee5c69;
	--tm-icon-undefined: #b9b9b9;
	
	/* BORDER DESIGN */
    --tm-border-color: #e9e9e9;
	--tm-border-alt-color: #000000;
	--tm-border-radius-s: 0.5rem;
    --tm-border-radius-m: 0.4rem;
	--tm-border-radius-l: 1.2rem;
	--tm-border-radius-xl: 4rem;
	
    /* SHADOW DESIGN */
    --tm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --tm-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --tm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
	 /* TRANSITIONS */
    --tm-transition: all 0.3s ease;
}

/* ==========================================================================
   Table Wrapper & Toggle
   ========================================================================== */

.tm-table-wrapper {
    width: 100%;
    margin: 2rem 0;
	padding: 2rem;
	padding-right: 0;
    position: relative;
	background: var(--tm-bg-primary);
	border-radius: var(--tm-border-radius-l);
    border: 1px solid var(--tm-border-color);
}

.tm-toggle-buttons {
    display: flex;
	max-width: 360px;
    width: 100%;
    gap: 0.75rem;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
	padding: 0.5rem;
    background: var(--tm-bg-primary);
    border-radius: var(--tm-border-radius-xl);
    border: 1px solid var(--tm-border-color);
}

.tm-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border-radius: var(--tm-border-radius-xl);
    font-size: .8rem;
    font-weight: 400;
    color: var(--tm-text-faded);
    cursor: pointer;
    transition: var(--tm-transition);
}

.tm-toggle-btn:hover {
    background: var(--tm-bg-alt-primary);
    color: var(--tm-text-alt-text);
}

.tm-toggle-btn.active {
    background: var(--tm-bg-alt-primary);
    color: var(--tm-text-alt-text);
}

/* ==========================================================================
   Table Scroll Container
   ========================================================================== */

.tm-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
	padding-bottom: 2rem;
}

/* Custom scrollbar */
.tm-table-scroll::-webkit-scrollbar {
    height: 5px;
	padding: .5rem 0;
}

.tm-table-scroll::-webkit-scrollbar-track {
    background: var(--tm-bg-secondary);
    border-radius: var(--tm-border-radius-xl);
}

.tm-table-scroll::-webkit-scrollbar-thumb {
	background: var(--tm-text-faded);
    border-radius: var(--tm-border-radius-xl);
}

.tm-table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--tm-text-faded);
}

/* ==========================================================================
   Table Structure
   ========================================================================== */

.tm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 15px 0;
	margin-left: -15px;
    font-size: 0.7rem;
    line-height: 1.2;
}

/* Table Header */
.tm-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--tm-bg-primary);
}

.tm-table th {
	height: 40px;
    padding: .25rem;
    text-align: center;
    font-weight: 400;
    color: var(--tm-text-faded);
    background: var(--tm-bg-primary);
    vertical-align: middle;
}

.tm-col-label {
    width: 200px;
	min-width: 200px;
	max-width: 200px;
    text-align: left !important;
    position: sticky;
    left: 0;
    z-index: 11;
    background: var(--tm-bg-primary);
	border-bottom: none;
}

.tm-table-top:has(.tm-col-provider:nth-of-type(2):last-of-type) .tm-col-provider {
	width: 100%;
	min-width: 100%;
	max-width: 100%;
}

.tm-table-top:has(.tm-col-provider:nth-of-type(3):last-of-type) .tm-col-provider {
  	width: 50%;
	min-width: 50%;
	max-width: 50%;
}

.tm-table-top:has(.tm-col-provider:nth-of-type(4):last-of-type) .tm-col-provider {
	width: 33.3333%;
	min-width: 33.3333%;
	max-width: 33.3333%;
}

.tm-table-top:has(.tm-col-provider:nth-of-type(5):last-of-type) .tm-col-provider {
  	width: 25%;
	min-width: 25%;
	max-width: 25%;
}

.tm-table-all .tm-col-provider {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
}

.tm-table-top .tm-col-provider,
.tm-table-all .tm-col-provider{
	position: relative;
    overflow: hidden;
	border: 1px solid var(--tm-border-color);
	border-bottom: none;
	border-top-left-radius: var(--tm-border-radius-l);
    border-top-right-radius: var(--tm-border-radius-l);
	background: var(--tm-bg-secondary);
}

/* Table Body */
.tm-table tbody tr {
    transition: background-color 0.2s ease;
}

.tm-table tbody tr:nth-last-of-type(2) th,
.tm-table tbody tr:nth-last-of-type(2) td{
	border-bottom: none;
}

.tm-table tbody tr:last-child th{
	border-bottom: none;
}

.tm-table tbody tr:hover {
    background: var(--tm-bg-hover);
}

.tm-table td {
	height: 40px;
    padding: 0.25rem .5rem;
    text-align: center;
    vertical-align: middle;
    color: var(--tm-text-text);
	border-left: 1px solid var(--tm-border-color);
	border-right: 1px solid var(--tm-border-color);
}

.tm-row-label {
    text-align: left !important;
    font-weight: 400;
    background: var(--tm-bg-primary)!important;
    position: sticky;
    left: 0;
    z-index: 9;
    border-right: none;
}

/* ==========================================================================
   Provider Header
   ========================================================================== */

.tm-provider-header {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-badge {
    position: absolute;
    top: -.25rem;
    left: -0.25rem;
    z-index: 1;
    background-color: var(--tm-color-warning);
    font-weight: 600;
    font-size: 0.7rem;
    line-height: 1.2;
    color: var(--tm-text-alt-headline);
    text-align: center;
    padding: .5rem 1.5rem .25rem 2rem;
    white-space: nowrap;
	border-bottom-right-radius: 1.2rem;
}

.tm-provider-logo {
    width: 100%;
    max-width: 150px;
}

.tm-provider-logo a {
    display: block;
    text-decoration: none;
}

.tm-provider-logo img {
    width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.tm-provider-logo img:hover {
    transform: scale(1.05);
}

.tm-provider-link {
    color: var(--tm-text-text);
    text-decoration: underline;
}

/* ==========================================================================
   Icons, Payment & Values
   ========================================================================== */

.tm-icon {
    font-size: 1rem;
    display: inline-block;
}

.tm-icon-yes {
    color: var(--tm-icon-succes);
}

.tm-icon-no {
    color: var(--tm-icon-error);
}

.tm-icon-undefined {
    color: var(--tm-icon-undefined);
}

.tm-no-data {
    color: var(--tm-text-faded);
}

.payment-icons {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
}

.payment-icons img {
	height: 18px;
	width: auto;
	object-fit: contain;
}

/* ==========================================================================
   Buttons & Actions
   ========================================================================== */

.tm-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.tm-cell-actions{
	background: var(--tm-bg-secondary);
	border-bottom-left-radius: var(--tm-border-radius-l);
    border-bottom-right-radius: var(--tm-border-radius-l);
}

.tm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 2px solid transparent;
    border-radius: var(--tm-border-radius-xl);
    font-size: 0.7rem;
    font-weight: 400;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--tm-transition);
    white-space: nowrap;
}

.tm-btn-primary {
    background: var(--tm-color-primary);
    color: var(--tm-text-alt-headline);
}

.tm-btn-primary:hover {
    background: var(--tm-color-secondary);
    transform: translateY(-2px);
}

.tm-btn-secondary {
    background: var(--tm-bg-alt-primary);
    color: var(--tm-text-alt-headline);
    border-color: var(--tm-bg-alt-primary);
}

.tm-btn-secondary:hover {
    background: var(--tm-color-primary);
    border-color: var(--tm-color-primary);
	color: var(--tm-text-alt-headline)!important;
}

.tm-show-code {
	border: 1px dashed var(--tm-border-alt-color);
    padding: .25em 1em;
    border-radius: var(--tm-border-radius-xl);
    background: none;
	transition: color 0.2s ease;
}

.tm-show-code:hover {
	background: var(--tm-bg-alt-primary);
    color: var(--tm-text-alt-headline);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.tm-table:focus-within {
    outline: 1px solid var(--tm-color-primary);
    outline-offset: 1px;
}

.tm-btn:focus-visible,
.tm-toggle-btn:focus-visible {
    outline: 1px solid var(--tm-color-primary);
    outline-offset: 1px;
}

/* Screen reader only */
.tm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.tm-no-providers,
.tm-error {
    padding: 2rem;
    text-align: center;
    color: var(--tm-text-faded);
    font-style: italic;
}

.tm-error {
    color: var(--tm-color-danger);
}

/* ==========================================================================
   Animations
   ========================================================================== */

.tm-table-container {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Badge für "weitere Krankheiten"
   ========================================================================== */

.tm-diseases .tm-diseases-inner{
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: .5rem;
	width: fit-content;
    margin: 0 auto;
}

.tm-badge-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0;
    background: var(--tm-bg-alt-secondary);
    color: var(--tm-text-alt-headline);
    font-size: 0.6rem;
    font-weight: 400;
    border-radius: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.25rem;
    vertical-align: middle;
}

/* ==========================================================================
   Tooltip
   ========================================================================== */

.tm-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
	transform: translateX(20px) translateY(-1rem);
    padding: .5rem;
    background: var(--tm-bg-alt-secondary);
    color: var(--tm-text-alt-headline);
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: var(--tm-border-radius-m);
    white-space: normal;
    z-index: 1000;
    box-shadow: var(--tm-shadow-lg);
    pointer-events: none;
    max-width: 200px;
}

/* Tooltip arrow */
.tm-tooltip::before {
	content: '';
	position: absolute;
	top: 95%;
	right: 20px;
	border: 0.5rem solid transparent;
	border-top-color: var(--tm-bg-alt-secondary);
	transform: none;
}

/* Parent cell needs relative positioning */
.tm-cell {
    position: relative;
}

/* Show tooltip */
.tm-tooltip.show {
    display: block !important;
    animation: tooltipFadeIn 0.2s ease;
}

/* Tooltip fade in animation */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px) translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateX(20px) translateY(-1rem);
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
	.tm-col-provider {
		width: 300px!important;
		min-width: 300px!important;
		max-width: 300px!important;
    }
}

@media (max-width: 768px) {
    .tm-col-provider {
		width: 260px!important;
		min-width: 260px!important;
		max-width: 260px!important;
    }
}

@media (max-width: 600px) {
	.tm-table-wrapper{
		padding: 2rem 0 2rem .5rem;
		border-radius: 0;
	}
	
	.tm-table {
		border-spacing: 10px 0;
        font-size: 0.7rem;
    }
	
	.tm-col-label,
    .tm-row-label {
        width: 90px;
		min-width: 90px;
		max-width: 90px;
		hyphens: auto;
    }
	
	.tm-provider-header {
        min-height: 80px;
    }
    
    .tm-provider-logo {
        max-width: 120px;
    }
    
    .tm-provider-logo img {
        max-height: 60px;
    }
}