/* ============================================================
   CHARACTER CREATOR - GAME-AGNOSTIC STYLES
   Future-proof styling for multi-TTRPG character creation
   All classes use .cc- prefix for character creator
   ============================================================ */

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.cc-progress {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 1rem 1.5rem;
    margin: 0 auto;
    max-width: 800px;
}

.cc-progress-track {
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 3px;
    background: var(--border-default);
    transform: translateY(-50%);
    z-index: 1;
}

.cc-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), #f4d03f);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.cc-progress-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
    flex: 1;
}

.cc-progress-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cc-progress-step.completed .cc-progress-dot {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-primary);
}

.cc-progress-step.active .cc-progress-dot {
    background: var(--bg-primary);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.8);
    }
}

.cc-progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    transition: color 0.3s;
}

.cc-progress-step.active .cc-progress-label {
    color: var(--accent-gold);
    font-weight: 600;
}

.cc-progress-step.completed .cc-progress-label {
    color: var(--text-primary);
}

/* ============================================================
   CHARACTER PREVIEW BAR
   ============================================================ */

.cc-preview {
    padding: 1rem;
    margin: 0 auto 1.5rem;
    max-width: 800px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cc-preview.visible {
    opacity: 1;
}

.cc-preview-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-md);
    color: #d4af37;
    font-size: 0.875rem;
    font-weight: 500;
    animation: chip-enter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chip-enter {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cc-preview-chip-icon {
    font-size: 1rem;
}

/* ============================================================
   STEP CONTENT & TRANSITIONS
   ============================================================ */

.cc-step {
    text-align: center;
    padding: 1rem;
    animation: step-enter 0.3s ease-out;
}

.game-select-title {
    font-size: 1.25rem;
    font-weight: bold;
    font-family: 'Colus';
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.kin-name, .prof-name, .age-name {
    font-weight: 600;
    font-family: 'Colus';
    margin-bottom: 0.25rem;
}

.cc-step.step-exit {
    animation: step-exit 0.2s ease-in forwards;
}

@keyframes step-exit {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-30px);
    }
}

@keyframes step-enter {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.cc-step h2 {
   margin-bottom: 1.5rem;
    font-family: 'Colus';
    font-size: 2.5rem;
    color: var(--text-primary);
}

/* ============================================================
   OPTION CARDS (Kin, Profession, Age)
   ============================================================ */

.cc-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.cc-option-card {
    padding: 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cc-option-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cc-option-card.selected {
    border-color: var(--accent-gold);
    background: var(--bg-elevated);
}

.cc-option-card.just-selected {
    animation: selection-pulse 0.6s ease-out;
}

@keyframes selection-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* ============================================================
   ATTRIBUTE ROLLING
   ============================================================ */

.cc-attr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.cc-attr-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-default);
    transition: all 0.3s ease;
}

.cc-attr-item.attr-done {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

.cc-attr-item .attr-label {
    display: block;
    font-size: 0.75rem;
    font-family: 'Colus';
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.cc-attr-item .attr-value {
   display: block;
    position: relative;
    justify-self: center;
    align-content: center;
    padding-right: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 0.5rem;
}

.cc-attr-item .attr-value.rolling {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.cc-attr-item .attr-value.popped {
    animation: pop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cc-roll-progress {
    text-align: center;
    margin: 1rem 0;
    font-size: 1rem;
    color: var(--accent-gold);
    font-weight: 600;
}

/* ============================================================
   SUMMARY CARD
   ============================================================ */

.cc-summary-card {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-card);
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: summary-enter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

@keyframes summary-enter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cc-summary-portrait {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--accent-gold);
    object-fit: cover;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.cc-summary-name {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cc-summary-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cc-summary-abilities {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.cc-summary-ability {
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-md);
    color: var(--accent-gold);
    font-size: 0.875rem;
    font-weight: 500;
}

.cc-summary-attrs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.cc-summary-attr {
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
}

.cc-summary-attr-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.cc-summary-attr-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.cc-summary-create-btn {
    animation: btn-pulse 2s ease-in-out infinite;
}

@keyframes btn-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    }
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.cc-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================================
   BACKWARD COMPATIBILITY
   Keep old classes working alongside new ones
   ============================================================ */

.creator-step {
    /* Backward compatible - maps to .cc-step */
}

.kin-grid,
.profession-grid,
.age-grid {
    /* Backward compatible - maps to .cc-option-grid */
}

.kin-card,
.profession-card,
.age-card {
    /* Backward compatible - maps to .cc-option-card */
}

.attrs-roll-grid {
    /* Backward compatible - maps to .cc-attr-grid */
}

.attr-roll-item {
    /* Backward compatible - maps to .cc-attr-item */
}

.summary-card {
    /* Backward compatible - but enhanced version in .cc-summary-card */
}

.creator-nav {
    /* Backward compatible - maps to .cc-nav */
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .cc-progress {
        padding: 1.5rem 0.5rem 1rem;
    }

    .cc-progress-track {
        left: 10%;
        right: 10%;
    }

    .cc-progress-dot {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .cc-progress-label {
        display: none;
    }

    .cc-preview {
        padding: 0.75rem;
        min-height: 50px;
    }

    .cc-preview-chip {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }

    .cc-option-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cc-attr-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .cc-attr-item {
        padding: 0.75rem;
    }

    .cc-attr-item .attr-value {
        font-size: 1.25rem;
    }

    .cc-summary-card {
        padding: 1.5rem 1rem;
    }

    .cc-summary-name {
        font-size: 1.5rem;
    }

    .cc-summary-portrait {
        width: 100px;
        height: 100px;
    }

    .cc-summary-attrs {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .cc-summary-attr {
        padding: 0.5rem;
    }

    .cc-summary-attr-label {
        font-size: 0.65rem;
    }

    .cc-summary-attr-value {
        font-size: 1rem;
    }

    .cc-nav {
        flex-direction: column;
        width: 100%;
    }

    .cc-nav .btn {
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .cc-progress-step {
        gap: 0.25rem;
    }

    .cc-summary-attrs {
        grid-template-columns: repeat(2, 1fr);
    }
}
