/**
 * SIMR GT7 Stats - Gran Turismo Style
 * Dark theme matching gran-turismo.com profile aesthetics
 */

/* Container */
.gt7-stats-container {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 30px;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
.gt7-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.gt7-psn-id {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.gt7-country {
    margin-left: 10px;
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gt7-updated {
    font-size: 0.75rem;
    color: #666;
}

.gt7-refresh-btn {
    background: #2d5aa0;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 10px;
    transition: background 0.2s;
}

.gt7-refresh-btn:hover {
    background: #3a6bc7;
}

.gt7-refresh-btn:disabled {
    background: #444;
    cursor: not-allowed;
}

/* Rating Cards */
.gt7-ratings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.gt7-card {
    background: #16213e;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.gt7-card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 15px;
}

/* Rating Badges */
.gt7-rating-badge {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    display: inline-block;
    padding: 8px 20px;
    border-radius: 8px;
    min-width: 80px;
}

/* DR Colors - matching GT7 aesthetic */
.gt7-dr-s    { background: linear-gradient(135deg, #ff6b00, #ff9500); color: #fff; }
.gt7-dr-aplus { background: linear-gradient(135deg, #e81c4f, #ff4777); color: #fff; }
.gt7-dr-a    { background: linear-gradient(135deg, #e81c4f, #ff2d5e); color: #fff; }
.gt7-dr-b    { background: linear-gradient(135deg, #2d7dd2, #4a9eff); color: #fff; }
.gt7-dr-c    { background: linear-gradient(135deg, #27ae60, #4cd964); color: #fff; }
.gt7-dr-d    { background: linear-gradient(135deg, #7f8c8d, #95a5a6); color: #fff; }
.gt7-dr-e    { background: linear-gradient(135deg, #555, #777); color: #fff; }

/* SR Colors */
.gt7-sr-s    { background: linear-gradient(135deg, #f1c40f, #f39c12); color: #1a1a2e; }
.gt7-sr-a    { background: linear-gradient(135deg, #27ae60, #2ecc71); color: #fff; }
.gt7-sr-b    { background: linear-gradient(135deg, #2d7dd2, #3498db); color: #fff; }
.gt7-sr-c    { background: linear-gradient(135deg, #e67e22, #f39c12); color: #fff; }
.gt7-sr-d    { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; }
.gt7-sr-e    { background: linear-gradient(135deg, #555, #777); color: #fff; }

/* Progress Bars (generic) */
.gt7-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.gt7-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.gt7-dr-fill {
    background: linear-gradient(90deg, #e81c4f, #ff4777);
}

.gt7-sr-fill {
    background: linear-gradient(90deg, #f1c40f, #27ae60);
}

/* Points Display */
.gt7-points {
    margin-top: 5px;
}

.gt7-points-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.gt7-points-label {
    font-size: 0.7rem;
    color: #666;
    margin-left: 5px;
    text-transform: uppercase;
}

/* =============================================
   DR Progress Bar (rank progress within tier)
   ============================================= */
.gt7-dr-points {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.gt7-progress-container {
    width: 100%;
    margin-top: 12px;
}

.gt7-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.gt7-progress-current {
    color: #ccc;
}

.gt7-progress-next {
    color: #ccc;
}

.gt7-progress-info {
    text-align: center;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #aaa;
}

.gt7-progress-info strong {
    color: #fff;
    font-weight: 700;
}

/* Stats Grid */
.gt7-stats-grid,
.gt7-sport-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.gt7-stat-item {
    background: #16213e;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.gt7-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.gt7-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

/* Section Title */
.gt7-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Recent Races */
.gt7-recent-races {
    margin-bottom: 30px;
}

.gt7-races-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gt7-race-item {
    display: flex;
    align-items: center;
    background: #16213e;
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid rgba(255,255,255,0.05);
}

.gt7-race-position {
    font-weight: 800;
    font-size: 1rem;
    min-width: 45px;
    text-align: center;
}

.gt7-pos-podium {
    color: #f1c40f;
}

.gt7-pos-normal {
    color: #aaa;
}

.gt7-race-info {
    flex: 1;
    margin-left: 15px;
    display: flex;
    flex-direction: column;
}

.gt7-race-track {
    font-size: 0.9rem;
    color: #ddd;
}

.gt7-race-date {
    font-size: 0.7rem;
    color: #666;
}

.gt7-race-dr-change {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
}

.gt7-race-dr-change.positive { color: #27ae60; }
.gt7-race-dr-change.negative { color: #e74c3c; }

/* No Link / Pending Messages */
.gt7-no-link,
.gt7-pending {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    color: #e0e0e0;
    max-width: 600px;
    margin: 0 auto;
}

.gt7-no-link-icon,
.gt7-pending-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.gt7-no-link h3,
.gt7-pending h3 {
    color: #fff;
    margin-bottom: 10px;
}

.gt7-no-link p,
.gt7-pending p {
    color: #888;
    line-height: 1.6;
}

.gt7-help a {
    color: #4a9eff;
    text-decoration: none;
}

.gt7-help a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .gt7-stats-container {
        padding: 15px;
    }
    
    .gt7-ratings {
        grid-template-columns: 1fr;
    }
    
    .gt7-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gt7-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .gt7-rating-badge {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .gt7-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .gt7-stat-item {
        padding: 12px;
    }
    
    .gt7-stat-value {
        font-size: 1.1rem;
    }
}

/* Self-serve linking form & confirmation */
.gt7-linked-confirmation {
    background: #1b3d1b;
    border: 1px solid #2e7d32;
    border-radius: 8px;
    padding: 12px 16px;
    color: #a5d6a7;
    font-size: 14px;
    margin-bottom: 16px;
}
.gt7-check { color: #4caf50; font-weight: bold; font-size: 16px; }
.gt7-relink { font-size: 12px; opacity: 0.6; margin-left: 12px; color: #90caf9; }
.gt7-resolve-form { text-align: center; padding: 20px; }
.gt7-hint { font-size: 12px; opacity: 0.7; margin-bottom: 12px; }
.gt7-hint a { color: #90caf9; }
.gt7-btn {
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    margin-top: 8px;
    font-size: 14px;
}
.gt7-btn:hover { background: #1976d2; }
