/* Tennis Manager Frontend Styles */

.tm-ranking-wrapper {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Search Box */
.tm-search-box {
    position: relative;
    margin-bottom: 20px;
    max-width: 400px;
}

.tm-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.tm-search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.tm-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

/* Table Container */
.tm-table-container {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Table Styles */
.tm-ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 800px;
}

.tm-ranking-table thead {
    background: #4CAF50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tm-ranking-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #45a049;
    white-space: nowrap;
}

.tm-ranking-table th.tm-col-stt {
    text-align: center;
    width: 60px;
}

.tm-ranking-table th.tm-col-gender,
.tm-ranking-table th.tm-col-min,
.tm-ranking-table th.tm-col-max {
    text-align: center;
}

.tm-ranking-table th.tm-col-phone {
    width: 130px;
}

.tm-ranking-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.tm-ranking-table tbody tr:hover {
    background-color: #f5f5f5;
}

.tm-ranking-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.tm-ranking-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

.tm-ranking-table td {
    padding: 12px;
    font-size: 14px;
    color: #333;
}

.tm-ranking-table td.tm-col-stt {
    text-align: center;
    font-weight: 600;
    color: #666;
}

.tm-ranking-table td.tm-col-name strong {
    color: #2c3e50;
}

.tm-ranking-table td.tm-col-gender,
.tm-ranking-table td.tm-col-min,
.tm-ranking-table td.tm-col-max {
    text-align: center;
}

.tm-ranking-table td.tm-col-max strong {
    color: #FF9800;
    font-size: 15px;
}

/* Highlight effect for search */
.tm-player-row.tm-highlight {
    background-color: #fffacd !important;
    animation: highlight-fade 2s ease;
}

@keyframes highlight-fade {
    0% { background-color: #ffeb3b; }
    100% { background-color: #fffacd; }
}

/* No results message */
.tm-no-search-results {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.tm-no-search-results p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.tm-search-term {
    font-weight: 600;
    color: #4CAF50;
}

/* Hidden rows during search */
.tm-player-row.tm-hidden {
    display: none;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .tm-search-box {
        max-width: 100%;
    }
    
    .tm-search-input {
        font-size: 14px;
        padding: 10px 40px 10px 12px;
    }
    
    .tm-ranking-table {
        font-size: 12px;
    }
    
    .tm-ranking-table th,
    .tm-ranking-table td {
        padding: 8px 6px;
    }
    
    .tm-ranking-table th {
        font-size: 12px;
    }
    
    /* Hide some columns on mobile */
    .tm-col-min,
    .tm-col-ranking {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .tm-ranking-table {
        min-width: 100%;
    }
    
    /* Show only essential columns on very small screens */
    .tm-col-phone {
        display: none;
    }
}

/* Print Styles */
@media print {
    .tm-search-box {
        display: none;
    }
    
    .tm-ranking-table {
        box-shadow: none;
    }
    
    .tm-ranking-table tbody tr:hover {
        background-color: transparent;
    }
}

/* Loading state */
.tm-ranking-wrapper.tm-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom scrollbar for table container */
.tm-table-container::-webkit-scrollbar {
    height: 8px;
}

.tm-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tm-table-container::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 4px;
}

.tm-table-container::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Empty state */
.tm-no-results td {
    color: #999 !important;
    font-style: italic;
}

/* Ranking badges (optional enhancement) */
.tm-col-stt .tm-rank-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    font-weight: bold;
}

.tm-player-row:nth-child(1) .tm-rank-badge {
    background: #FFD700;
    color: #fff;
}

.tm-player-row:nth-child(2) .tm-rank-badge {
    background: #C0C0C0;
    color: #fff;
}

.tm-player-row:nth-child(3) .tm-rank-badge {
    background: #CD7F32;
    color: #fff;
}
