/* rugby-rankings.css */
/* Save this file as: wp-content/themes/your-theme/css/rugby-rankings.css */

/* Main widget container */
.rugby-rankings-widget {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Loading and error states */
.rankings-loading, .rankings-error {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    color: #666;
}

.rankings-error {
    background: #fee;
    color: #c66;
    border: 1px solid #fcc;
}

/* Titles */
.rankings-title {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 3px solid #27ae60;
    padding-bottom: 10px;
}

.rankings-section-title {
    margin: 15px 0 10px 0;
    color: #34495e;
    font-size: 1.2em;
}

/* Both genders container */
.rankings-both-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .rankings-both-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* TABLE LAYOUT */
.rankings-table-container {
    overflow-x: auto;
    margin-bottom: 15px;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.rankings-table th {
    background: #2c3e50;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.rankings-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
}

.rankings-table tr:hover {
    background: #f8f9fa;
}

.rankings-table tr:last-child td {
    border-bottom: none;
}

/* Position styling */
.ranking-position {
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    width: 50px;
}

.rankings-table tr:nth-child(-n+3) .ranking-position {
    color: #f39c12;
}

.rankings-table tr:first-child .ranking-position {
    color: #e74c3c;
}

/* Team info */
.team-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-flag {
    font-size: 1.2em;
}

.team-name {
    font-weight: 500;
    color: #2c3e50;
}

/* Points */
.ranking-points {
    font-weight: 600;
    color: #27ae60;
    text-align: center;
}

/* Change indicators */
.ranking-change {
    text-align: center;
    font-weight: bold;
}

.ranking-change.up {
    color: #27ae60;
}

.ranking-change.down {
    color: #e74c3c;
}

.ranking-change.same {
    color: #95a5a6;
}

.change-symbol {
    font-size: 1.1em;
    margin-right: 2px;
}

/* CARDS LAYOUT */
.rankings-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.ranking-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #27ae60;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-position {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.card-team {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.card-team .team-name {
    font-size: 1.1em;
}

.card-points {
    color: #27ae60;
    font-weight: 600;
    margin-bottom: 5px;
}

.card-change {
    font-weight: bold;
    font-size: 0.9em;
}

/* COMPACT LAYOUT */
.rankings-compact {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.compact-team {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
}

.compact-position {
    font-weight: bold;
    color: #2c3e50;
    min-width: 20px;
}

.compact-name {
    font-weight: 500;
}

.compact-points {
    color: #27ae60;
    font-size: 0.9em;
}

.compact-separator {
    color: #bdc3c7;
    margin: 0 5px;
}

/* Footer */
.rankings-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #7f8c8d;
}

.rankings-source {
    font-weight: 500;
    margin: 0;
}

.rankings-updated {
    margin: 0;
    font-style: italic;
}

@media (max-width: 600px) {
    .rankings-footer {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rankings-table th,
    .rankings-table td {
        padding: 8px 6px;
        font-size: 0.9em;
    }
    
    .team-flag {
        font-size: 1em;
    }
    
    .rankings-cards {
        grid-template-columns: 1fr;
    }
}

/* Animation for loading */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.rankings-loading {
    animation: pulse 1.5s infinite;
}