/**
 * PROFILE MODAL - Editorial Premium
 * thatchess - ese ajedrez
 * 
 * Extensión del Glass System para perfil completo
 * Consistente con auth modal y sistema de diseño general
 */

/* ===================================================
   MODAL PRINCIPAL - Glass System
   =================================================== */

.tc-profile-modal {
    max-width: 680px;
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    margin: 0 auto;
    /* Center horizontally */
}

/* ===================================================
   HEADER - Editorial con Grain
   =================================================== */

.tc-profile-header {
    position: relative;
    padding: var(--tc-space-8) var(--tc-space-6);
    border-bottom: 1px solid var(--tc-gray-800);
    text-align: left;
}

.tc-profile-header .tc-glass-close {
    position: absolute;
    top: var(--tc-space-4);
    right: var(--tc-space-4);
    z-index: 10;
    pointer-events: auto;
}

/* Brand header - editorial */
.tc-profile-brand {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    margin-right: auto;
    text-align: left;
    pointer-events: none;
}

.tc-profile-brand .tc-mono-tiny {
    color: var(--tc-gray-500);
    display: block;
    margin-bottom: var(--tc-space-2);
}

.tc-profile-title {
    font-family: var(--tc-font-display-alt);
    /* Outfit */
    font-size: var(--tc-text-xlarge);
    font-weight: var(--tc-weight-extrabold);
    line-height: var(--tc-leading-tight);
    color: var(--tc-white-pure);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-wide);
    margin: 0;
}

/* ===================================================
   BODY LAYOUT - Sidebar + Content
   =================================================== */

.tc-profile-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ===================================================
   NAVIGATION SIDEBAR - Editorial List
   =================================================== */

.tc-profile-nav {
    width: 180px;
    padding: var(--tc-space-4);
    border-right: 1px solid var(--tc-gray-800);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: var(--tc-space-2);
    overflow-y: auto;
}

.tc-profile-tab {
    padding: var(--tc-space-3) var(--tc-space-4);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--tc-font-mono);
    font-size: var(--tc-text-tiny);
    font-weight: var(--tc-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-wider);
    color: var(--tc-gray-500);
    text-align: left;
    transition: all var(--tc-duration-fast) var(--tc-ease-out);
    border-left: 2px solid transparent;
}

.tc-profile-tab:hover {
    color: var(--tc-white-pure);
    background: var(--tc-gray-900);
}

.tc-profile-tab.active {
    background: var(--tc-gray-900);
    color: var(--tc-white-pure);
    border-left-color: var(--tc-crimson);
    font-weight: var(--tc-weight-extrabold);
}

/* Mobile navigation - hidden by default, shown in mobile breakpoint */
.tc-profile-nav-mobile {
    display: none;
}

@media (min-width: 769px) {
    .tc-profile-nav-mobile {
        display: none !important;
    }
}


/* ===================================================
   CONTENT AREA - Scrollable Panels
   =================================================== */

.tc-profile-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--tc-space-6);
    width: 100%;
    max-width: 100%;
}

/* Panel de cada sección */
.tc-profile-panel {
    display: none;
}

.tc-profile-panel.active {
    display: flex;
    flex-direction: column;
    gap: var(--tc-space-6);
    animation: tc-panel-fade-in var(--tc-duration-normal) var(--tc-ease-out);
}

@keyframes tc-panel-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================================
   BENTO CARDS - Contenido Modular
   =================================================== */

.tc-profile-card {
    background: var(--tc-gray-950);
    border: 1px solid var(--tc-gray-800);
    padding: var(--tc-space-6);
    transition: border-color var(--tc-duration-fast) var(--tc-ease-out);
}

.tc-profile-card:hover {
    border-color: var(--tc-gray-600);
}

/* Greeting card - más prominente */
.tc-profile-greeting-card {
    background: var(--tc-gray-900);
    border: 1px solid var(--tc-gray-700);
    padding: var(--tc-space-6);
}

.tc-profile-greeting {
    font-family: var(--tc-font-display-alt);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: var(--tc-weight-extrabold);
    color: var(--tc-white-pure);
    line-height: var(--tc-leading-tight);
    margin-bottom: var(--tc-space-2);
}

