/**
 * Enhanced Phase Management CSS
 * Complete replacement for phases.css
 */

/* Phase Container */
.edvc-phases-container {
    background-color: var(--edvc-bg-navbar);
    border-bottom: 1px solid #e1e8ed;
	min-height: 36px;
    padding: 0;
    position: relative;
    z-index: 10;
	overflow: visible !important;
	justify-content: center;
	align-items: flex-end;
}

.edvc-phases-tabs {
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 0 1rem;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 32px; /* Reduziert von 44px */
}

.edvc-phases-tabs::-webkit-scrollbar {
    display: none;
}

/* Base Phase Tab Styling */
.edvc-phase-tab,
.edvc-add-phase-tab {
    position: relative;
    border: 1px solid #e1e8ed;
    border-bottom: none;
    border-radius: var(--edvc-border-radius) var(--edvc-border-radius) 0 0;
    padding: 0.4rem 1rem; /* Reduziert von 0.75rem */
    cursor: pointer;
    transition: var(--edvc-transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    height: 32px; /* Reduziert von 44px */
    box-sizing: border-box;
}

.edvc-phase-tab {
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--edvc-text-secondary);
    min-width: 120px;
    max-width: 200px;
}

.edvc-phase-tab:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--edvc-text-primary);
}

.edvc-phase-tab.active {
    background-color: white;
    color: var(--edvc-text-primary);
    border-bottom-color: white;
    margin-bottom: -1px;
    z-index: 2;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Phase Title */
.edvc-phase-title {
    flex: 1;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.edvc-phase-title:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.edvc-phase-tab.active .edvc-phase-title:hover {
    background-color: rgba(0, 124, 186, 0.1);
}

/* Phase Menu Button */
.edvc-phase-menu {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    transition: var(--edvc-transition);
    opacity: 0;
    position: relative;
    margin: -2px;
	pointer-events: auto;
	box-shadow: var(--edvc-shadow);
    z-index: 10;
}



.edvc-phase-tab:hover .edvc-phase-menu,
.edvc-phase-tab:focus-within .edvc-phase-menu {
    opacity: 1;
}

.edvc-phase-menu:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.edvc-phase-menu:focus {
    opacity: 1;
    outline: 2px solid var(--edvc-highlight);
    outline-offset: 2px;
}

/* Phase Dropdown Menu */
.edvc-phase-dropdown {
    position: fixed;
    background: white;
    border-radius: var(--edvc-border-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    width: auto; /* Automatische Breite basierend auf Inhalt */
    margin-top: -28px;
    transition: var(--edvc-transition);
}

.edvc-dropdown-item {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: calc(var(--edvc-border-radius) - 2px);
    cursor: pointer;
    transition: var(--edvc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.edvc-dropdown-item:hover:not(.disabled) {
    background-color: rgba(0, 124, 186, 0.1);
    color: var(--edvc-highlight);
}

.edvc-dropdown-item img {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.edvc-dropdown-item:hover:not(.disabled) img {
    opacity: 1;
}

.edvc-dropdown-delete {
    border-top: 1px solid #f3f4f6;
    padding-top: 0.75rem;
	transition: var(--edvc-transition);
	
}

.edvc-dropdown-delete:hover:not(.disabled) {
    background-color: var(--edvc-warning);
	border-radius: var(--edvc-border-radius);
}

.edvc-dropdown-delete:hover:not(.disabled) img {
    filter: brightness(0) invert(1);
}



.edvc-dropdown-delete.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Add Phase Tab */
.edvc-add-phase-tab {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid #e1e8ed;
    color: var(--edvc-text-secondary);
    min-width: 50px;
    max-width: 50px;
    justify-content: center;
    text-transform: none;
    font-weight: 700;
    font-size: 20px;
    padding: 0.5rem 0.75rem; /* Reduziert von 0.75rem */
}

.edvc-add-phase-tab:hover {
    background-color: rgba(0, 124, 186, 0.15);
    border-color: rgba(0, 124, 186, 0.3);
    color: #005f8a;
	cursor: pointer;
}

.edvc-add-phase-icon {
    transition: transform 0.2s ease;
    font-weight: 300;
    line-height: 1;
}

/* Disabled state for add tab when limit reached */
.edvc-add-phase-tab.disabled {
    background-color: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.edvc-add-phase-tab.disabled:hover {
    background-color: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    transform: none;
    box-shadow: none;
}

.edvc-add-phase-tab.disabled .edvc-add-phase-icon {
    transform: none;
}

/* Inline Rename Input */
.edvc-phase-rename-input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--edvc-text-primary);
    width: 100%;
    padding: 0;
    margin: 0;
    min-width: 100px;
    max-width: 180px;
}

.edvc-phase-rename-input:focus {
    background: transparent;
	border: none;
	padding: 2px;
}

/* Animations */
@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes phaseSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.edvc-phase-tab {
    animation: phaseSlideIn 0.3s ease-out;
}


/* ----- Phase Drag&Drop CSS ----- */
.edvc-phase-tab {
    cursor: grab;
    user-select: none;
}

.edvc-phase-tab:active {
    cursor: grabbing;
}

.edvc-phase-tab.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
}

.edvc-phases-tabs {
    position: relative;
}

.edvc-drop-indicator {
    position: absolute;
    width: 3px;
    height: 80%;
    background-color: var(--edvc-highlight);
    border-radius: 2px;
    top: 10%;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.edvc-drop-indicator.visible {
    opacity: 1;
}




/* ----- Mobile Responsiveness ----- */
@media (max-width: 768px) {
    .edvc-phases-tabs {
        padding: 0 0.5rem;
        gap: 1px;
    }
    
    .edvc-phase-tab {
        min-width: 100px;
        max-width: 150px;
        padding: 0.6rem 0.75rem;
        font-size: 11px;
    }
    
    .edvc-add-phase-tab {
        min-width: 40px;
        max-width: 40px;
        font-size: 18px;
        padding: 0.6rem 0.4rem;
    }
    
    .edvc-phase-dropdown {
        min-width: 120px;
        right: -10px;
    }
    
    .edvc-dropdown-item {
        padding: 0.6rem 0.8rem;
        font-size: 12px;
        gap: 0.5rem;
    }
    
    .edvc-dropdown-item img {
        width: 14px;
        height: 14px;
    }
    
    .edvc-phase-rename-input {
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .edvc-phase-tab {
        min-width: 80px;
        max-width: 120px;
        padding: 0.5rem 0.6rem;
        font-size: 10px;
        gap: 0.25rem;
    }
    
    .edvc-add-phase-tab {
        min-width: 35px;
        max-width: 35px;
        font-size: 16px;
        padding: 0.5rem 0.3rem;
    }
    
    .edvc-phase-menu {
        padding: 4px 6px;
        font-size: 14px;
    }
    
    .edvc-phase-dropdown {
        min-width: 100px;
        right: -15px;
    }
    
    .edvc-dropdown-item {
        padding: 0.5rem 0.6rem;
        font-size: 11px;
    }
    
    .edvc-dropdown-item img {
        width: 12px;
        height: 12px;
    }
}

/* High DPI Displays */
@media (min-width: 1920px) {
    .edvc-phase-tab {
        min-width: 150px;
        max-width: 250px;
        padding: 1rem 1.25rem;
        font-size: 13px;
    }
    
    .edvc-add-phase-tab {
        min-width: 60px;
        max-width: 60px;
        font-size: 22px;
        padding: 1rem 0.6rem;
    }
    
    .edvc-phase-dropdown {
        min-width: 160px;
    }
    
    .edvc-dropdown-item {
        padding: 0.8rem 1.2rem;
        font-size: 14px;
        gap: 1rem;
    }
    
    .edvc-dropdown-item img {
        width: 18px;
        height: 18px;
    }
    
    .edvc-phase-rename-input {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Focus and accessibility */
.edvc-phase-tab:focus-visible,
.edvc-add-phase-tab:focus-visible {
    outline: 2px solid var(--edvc-highlight);
    outline-offset: 2px;
}

.edvc-dropdown-item:focus-visible {
    outline: 2px solid var(--edvc-highlight);
    outline-offset: -2px;
}

/* Prevent text selection during interactions */
.edvc-phases-container * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.edvc-phase-rename-input {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}