* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1e293b;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
}

.logo i {
    background: linear-gradient(45deg, #2563eb, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 28px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.streak-badge {
    background: linear-gradient(45deg, #f59e0b, #ef4444);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(45deg, #2563eb, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 16px;
}

.stat-icon.points {
    background: linear-gradient(45deg, #2563eb, #3b82f6);
}

.stat-icon.streak {
    background: linear-gradient(45deg, #f59e0b, #fbbf24);
}

.stat-icon.time {
    background: linear-gradient(45deg, #10b981, #34d399);
}

.stat-icon.level {
    background: linear-gradient(45deg, #8b5cf6, #a78bfa);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.stat-change {
    font-size: 12px;
    color: #10b981;
    margin-top: 8px;
}

/* Progress Section */
.progress-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.level-progress {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.level-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #2563eb 0%, #2563eb 65%, #e2e8f0 65%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.level-circle::before {
    content: '';
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.level-info {
    z-index: 1;
    text-align: center;
    color: #1e293b;
}

.current-level {
    font-size: 24px;
    font-weight: 700;
}

.level-name {
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    position: relative;
}

.level-name:hover::after {
    content: attr(data-full-name);
    position: absolute;
    background: #1e293b;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.level-name:hover::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    z-index: 1000;
}

.level-details h3 {
    font-size: 20px;
    color: #1e293b;
    margin-bottom: 8px;
}

.level-details p {
    color: #64748b;
    margin-bottom: 16px;
}

.xp-bar {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.xp-fill {
    background: linear-gradient(90deg, #2563eb, #10b981);
    height: 100%;
    width: 65%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.xp-text {
    font-size: 14px;
    color: #64748b;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.achievement {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.achievement::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.achievement:hover::before {
    transform: translateX(100%);
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.achievement-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 12px;
    opacity: 0.9;
}

/* Training Cards */
.training-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.training-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.training-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.training-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: white;
}

.training-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.training-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    opacity: 0.9;
}

.training-content {
    padding: 20px;
}

.training-progress {
    background: #f1f5f9;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.training-progress-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.training-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 14px;
    color: #64748b;
}

.start-button {
    background: linear-gradient(45deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .level-progress {
        flex-direction: column;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .training-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .training-card {
        min-width: 0;
        /* Allow cards to shrink below content size */
        max-width: 100%;
        /* Ensure cards don't exceed container */
    }

    .training-meta {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 13px;
    }

    .training-title {
        font-size: 16px;
    }

    .start-button {
        padding: 14px 24px;
        /* Slightly larger for better touch targets */
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .training-section {
        padding: 20px 16px;
    }

    .training-content {
        padding: 16px;
    }
}

/* === NOVOS ESTILOS PARA DASHBOARD REFORMULADO === */

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-all-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.view-all-link:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

/* Premium Styles */
.premium-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.training-card.premium-locked {
    border: 2px solid #fbbf24;
    position: relative;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.training-card.premium-locked::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 30px 30px 0;
    border-color: transparent #fbbf24 transparent transparent;
}

.training-card.premium-locked::after {
    content: '👑';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
}

.start-button.premium-locked {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    border-color: #4b5563;
}

.start-button.premium-locked:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    border-color: #374151;
}

.training-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Page Styles */
.page-header {
    margin-bottom: 40px;
}

.breadcrumb {
    margin-bottom: 15px;
}

.back-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #2563eb;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-description {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.empty-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Paginação */
.paginator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.paginator a,
.paginator span {
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
.paginator li {
    list-style: none;
}
.paginator a {
    color: #6b7280;
    background: white;
    border: 1px solid #d1d5db;
}

.paginator a:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #2563eb;
}

.paginator li.active a{
    color: white;
    background: #2563eb;
    border-color: #2563eb;
}

.paginator .disabled {
    color: #d1d5db;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    cursor: not-allowed;
}

/* Custom styles for lesson view page */
.phrase-details {
    margin: 16px 0;
}

.phrase-item {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.phrase-item strong {
    color: #374151;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.action-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.action-btn.danger {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn.danger:hover {
    background: #fecaca;
    color: #b91c1c;
}

.training-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Dropdown styles for phrases and users */
.phrase-actions-dropdown,
.user-actions-dropdown {
    position: relative;
    margin-left: 8px;
}

.phrase-actions-dropdown .dropdown-toggle,
.user-actions-dropdown .dropdown-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phrase-actions-dropdown .dropdown-toggle:hover,
.user-actions-dropdown .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.phrase-actions-dropdown .dropdown-menu,
.user-actions-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    min-width: 150px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.phrase-actions-dropdown .dropdown-menu.show,
.user-actions-dropdown .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.phrase-actions-dropdown .dropdown-item,
.user-actions-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.phrase-actions-dropdown .dropdown-item:last-child,
.user-actions-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.phrase-actions-dropdown .dropdown-item:hover,
.user-actions-dropdown .dropdown-item:hover {
    background: #f9fafb;
    color: #2563eb;
    text-decoration: none;
}

.phrase-actions-dropdown .dropdown-item.delete-item:hover,
.user-actions-dropdown .dropdown-item.delete-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Ensure training-meta has proper flex layout for dropdown positioning */
.training-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Responsividade mobile para novos elementos */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-title {
        font-size: 24px;
    }

    .paginator {
        flex-wrap: wrap;
        gap: 4px;
    }

    .paginator a,
    .paginator span {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .phrase-item {
        font-size: 13px;
    }
    
    .action-buttons {
        gap: 6px;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}