/**
 * Champion Skill Order Widget Styles
 * 
 * Styles for the Elementor Champion Skill Order widget
 * 
 * @package ChampionGuideSystem
 */

/* Skill Order Widget Styles */

.champion-guide-skill-order h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.skill-order-explanation {
    line-height: 1.6;
    color: #c8c8d0;
    font-size: 15px;
}

.skill-order-explanation p {
    margin: 0 0 10px 0;
}

.skill-order-explanation p:last-child {
    margin-bottom: 0;
}

.skill-order-header {
    text-align: center;
}

.total-levels {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #0073aa;
}

/* Skill Order Rows Layout – [icon | title] | [skill 1 | skill 2 | ...] */
.skill-order-rows-container {
    overflow-x: auto;
    border-radius: 12px;
    padding: 0 10px;
    -webkit-overflow-scrolling: touch;
}

.skill-order-rows {
    --skill-cell-size: clamp(20px, 6vw, 36px);
    --row-gap: 8px;
    --levels-gap: 8px;
    display: flex;
    flex-direction: column;
    gap: var(--row-gap);
    min-width: min-content;
    padding-right: 1px;
}

/* One row: [ability cell] | [skill cells] */
.skill-order-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    min-height: var(--skill-cell-size);
    justify-content: space-between;
}

/* Left part: [icon | title] */
.ability-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: white;
    padding: 4px 0;
}

.ability-cell.passive-row {
    align-items: center;
}

