/* =========================================
   CATEGORIES PAGE STYLING
   ========================================= */

/* Accessibility - Visually Hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* Stats Overview */
.stats-overview {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: var(--radius);
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.stat-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.stat-info {
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

/* Section Title */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    text-align: center;
}

/* Categories Grid */
.categories-section {
    margin-bottom: 30px;
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Category Card */
.category-card {
    position: relative;
    padding: 25px;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(108, 92, 231, 0.2);
}

.category-card.locked {
    opacity: 0.7;
}

/* Lock Overlay */
.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius);
    transition: opacity 0.3s ease;
}

.category-card.unlocked .lock-overlay {
    display: none;
}

.lock-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: lockShake 2s ease-in-out infinite;
}

@keyframes lockShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.unlock-text {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    padding: 0 20px;
}

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.category-badge.premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.category-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Category Info */
.category-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.category-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Category Stats */
.category-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.word-count {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.completion-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Category Button */
.category-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    text-decoration: none;
}

.btn-unlocked {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-unlocked:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-unlocked:active {
    transform: scale(0.98);
}

.btn-locked {
    background: var(--surface);
    color: var(--text-light);
    cursor: not-allowed;
    pointer-events: none;
}

/* Mistakes Section */
.mistakes-section {
    margin-bottom: 30px;
}

.mistakes-card {
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.mistakes-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.mistakes-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.mistakes-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.mistakes-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

#mistake-count {
    color: var(--error);
    font-weight: 700;
}

.mistakes-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--error) 0%, #fd79a8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(214, 48, 49, 0.3);
}

.mistakes-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(214, 48, 49, 0.4);
}

.mistakes-btn:active {
    transform: scale(0.98);
}

/* Responsive Design */
@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-overview {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Dark Mode Adjustments */
body.dark-mode .completion-badge {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

body.dark-mode .category-card:hover {
    box-shadow: 0 12px 24px rgba(108, 92, 231, 0.4);
}

body.dark-mode .lock-overlay {
    background: rgba(0, 0, 0, 0.8);
}

/* User Profile Pill Styling */
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--surface);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.user-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.user-pill img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-pill span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.btn-reset {
    border: none;
    background: none;
}