.tc-profile-since {
    font-family: var(--tc-font-mono);
    font-size: var(--tc-text-micro);
    color: var(--tc-gray-500);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-wider);
    line-height: var(--tc-leading-normal);
}

.tc-profile-tagline {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-small);
    color: var(--tc-gray-400);
    margin-top: var(--tc-space-3);
}

/* ===================================================
   STATS GRID - Fashion Accent
   =================================================== */

.tc-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--tc-space-3);
}

.tc-profile-stat {
    background: var(--tc-gray-950);
    border: 1px solid var(--tc-gray-800);
    padding: var(--tc-space-4);
    text-align: center;
    transition: border-color var(--tc-duration-fast) var(--tc-ease-out);
}

.tc-profile-stat:hover {
    border-color: var(--tc-gray-700);
}

.tc-profile-stat-value {
    font-family: var(--tc-font-display);
    font-size: var(--tc-text-xlarge);
    font-weight: var(--tc-weight-black);
    color: var(--tc-champagne);
    /* Fashion accent */
    line-height: 1;
    margin-bottom: var(--tc-space-2);
}

.tc-profile-stat-label {
    font-family: var(--tc-font-mono);
    font-size: calc(var(--tc-text-micro) * 0.95);
    color: var(--tc-gray-500);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-wider);
}

/* Stats inline text */
.tc-profile-narrative {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-small);
    color: var(--tc-gray-300);
    line-height: var(--tc-leading-relaxed);
}

.tc-profile-narrative strong {
    color: var(--tc-white-pure);
    font-weight: var(--tc-weight-extrabold);
}

.tc-profile-learning-list {
    margin-top: var(--tc-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--tc-space-2);
}

.tc-profile-learning-attention {
    margin-top: var(--tc-space-4);
    padding-top: var(--tc-space-3);
    border-top: 1px solid var(--tc-gray-800);
}

.tc-profile-learning-item {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-small);
    color: var(--tc-gray-300);
    line-height: var(--tc-leading-relaxed);
}

.tc-profile-learning-item strong {
    color: var(--tc-champagne);
}

/* ===================================================
   SECTION HEADERS - Editorial
   =================================================== */

.tc-profile-section-label {
    font-family: var(--tc-font-mono);
    font-size: var(--tc-text-tiny);
    color: var(--tc-gray-500);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-widest);
    display: block;
    margin-bottom: var(--tc-space-3);
}

.tc-profile-section-title {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-large);
    font-weight: var(--tc-weight-bold);
    color: var(--tc-white-pure);
    margin-bottom: var(--tc-space-2);
}

.tc-profile-section-hint {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-small);
    color: var(--tc-gray-400);
    line-height: var(--tc-leading-normal);
}

/* ===================================================
   FORMS - Design System Integration
   =================================================== */

.tc-profile-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--tc-space-2);
}

.tc-profile-form-label {
    font-family: var(--tc-font-mono);
    font-size: var(--tc-text-tiny);
    font-weight: var(--tc-weight-bold);
    color: var(--tc-gray-400);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-wider);
}

.tc-profile-form-hint {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-tiny);
    color: var(--tc-gray-500);
    line-height: var(--tc-leading-normal);
    margin-top: var(--tc-space-2);
}

/* Status messages */
.tc-profile-status {
    font-family: var(--tc-font-mono);
    font-size: var(--tc-text-tiny);
    color: var(--tc-gray-500);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-wider);
    min-height: 1.25rem;
    margin-top: var(--tc-space-2);
}

.tc-profile-status.success {
    color: var(--tc-emerald);
}

.tc-profile-status.error {
    color: var(--tc-crimson);
}

/* ===================================================
   FOOTER STICKY - Logged Status
   =================================================== */

.tc-profile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--tc-space-4) var(--tc-space-6);
    border-top: 1px solid var(--tc-gray-800);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    gap: var(--tc-space-4);
}

.tc-profile-community-msg {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-tiny);
    color: var(--tc-gray-500);
    font-weight: var(--tc-weight-regular);
    font-style: italic;
    letter-spacing: normal;
    line-height: var(--tc-leading-normal);
    flex: 1;
    min-width: 0;
    text-align: left;
}

