/**
 * Frontend Styles for FIFA World Rankings
 */

.fifa-world-rankings-frontend {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.fifa-rankings-table-container {
    overflow-x: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fifa-rankings-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin: 0;
}

.fifa-rankings-table thead {
    background: #2271b1;
    color: #fff;
}

.fifa-rankings-table th,
.fifa-rankings-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.fifa-rankings-table th {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fifa-rankings-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.fifa-rankings-table tbody tr:hover {
    background: #e3f2fd;
}

/* Column specific styles */
.rank-col, .fifa-rankings-table .rank {
    text-align: center;
    width: 60px;
    font-weight: bold;
    color: #2271b1;
}

.flag-col, .fifa-rankings-table .flag {
    text-align: center;
    width: 50px;
}

.country-col, .fifa-rankings-table .country {
    min-width: 150px;
}

.country-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country-flag {
    border: 1px solid #ddd;
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: cover;
}

.country-text {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
}

.country-name {
    font-weight: 500;
    color: #1e1e1e;
    line-height: 1.2;
}

.country-code {
    color: #666;
    font-size: 0.9em;
    line-height: 1;
}

.points-col, .fifa-rankings-table .points {
    text-align: right;
    width: 80px;
    font-weight: 500;
    color: #2271b1;
}

.confederation-col, .fifa-rankings-table .confederation {
    width: 100px;
    font-size: 0.9em;
    color: #666;
}

/* Widget specific styles */
.fifa-world-rankings-widget {
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 10px 0;
}

.fifa-world-rankings-widget .fifa-rankings-table {
    font-size: 14px;
}

.fifa-world-rankings-widget .fifa-rankings-table th,
.fifa-world-rankings-widget .fifa-rankings-table td {
    padding: 8px 6px;
}

.fifa-world-rankings-widget .country-flag {
    width: 24px;
    height: 16px;
}

/* Meta information */
.fifa-rankings-meta {
    text-align: center;
    margin-top: 10px;
}

.fifa-rankings-last-update {
    margin: 0;
    color: #666;
    font-style: italic;
}

.fifa-rankings-no-data {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .fifa-rankings-table th,
    .fifa-rankings-table td {
        padding: 8px 4px;
        font-size: 14px;
    }
    
    .country-code {
        display: block;
        margin-left: 0;
        font-size: 0.8em;
    }
    
    .confederation-col,
    .fifa-rankings-table .confederation {
        display: none;
    }
}

@media (max-width: 480px) {
    .fifa-rankings-table th,
    .fifa-rankings-table td {
        padding: 6px 3px;
        font-size: 13px;
    }
    
    .points-col,
    .fifa-rankings-table .points {
        display: none;
    }
}

/* Search functionality */
.fifa-rankings-search-container {
    margin-bottom: 20px;
}

.fifa-rankings-search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.fifa-rankings-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.fifa-rankings-search-input::placeholder {
    color: #999;
    font-style: italic;
}

.fifa-no-results-message {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
    margin-top: 15px;
}

.fifa-no-results-message p {
    margin: 0;
    font-size: 16px;
}

/* Pagination styles */
.fifa-rankings-pagination {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid #ddd;
}

.fifa-load-more-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fifa-load-more-btn:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.fifa-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fifa-load-more-btn.loading {
    position: relative;
    color: transparent;
}

.fifa-load-more-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: fifa-spin 1s linear infinite;
}

@keyframes fifa-spin {
    to {
        transform: rotate(360deg);
    }
}

.fifa-pagination-info {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Button styles */
.fifa-world-rankings-button {
    background: #2271b1;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.fifa-world-rankings-button:hover {
    background: #135e96;
    color: #fff;
    text-decoration: none;
}