/**
 * NHL-Tipset Profile Styles
 * CSS-stilar för profil-modal och alla komponenter
 * Version: Uppdaterad med subtila färgaccenter och textskuggor
 * Fil: assets/css/profile-styles.css
 */

/* === MODAL GRUNDLÄGGANDE === */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.profile-loading {
    background: white;
    padding: 30px;
    border-radius: 8px;
    font-family: verdana;
    font-size: 14px;
}

.profile-error {
    background: white;
    padding: 30px;
    border-radius: 8px;
    color: #d32f2f;
    font-family: verdana;
    font-size: 14px;
}

.profile-modal-content {
    background: white;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* === MODAL HEADER === */
.profile-modal-header {
    background: linear-gradient(135deg, #B5C8D0 0%, #A0B2C0 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #8A9CAA;
}

.profile-modal-title {
    font-size: 18px;
    font-weight: bold;
    font-family: verdana;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.profile-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.profile-close-btn:hover {
    opacity: 1;
}

/* === PROFIL HEADER SEKTION === */
.profile-header-section {
    background: linear-gradient(135deg, #E6F2F5 0%, #D4E8ED 100%);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 25px;
    border-bottom: 1px solid #C4D6DE;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #B5C8D0 0%, #A0B2C0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: white;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-family: verdana;
    font-size: 24px;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.profile-meta {
    display: flex;
    gap: 25px;
    font-family: verdana;
    font-size: 11px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
}

.meta-value {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-top: 3px;
}

/* === MEDALJ-STRIP === */
.profile-medal-strip {
    background: #F8F9FA;
    padding: 15px;
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid #E3EBEF;
}

.medal-item {
    text-align: center;
    font-family: verdana;
}

.medal-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.medal-count {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.medal-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    margin-top: 2px;
}

/* === TABS === */
.profile-tabs {
    background: #E3EBEF;
    display: flex;
    border-bottom: 2px solid #B5C8D0;
}

.profile-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-family: verdana;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.profile-tab:hover {
    background: #D4E8ED;
    color: #333;
}

.profile-tab.active {
    background: white;
    color: #2c3e50;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #B5C8D0;
}

/* === TAB INNEHÅLL === */
.profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    background: white;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* === ÖVERSIKT TAB - UPPDATERAD MED SUBTILA FÄRGACCENTER === */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.profile-stat-card {
    background: linear-gradient(135deg, #E6F2F5 0%, #D4E8ED 100%);
    border: 1px solid #C4D6DE;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: visible;
}

/* Enhetlig blå gradient på toppen - samma för alla kort */
.profile-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #A0B2C0 0%, #B5C8D0 50%, #A0B2C0 100%);
    border-radius: 6px 6px 0 0;
    opacity: 0.8;
}

.profile-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(181, 200, 208, 0.3);
}

/* Textskuggor för djup */
.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    font-family: verdana;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-label {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    text-transform: uppercase;
    font-family: verdana;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.9);
}

.stat-detail {
    font-size: 10px;
    color: #999;
    margin-top: 3px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* === GRAFER === */
.profile-chart-container {
    background: #F8F9FA;
    border: 1px solid #C4D6DE;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.profile-chart-container h3 {
    font-family: verdana;
    font-size: 14px;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #C4D6DE;
}

.profile-chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* === HISTORIK TAB === */
.profile-history-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: verdana;
    font-size: 12px;
    margin-top: 15px;
}

.profile-history-table th {
    background: linear-gradient(135deg, #B5C8D0 0%, #A0B2C0 100%);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.profile-history-table td {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}

.profile-history-table tr:nth-child(even) {
    background-color: #F8F9FA;
}

.profile-history-table tr:hover {
    background-color: #E8F4F8;
}

.position-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B4513;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.position-silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.position-bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* === STATISTIK TAB === */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.quick-stat-card {
    background: linear-gradient(135deg, #E6F2F5 0%, #D4E8ED 100%);
    border: 1px solid #B5C8D0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(181, 200, 208, 0.3);
}

.quick-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8A9CAA 0%, #A0B2C0 50%, #8A9CAA 100%);
    border-radius: 10px 10px 0 0;
    opacity: 0.9;
}

.quick-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(181, 200, 208, 0.5);
}

.quick-stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.08);
}

.quick-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.9);
}

.stats-section-title {
    font-size: 16px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 2px solid #B5C8D0;
    font-family: verdana;
}

/* === RUND-TRÄFFSÄKERHET === */
.round-accuracy-section {
    background: #F8F9FA;
    border: 1px solid #E3EBEF;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.round-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.round-card {
    background: white;
    border: 1px solid #C4D6DE;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(181, 200, 208, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.round-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(181, 200, 208, 0.4);
    border-color: #B5C8D0;
}

.round-card-header {
    text-align: center;
    margin-bottom: 15px;
}

.round-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 13px;
}

.accuracy-circle {
    width: 70px;
    height: 70px;
    margin: 0 auto 12px;
    position: relative;
}

.accuracy-circle svg {
    transform: rotate(-90deg);
}

.accuracy-circle-bg {
    fill: none;
    stroke: #E3EBEF;
    stroke-width: 6;
}

