/* Teams panel */
.teams-panel {
    flex: 1;
    min-width: 300px;
    width: 100%;
}

.teams-panel label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary-text-color);
}

.teams-list {
    max-height: none;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    background-clip: padding-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 20px;
}

.teams-list::-webkit-scrollbar {
    display: none;
}

/* Team item */
.team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    height: 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.team-item:hover {
    background: var(--table-row-hover-color);
}

.team-name {
    font-weight: 500;
    color: var(--primary-text-color);
    flex: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-details {
    color: var(--secondary-text-color);
    font-size: 0.8rem;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-item:last-child {
    border-bottom: none;
}

/* Line numbers */
.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    width: 35px;
    height: 100%;
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
    text-align: right;
    padding: 8px 5px 8px 8px;
    font-size: 0.9rem;
    line-height: 20px;
    overflow-y: auto;
    user-select: none;
    z-index: 1;
    pointer-events: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.line-numbers::-webkit-scrollbar {
    display: none;
}

.line-number {
    display: block;
    height: 20px;
    line-height: 20px;
    color: transparent;
}

/* Draw results */
.draw-results {
    background: var(--first-layer-color);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.draw-results::-webkit-scrollbar {
    display: none;
}

#resultsContainer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#resultsContainer::-webkit-scrollbar {
    display: none;
}

.draw-results h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-primary);
}

.result-item {
    padding: 8px;
    background: white;
    border-radius: var(--radius-md);
    border-left: 3px solid #4f46e5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease-out;
    perspective: 1000px;
    overflow: hidden;
}

.pair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 0.95rem;
    position: relative;
    flex-wrap: nowrap;
}

.participant {
    background: linear-gradient(135deg, #a5b4fc 0%, #c7d2fe 100%);
    color: var(--primary-text-color);
    padding: 6px 4px;
    border-radius: var(--radius-md);
    min-width: 160px;
    flex-basis: 45%;
    flex-grow: 1;
    text-align: right;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(165, 180, 252, 0.3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: break-word;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
}

.arrow {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary-color);
  animation: arrowPulse 1.5s infinite ease-in-out;
  margin: 0 5px;
  --arrow-rotation: 0deg; /* default: sağa */
}

.team-info {
    background: linear-gradient(135deg, #6ee7b7 0%, #86efac 100%);
    color: var(--primary-text-color);
    padding: 6px 4px;
    border-radius: var(--radius-md);
    min-width: 160px;
    flex-basis: 45%;
    flex-grow: 1;
    text-align: left;
    box-shadow: 0 1px 3px rgba(110, 231, 183, 0.3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-left: 5px;
}

.team-info strong {
    display: block;
    font-size: 0.85rem;
    line-height: 1.2;
}

.team-info small {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.1;
}

/* Animations */
@keyframes arrowPulse {
  0%, 100% {
    transform: rotate(var(--arrow-rotation)) scale(1);
    opacity: 1;
  }
  50% {
    transform: rotate(var(--arrow-rotation)) scale(1.1);
    opacity: 0.7;
  }
}
#buttonSection .button-container {
    justify-content: center;
}

.filter-row.tall textarea {
    border-left: none;
}

@media (max-width: 768px) {
    #participantsSection {
        flex-direction: column;
        /* Filtre ve teams panel'i alt alta */
    }

    .teams-panel {
        min-width: 100%;
    }

    .teams-list {
        max-height: 200px;
    }

    .draw-results {
        padding: var(--space-sm);
    }

    .pair {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .participant,
    .team-info {
        min-width: 100%;
        text-align: center;
    }

  .arrow {
    --arrow-rotation: 90deg; /* mobilde aşağı */
  }

    #buttonSection .button-container {
        justify-content: center;
    }

    #buttonSection .primary-button {
        width: 100%;
        max-width: none;
        margin: 0 auto;
    }
}

@media (max-width: 576px) {
    :root {
        --font-size-base: 14px;
        /* Genel font küçült */
        --space-md: 12px;
        --space-lg: 16px;
    }

    .line-numbers {
        width: 25px;
        font-size: 0.8rem;
    }

    .team-item {
        font-size: 0.8rem;
    }

    .result-item {
        padding: var(--space-xs);
        min-height: 125px;
    }

    #buttonSection .button-container {
        justify-content: center;
    }

    #buttonSection .primary-button {
        width: 100%;
        max-width: none;
        margin: 0 auto;
    }
}