/* EnglishLearn Points System - Frontend Styles */
:root {
    --elps-primary-color: #4CAF50;
    --elps-secondary-color: #2196F3;
    --elps-success-color: #4CAF50;
    --elps-warning-color: #FF9800;
    --elps-danger-color: #F44336;
    --elps-info-color: #2196F3;
    --elps-dark-color: #333;
    --elps-light-color: #f5f5f5;
    --elps-border-radius: 8px;
    --elps-box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --elps-transition: all 0.3s ease;
}

/* RTL Support */
.rtl {
    direction: rtl;
    text-align: right;
}

/* Reset and Base */
.elps-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.elps-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--elps-border-radius);
    box-shadow: var(--elps-box-shadow);
}

.elps-section-title {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--elps-light-color);
    color: var(--elps-dark-color);
    font-size: 1.5em;
}

/* Dashboard Styles */
.elps-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.elps-stat-card {
    background: linear-gradient(135deg, var(--elps-primary-color) 0%, var(--elps-secondary-color) 100%);
    color: white;
    padding: 20px;
    border-radius: var(--elps-border-radius);
    text-align: center;
    transition: var(--elps-transition);
}

.elps-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.elps-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 2em;
    font-weight: bold;
}

.elps-stat-card p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9em;
}

/* Progress Bar */
.elps-progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.elps-progress-bar-wrapper {
    flex: 1;
    margin: 0 20px;
}

.elps-progress-bar {
    height: 8px;
    background: var(--elps-light-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.elps-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--elps-primary-color), var(--elps-secondary-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.elps-progress-text {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 12px;
    color: var(--elps-dark-color);
}

.elps-level-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.elps-level-badge {
    padding: 5px 10px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.elps-quick-stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

.elps-quick-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.elps-quick-stat i {
    color: var(--elps-primary-color);
}

/* Leaderboard Styles */
.elps-leaderboard {
    overflow-x: auto;
}

.elps-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.elps-leaderboard-table th {
    background: var(--elps-light-color);
    padding: 12px 15px;
    text-align: right;
    font-weight: 600;
    color: var(--elps-dark-color);
    border-bottom: 2px solid #ddd;
}

.elps-leaderboard-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.elps-leaderboard-table tr:hover {
    background: #f9f9f9;
}

.elps-rank {
    width: 40px;
    text-align: center;
    font-weight: bold;
}

.elps-rank-1 {
    color: #FFD700;
    font-size: 1.2em;
}

.elps-rank-2 {
    color: #C0C0C0;
    font-size: 1.1em;
}

.elps-rank-3 {
    color: #CD7F32;
}

.elps-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.elps-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.elps-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.elps-user-info {
    flex: 1;
}

.elps-user-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.elps-user-email {
    font-size: 12px;
    color: #666;
}

/* Badges Display */
.elps-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.elps-badge-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: var(--elps-border-radius);
    box-shadow: var(--elps-box-shadow);
    transition: var(--elps-transition);
    position: relative;
}

.elps-badge-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.elps-badge-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.elps-badge-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.elps-badge-description {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.elps-badge-date {
    font-size: 11px;
    color: #999;
}

.elps-badge-rare {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FFD700;
    color: #333;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

/* Level Progress Circle */
.elps-level-circle {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    position: relative;
}

.elps-circle-bg {
    fill: none;
    stroke: var(--elps-light-color);
    stroke-width: 10;
}

.elps-circle-progress {
    fill: none;
    stroke: var(--elps-primary-color);
    stroke-width: 10;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.5s ease;
}

.elps-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.elps-circle-level {
    font-size: 24px;
    font-weight: bold;
    color: var(--elps-dark-color);
}

.elps-circle-percentage {
    font-size: 14px;
    color: #666;
}

/* Streak Counter */
.elps-streak-counter {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    border-radius: var(--elps-border-radius);
}

.elps-streak-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.elps-streak-days {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.elps-streak-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Notifications */
.elps-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: var(--elps-border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.elps-notification.show {
    transform: translateX(0);
}

.elps-notification-success {
    border-right: 4px solid var(--elps-success-color);
}

.elps-notification-warning {
    border-right: 4px solid var(--elps-warning-color);
}

.elps-notification-error {
    border-right: 4px solid var(--elps-danger-color);
}

.elps-notification-icon {
    font-size: 1.5em;
}

.elps-notification-content {
    flex: 1;
}

.elps-notification-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.elps-notification-message {
    font-size: 0.9em;
    color: #666;
}

.elps-notification-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #999;
}

/* Loading States */
.elps-loading {
    text-align: center;
    padding: 40px;
}

.elps-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--elps-light-color);
    border-top-color: var(--elps-primary-color);
    border-radius: 50%;
    animation: elps-spin 1s linear infinite;
}

@keyframes elps-spin {
    to { transform: rotate(360deg); }
}

/* Empty States */
.elps-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.elps-empty-icon {
    font-size: 3em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.elps-empty-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--elps-dark-color);
}

.elps-empty-description {
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .elps-container {
        padding: 10px;
    }
    
    .elps-section {
        padding: 15px;
    }
    
    .elps-dashboard {
        grid-template-columns: 1fr;
    }
    
    .elps-progress-bar-container {
        padding: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .elps-progress-bar-wrapper {
        margin: 10px 0;
        width: 100%;
    }
    
    .elps-quick-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .elps-leaderboard-table {
        font-size: 14px;
    }
    
    .elps-badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .elps-notification {
        left: 10px;
        right: 10px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .elps-section-title {
        font-size: 1.2em;
    }
    
    .elps-stat-card h3 {
        font-size: 1.5em;
    }
    
    .elps-level-circle {
        width: 120px;
        height: 120px;
    }
    
    .elps-badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation for new achievements */
@keyframes elps-celebration {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.elps-celebration {
    animation: elps-celebration 0.5s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--elps-light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--elps-primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--elps-secondary-color);
}

/* Print Styles */
@media print {
    .elps-progress-bar-container,
    .elps-notification {
        display: none;
    }
    
    .elps-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}