.accuracy-circle-progress {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.accuracy-high { stroke: #4CAF50; }
.accuracy-medium { stroke: #FF9800; }
.accuracy-low { stroke: #f44336; }

.accuracy-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.round-details {
    text-align: center;
    font-size: 11px;
    color: #666;
}

/* === PERSONLIGA REKORD === */
.personal-records-section {
    margin-bottom: 30px;
}

.records-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.record-card {
    background: linear-gradient(135deg, #B5C8D0 0%, #A0B2C0 100%);
    border-radius: 10px;
    padding: 18px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    text-align: center;
    box-shadow: 0 3px 8px rgba(181, 200, 208, 0.4);
}

.record-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 15px rgba(181, 200, 208, 0.6);
}

.record-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.record-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.record-label {
    font-size: 11px;
    opacity: 0.95;
}

.record-detail {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 4px;
    font-style: italic;
}

/* === JÄMFÖRELSE SEKTION === */
.comparison-section {
    background: #F8F9FA;
    border: 1px solid #E3EBEF;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.comparison-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.comparison-card {
    background: white;
    border: 1px solid #C4D6DE;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(181, 200, 208, 0.2);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.comparison-title {
    font-weight: bold;
    color: #2c3e50;
    font-size: 13px;
}

.comparison-icon {
    font-size: 20px;
}

.comparison-visual {
    position: relative;
    height: 35px;
    background: #E3EBEF;
    border-radius: 20px;
    margin-bottom: 12px;
    overflow: hidden;
}

.comparison-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #B5C8D0 0%, #95A8B6 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    transition: width 1.5s ease;
}

.comparison-bar.above {
    background: linear-gradient(90deg, #4CAF50 0%, #81C784 100%);
}

.comparison-bar.below {
    background: linear-gradient(90deg, #f44336 0%, #ef9a9a 100%);
}

.bar-value {
    color: white;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.comparison-average {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: #333;
    z-index: 2;
}

.average-label {
    position: absolute;
    top: -18px;
    transform: translateX(-50%);
    font-size: 10px;
    color: #666;
    white-space: nowrap;
}

.comparison-footer {
    text-align: center;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 4px;
}

.comparison-footer.above {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.comparison-footer.below {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* === DETALJERAD STATISTIK === */
.detailed-stats {
    background: white;
    border: 1px solid #C4D6DE;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(181, 200, 208, 0.2);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-family: verdana;
}

.stats-table th {
    background: linear-gradient(135deg, #E6F2F5 0%, #D4E8ED 100%);
    padding: 10px;
    text-align: left;
    font-size: 11px;
    color: #2c3e50;
    text-transform: uppercase;
    border: 1px solid #C4D6DE;
    font-weight: bold;
}

.stats-table td {
    padding: 10px;
    border: 1px solid #E3EBEF;
    font-size: 12px;
    color: #333;
}

.stats-table tr:hover {
    background: #F8F9FA;
}

.stat-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
}

.stat-badge.high {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.stat-badge.medium {
    background: #FFF3E0;
    color: #F57C00;
    border: 1px solid #FFE0B2;
}

.stat-badge.low {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* === ACHIEVEMENTS TAB === */
.profile-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.profile-achievement {
    background: #F8F9FA;
    border: 2px solid #E3EBEF;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s;
    font-family: verdana;
}

.profile-achievement.unlocked {
    background: linear-gradient(135deg, #E6F2F5 0%, #D4E8ED 100%);
    border-color: #B5C8D0;
}

.profile-achievement.unlocked:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(181, 200, 208, 0.3);
}

.profile-achievement.locked {
    opacity: 0.5;
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.achievement-title {
    font-size: 11px;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.achievement-desc {
    font-size: 10px;
    color: #666;
}

.achievement-progress {
    font-size: 10px;
    color: #B5C8D0;
    font-weight: bold;
    margin-top: 5px;
}

.profile-achievement-summary {
    background: #F8F9FA;
    border: 1px solid #C4D6DE;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
    font-family: verdana;
}

.achievement-progress-bar {
    width: 100%;
    height: 20px;
    background: #E3EBEF;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #B5C8D0 0%, #A0B2C0 100%);
    transition: width 0.3s ease;
}

/* === MODAL FOOTER === */
.profile-modal-footer {
    background: #F8F9FA;
    padding: 15px 25px;
    border-top: 1px solid #C4D6DE;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.profile-btn {
    padding: 8px 16px;
    background: #B5C8D0;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: verdana;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-btn:hover {
    background: #A0B2C0;
}

.profile-btn-close {
    background: #999;
}

.profile-btn-close:hover {
    background: #777;
}

/* === RESPONSIV DESIGN === */
@media (max-width: 768px) {
    .profile-modal-content {
        width: 95%;
    }
    
    .profile-header-section {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .profile-meta {
        justify-content: center;
        gap: 15px;
    }
    
    .profile-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .profile-achievements-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .quick-stats,
    .round-cards,
    .records-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .profile-modal-header {
        padding: 15px 20px;
    }
    
    .profile-content {
        padding: 15px 20px;
    }
    
    .profile-stats-grid,
    .quick-stats,
    .round-cards,
    .records-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .profile-history-table {
        font-size: 10px;
    }
    
    .profile-history-table th,
    .profile-history-table td {
        padding: 6px 4px;
    }
}