.tc-profile-footer .tc-btn {
    min-width: 160px;
    flex-shrink: 0;
}

/* ===================================================
   JOURNAL ENTRIES
   =================================================== */

.tc-journal-list {
    display: flex;
    flex-direction: column;
    gap: var(--tc-space-3);
}

.tc-journal-entry {
    background: var(--tc-gray-950);
    border: 1px solid var(--tc-gray-800);
    padding: var(--tc-space-4);
}

.tc-journal-date {
    font-family: var(--tc-font-mono);
    font-size: var(--tc-text-tiny);
    color: var(--tc-gray-500);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-wider);
    margin-bottom: var(--tc-space-2);
}

.tc-journal-text {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-small);
    color: var(--tc-gray-300);
    line-height: var(--tc-leading-relaxed);
    white-space: pre-wrap;
}

/* Empty state */
.tc-journal-empty {
    padding: var(--tc-space-8);
    text-align: center;
    color: var(--tc-gray-500);
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-small);
}

/* ===================================================
   RESPONSIVE - Mobile
   =================================================== */

@media (max-width: 768px) {
    .tc-profile-modal {
        max-width: 100%;
        max-height: 95vh;
    }

    .tc-profile-header {
        padding: var(--tc-space-6) var(--tc-space-4);
    }

    .tc-profile-body {
        flex-direction: column;
    }

    /* Hide desktop sidebar */
    .tc-profile-nav {
        display: none !important;
    }

    /* Mobile tabs horizontales */
    .tc-profile-nav-mobile {
        display: flex !important;
        overflow-x: auto;
        gap: var(--tc-space-2);
        padding: var(--tc-space-3) var(--tc-space-4);
        border-bottom: 1px solid var(--tc-gray-800);
        background: var(--tc-gray-950);
        width: 100%;
        /* Hide scrollbar but keep functionality */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tc-profile-nav-mobile::-webkit-scrollbar {
        display: none;
    }

    .tc-profile-nav-mobile .tc-profile-tab {
        white-space: nowrap;
        flex-shrink: 0;
        border-left: none;
        border-bottom: 2px solid transparent;
        text-align: center;
        padding: var(--tc-space-2) var(--tc-space-4);
    }

    .tc-profile-nav-mobile .tc-profile-tab.active {
        border-bottom-color: var(--tc-crimson);
        border-left-color: transparent;
    }

    /* Content adjustments */
    .tc-profile-content {
        padding: var(--tc-space-4);
    }

    .tc-profile-card,
    .tc-profile-greeting-card {
        padding: var(--tc-space-4);
    }

    /* Stats stack vertically */
    .tc-profile-stats {
        grid-template-columns: 1fr;
    }

    /* Footer adjustments */
    .tc-profile-footer {
        padding: var(--tc-space-3) var(--tc-space-4);
        flex-direction: column;
        align-items: stretch;
        gap: var(--tc-space-3);
    }

    .tc-profile-community-msg {
        text-align: center;
    }

    .tc-profile-footer .tc-btn {
        width: 100%;
        min-width: 0;
    }
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tc-profile-panel.active {
        animation: none;
    }

    .tc-profile-tab,
    .tc-profile-stat,
    .tc-profile-card {
        transition: none;
    }
}

/* Focus visible states */
.tc-profile-tab:focus-visible {
    outline: 2px solid var(--tc-crimson);
    outline-offset: -2px;
}

/* ===================================================
   UTILITY CLASSES
   =================================================== */

/* CTA highlight */
.tc-profile-cta {
    font-family: var(--tc-font-mono);
    font-size: var(--tc-text-tiny);
    color: var(--tc-champagne);
    text-transform: uppercase;
    letter-spacing: var(--tc-tracking-wider);
    font-weight: var(--tc-weight-extrabold);
    cursor: pointer;
    transition: color var(--tc-duration-fast) var(--tc-ease-out);
}

.tc-profile-cta:hover {
    color: var(--tc-champagne-light);
}

/* Divider for sections */
.tc-profile-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tc-gray-800), transparent);
    margin: var(--tc-space-6) 0;
    border: none;
}
