/* Enhanced Tournament Search Controls */
.search-controls {
    margin: 20px 0 0 0;
    padding: 0 20px;
    width: calc(100% - 40px);
}

.search-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 20px;
}

.top-row {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.bottom-row {
    flex-wrap: wrap;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

/* Enhanced Date Div */
.date-div.enhanced {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #e0e0e0;
}

.date-option {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.date-option:hover {
    background: #e9ecef;
}

.date-option.selected {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.date-option h1 {
    margin: 0;
    font-size: 0.9em;
    font-weight: 500;
}

/* Event Type Toggle */
.event-type-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-type-toggle.centered {
    justify-content: center;
    width: 100%;
    margin-top: 15px;
}

.toggle-label {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 32px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #007bff; /* Blue for collegiate (default) */
    transition: 0.3s;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #28a745; /* Green for fundraiser when checked */
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(108px);
}

.toggle-text {
    font-size: 0.75em;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    z-index: 1;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

/* Text positioning based on dot position */
.toggle-text.fundraiser {
    right: 12px;
    text-align: right;
    color: white !important; /* White text for fundraiser */
}

.toggle-text.collegiate {
    left: 12px;
    text-align: left;
    color: white !important; /* White text for collegiate */
}

/* Show only the active text */
.toggle-switch input:not(:checked) + .toggle-slider .toggle-text.collegiate,
.toggle-switch input:checked + .toggle-slider .toggle-text.fundraiser {
    opacity: 0;
}

.toggle-switch input:not(:checked) + .toggle-slider .toggle-text.fundraiser,
.toggle-switch input:checked + .toggle-slider .toggle-text.collegiate {
    opacity: 1;
}

/* Per Page Selector */
.per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.per-page-label {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.per-page-select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.per-page-select:hover {
    border-color: #007bff;
}

.per-page-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    position: relative;
}

.pagination-btn:hover:not(:disabled) {
    background: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #f8f9fa;
    border-color: #e0e0e0;
    color: #ccc;
}

.pagination-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #f8f9fa;
    border-color: #e0e0e0;
    color: #ccc;
}

/* Arrow icons using CSS */
.pagination-btn::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-bottom: none;
    border-right: none;
    transform: rotate(-45deg);
    transition: all 0.3s ease;
}

.next-btn::before {
    transform: rotate(135deg);
}

.page-info {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

/* Create Tournament Link */
.create-tournament-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .top-row {
        flex-direction: column;
        justify-content: center;
    }
    
    .bottom-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pagination-controls {
        justify-content: center;
        order: 1;
    }
    
    .per-page-selector {
        justify-content: center;
        order: 2;
    }
    
    .event-type-toggle.centered {
        order: 3;
        margin-top: 10px;
    }
    
    .create-tournament-link {
        justify-content: center;
    }
    
    .date-div.enhanced {
        flex-direction: column;
    }
    
    .date-option {
        margin-bottom: 2px;
    }
    
    .toggle-switch {
        width: 120px;
        height: 28px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(88px);
    }
    
    .toggle-text {
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .search-controls {
        padding: 0 10px;
        width: calc(100% - 20px);
    }
    
    .pagination-btn {
        width: 36px;
        height: 36px;
    }
    
    .pagination-btn::before {
        width: 10px;
        height: 10px;
    }
    
    .page-info {
        font-size: 0.8em;
    }
    
    .toggle-switch {
        width: 110px;
        height: 28px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(78px);
    }
}