.ability-icon-container {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ability-icon-container:hover {
    transform: scale(1.08);
    z-index: 10;
}

.ability-cell .ability-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.ability-cell .ability-icon:hover {
    filter: brightness(1.15);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.ability-cell .ability-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.ability-cell .ability-key {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ability-cell .ability-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e2e8f0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right part: [skill 1 | skill 2 | ...] */
.skill-order-levels {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--levels-gap);
    min-width: 66%;
    justify-content: space-between;
}

.skill-order-levels-passive {
    flex: 1;
}

.skill-order-levels-passive .skill-cell {
    width: 100%;
}

/* Quadratic skill cells */
.skill-cell.skill-cell-square {
    width: var(--skill-cell-size);
    height: var(--skill-cell-size);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border-radius: 8px;
}

.skill-cell.skill-cell-square:hover {
    transform: scale(1.08);
    z-index: 10;
}

.skill-cell.skill-cell-square:hover .skill-indicator {
    box-shadow: 0 4px 14px rgba(246, 59, 59, 0.45);
}

.skill-cell .skill-indicator {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.skill-cell.skilled .skill-indicator {
    background: #ef4444;
    color: #fff;
}

.skill-cell.not-skilled .skill-indicator {
    background: #251616
}

.skill-cell .level-number {
    line-height: 1;
}

/* Legacy styles for backward compatibility */
.skill-order-progression {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    max-width: 100%;
}

.skill-level-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: 2px solid #dc3545;
    border-radius: 8px;
    min-width: 50px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.skill-level-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.skill-level-item .ability-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
}

.skill-level-item .ability-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.skill-level-item .ability-key {
    font-size: 12px;
    font-weight: 700;
}

.ability-summary {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.ability-summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ability-summary-item:hover {
    border-color: #0073aa;
}

.ability-summary-item .ability-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.ability-summary-item .ability-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ability-summary-item .ability-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ability-summary-item .ability-key {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.ability-summary-item .ability-level {
    font-size: 10px;
    color: #666;
}

/* Passive ability styles */
.ability-cell.passive-row .ability-icon-container:hover {
    transform: none;
}

.ability-cell.passive-row .ability-icon:hover {
    filter: none;
    box-shadow: none;
}

.skill-order-levels-passive .skill-cell.passive-cell {
    aspect-ratio: auto !important;
    width: 100% !important;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    cursor: default;
    padding: 14px 16px !important;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
}

.skill-cell.passive-cell:hover {
    transform: none;
}

.skill-cell.skill-order-explanation-cell {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.skill-cell.skill-order-explanation-cell .skill-order-explanation {
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #c8c8d0;
    font-size: 14px;
    text-align: left;
}

.skill-cell.skill-order-explanation-cell .skill-order-explanation p {
    margin: 0 0 8px 0;
}

.skill-cell.skill-order-explanation-cell .skill-order-explanation p:last-child {
    margin-bottom: 0;
}

.passive-text {
    color: #8b5cf6;
    font-weight: 600;
    font-size: 12px;
}

.ability-summary-item.passive-summary-item {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.ability-summary-item.passive-summary-item:hover {
    border-color: #7c3aed;
    background: rgba(139, 92, 246, 0.1);
}

.ability-level.passive-level {
    color: #8b5cf6;
    font-weight: 600;
    font-size: 10px;
}


/* Tooltip Styles - jetzt in unified-tooltips.css */
/* Alle Tooltip-Styles wurden in die zentrale unified-tooltips.css verschoben */
/*
.skill-tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    padding: 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 380px;
    min-width: 280px;
    z-index: 999999;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, 
                visibility 0.2s ease,
                transform 0.2s ease;
    transform: translateY(-4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    left: -9999px;
    top: -9999px;
}

.skill-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.skill-tooltip.tooltip-below {
    transform: translateY(4px);
}

.skill-tooltip.tooltip-below.show {
    transform: translateY(0);
}

.skill-tooltip::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(15, 23, 42, 0.98);
}

.skill-tooltip.tooltip-below::after {
    top: auto;
    bottom: -6px;
    border-top: 6px solid rgba(15, 23, 42, 0.98);
    border-bottom: none;
}

/* Tooltip Header */
.skill-tooltip .tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-tooltip .tooltip-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    flex: 1;
}

.skill-tooltip .ability-key-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Tooltip Level Info (for level-specific tooltips) */
.skill-tooltip .tooltip-level-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.skill-tooltip .skill-level-badge,
.skill-tooltip .ability-level-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.skill-tooltip .skill-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

/* Tooltip Description */
.skill-tooltip .tooltip-description {
    margin: 0 0 12px 0;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Ability Stats */
.skill-tooltip .ability-stats {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-tooltip .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.skill-tooltip .stat-label {
    color: #94a3b8;
    font-weight: 600;
    flex-shrink: 0;
}

.skill-tooltip .stat-value {
    color: #ffffff;
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin-left: 12px;
}

*/

/* Warning message styles */
.champion-skill-order-warning {
    padding: 20px;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    text-align: center;
}

.champion-skill-order-warning p {
    margin: 0;
    font-size: 14px;
}

/* Desktop: 20 Level ohne Scroll – kleinere Zellen, kein overflow */
@media (min-width: 1024px) {
    .skill-order-rows-container {
        overflow-x: visible;
    }
    .skill-order-rows {
        --skill-cell-size: min(28px, (100vw - 280px) / 21);
        --levels-gap: 4px;
    }
}

/* Responsive adjustments for skill order rows */
@media (max-width: 768px) {
    .skill-order-rows {
        --skill-cell-size: clamp(32px, 10vw, 40px);
        --row-gap: 6px;
        --levels-gap: 6px;
    }
    
    .skill-order-row {
        gap: 12px;
    }
    
    .ability-cell .ability-key {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    
    .ability-cell .ability-name {
        font-size: 0.9rem;
    }
    
    .ability-summary {
        gap: 8px;
    }
    
    .ability-summary-item {
        padding: 6px 8px;
    }
    
    .ability-summary-item .ability-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .skill-order-rows {
        --skill-cell-size: 28px;
        --row-gap: 4px;
        --levels-gap: 4px;
    }
    
    .skill-order-row {
        gap: 8px;
    }
    
    .ability-cell .ability-key {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    .ability-cell .ability-name {
        font-size: 0.9rem;
    }
}

/* Elementor editor specific styles */
.elementor-editor .champion-guide-skill-order {
    pointer-events: none;
}

.elementor-editor .skill-level-item {
    cursor: default;
}

.elementor-editor .skill-level-item:hover {
    transform: none;
    box-shadow: none;
}
