/**
 * CLASS SELECTION UI STYLES
 * Beautiful, mobile-first design for class selection
 */

/* ============= CLASS SELECTION OVERLAY ============= */

.class-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(20, 10, 40, 0.98) 50%,
        rgba(0, 0, 0, 0.95) 100%
    );
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    overflow-y: auto;
    animation: fadeIn 0.5s ease-out;
}

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

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

/* ============= CLASS SELECTION MODAL ============= */

.class-selection-modal {
    max-width: 1400px;
    width: 100%;
    background: linear-gradient(135deg,
        rgba(30, 20, 50, 0.95) 0%,
        rgba(40, 25, 60, 0.95) 100%
    );
    border: 2px solid rgba(155, 89, 182, 0.5);
    border-radius: clamp(12px, 2vw, 24px);
    padding: clamp(1.5rem, 4vw, 3rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============= HEADER ============= */

.class-selection-header {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.class-selection-header h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, #e74c3c, #9b59b6, #3498db);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 30px rgba(155, 89, 182, 0.5);
}

.class-selection-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

/* ============= CLASS GRID ============= */

.class-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* ============= CLASS CARDS ============= */

.class-card {
    background: linear-gradient(135deg,
        rgba(40, 30, 60, 0.9) 0%,
        rgba(60, 40, 80, 0.9) 100%
    );
    border: 2px solid rgba(155, 89, 182, 0.3);
    border-radius: clamp(12px, 2vw, 20px);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.class-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
        rgba(155, 89, 182, 0.1) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.class-card:hover {
    border-color: rgba(155, 89, 182, 0.8);
    box-shadow: 0 10px 40px rgba(155, 89, 182, 0.4);
    transform: translateY(-10px) scale(1.02);
}

.class-card:hover::before {
    opacity: 1;
}

/* ============= CLASS EMOJI ============= */

.class-emoji {
    font-size: clamp(3rem, 8vw, 5rem);
    text-align: center;
    margin-bottom: 1rem;
    animation: floatEmoji 3s ease-in-out infinite;
}

@keyframes floatEmoji {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.class-card:hover .class-emoji {
    animation: spinEmoji 0.6s ease-out;
}

@keyframes spinEmoji {
    from {
        transform: rotateY(0deg) scale(1);
    }
    50% {
        transform: rotateY(180deg) scale(1.2);
    }
    to {
        transform: rotateY(360deg) scale(1);
    }
}

/* ============= CLASS NAME & DESCRIPTION ============= */

.class-name {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #ecf0f1;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.class-description {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* ============= STATS ============= */

.class-stats {
    margin-bottom: 1.5rem;
}

.class-stats h4 {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #9b59b6;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.stat-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-row {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: 0.75rem;
}

.stat-label {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.stat-bar {
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #9b59b6);
    transition: width 0.5s ease-out;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

.stat-value {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    color: #9b59b6;
    font-weight: 700;
    text-align: right;
}

/* ============= ABILITIES ============= */

.class-abilities {
    margin-bottom: 1.5rem;
}

.class-abilities h4 {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #3498db;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.class-abilities ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.class-abilities li {
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.class-abilities li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #3498db;
    font-size: 1.2em;
}

/* ============= SELECT BUTTON ============= */

.class-select-btn {
    width: 100%;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2rem);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: linear-gradient(135deg, #e74c3c, #9b59b6);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: clamp(8px, 1.5vw, 12px);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.class-select-btn:hover {
    background: linear-gradient(135deg, #c0392b, #8e44ad);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 25px rgba(155, 89, 182, 0.6);
    transform: translateY(-2px);
}

.class-select-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(155, 89, 182, 0.4);
}

/* ============= FOOTER ============= */

.class-selection-footer {
    text-align: center;
    padding-top: clamp(1.5rem, 3vw, 2rem);
    border-top: 1px solid rgba(155, 89, 182, 0.3);
}

.class-selection-footer p {
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.class-selection-footer strong {
    color: #e74c3c;
}

/* ============= CONFIRMATION BANNER ============= */

.class-confirmation-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    animation: slideUpBanner 0.5s ease-out;
}

@keyframes slideUpBanner {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.class-confirmation-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    padding: 1.5rem 2.5rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(46, 204, 113, 0.5);
}

.class-confirmation-emoji {
    font-size: 3rem;
    animation: pulseEmoji 0.6s ease-out;
}

@keyframes pulseEmoji {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

.class-confirmation-text strong {
    display: block;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.class-confirmation-text p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-style: italic;
}

/* ============= MOBILE OPTIMIZATIONS ============= */

@media (max-width: 768px) {
    .class-selection-grid {
        grid-template-columns: 1fr;
    }

    .stat-row {
        grid-template-columns: 80px 1fr 40px;
        gap: 0.5rem;
    }

    .class-confirmation-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
    }
}

/* ============= ACCESSIBILITY ============= */

@media (prefers-reduced-motion: reduce) {
    .class-card,
    .class-emoji,
    .class-select-btn,
    .class-confirmation-banner {
        animation: none;
        transition: none;
    }

    .class-card:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .class-card {
        border-width: 3px;
    }

    .class-select-btn {
        border-width: 3px;
    }
}
