/* ==========================================
   RandyAI Platform CSS - Shared Components
   Study Center  Troubleshoot  Feed  Profile  Guilds
   ========================================== */

/* ==========================================
   Platform Page Shell
   ========================================== */
.platform-header {
    padding: 10rem 0 4rem;
    text-align: center;
    background: var(--grad-deep);
    position: relative;
    overflow: hidden;
}

.platform-header::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.platform-header h1 {
    margin-bottom: 1rem;
}

.platform-header .page-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--v2-cyan);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
}

.platform-header p {
    max-width: 700px;
    margin: 0 auto;
    color: var(--v2-muted);
    font-size: 1.15rem;
}

.platform-body {
    padding: 4rem 0 6rem;
}

.platform-section {
    padding: 4rem 0;
}

/* ==========================================
   Platform Grid Layout
   ========================================== */
.side-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
    width: 100%;
}

.side-panel {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ==========================================
   Glass Card Base
   ========================================== */
.glass-card {
    background: var(--v2-card-bg);
    border: 1px solid var(--v2-border-color);
    backdrop-filter: var(--v2-blur);
    -webkit-backdrop-filter: var(--v2-blur);
    border-radius: var(--v2-radius);
    padding: 2rem;
    transition: var(--v2-transition);
}

.glass-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 20px rgba(6, 182, 212, 0.08);
}

.glass-card-sm {
    background: var(--v2-card-bg);
    border: 1px solid var(--v2-border-color);
    backdrop-filter: var(--v2-blur);
    -webkit-backdrop-filter: var(--v2-blur);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    transition: var(--v2-transition);
}

/* ==========================================
   Category / Topic Cards Grid
   ========================================== */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    width: 100%;
}

.topic-card {
    background: var(--v2-card-bg);
    border: 2px solid var(--v2-border-color);
    border-radius: 20px;
    padding: 1.75rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--v2-transition);
    text-decoration: none;
    color: var(--v2-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.topic-card:hover,
.topic-card.active {
    border-color: var(--v2-cyan);
    background: rgba(6, 182, 212, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(6, 182, 212, 0.15);
    color: var(--v2-white);
}

.topic-card .topic-icon {
    font-size: 2.25rem;
    line-height: 1;
}

.topic-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

.topic-card .topic-meta {
    font-size: 0.78rem;
    color: var(--v2-muted);
}

.topic-card .topic-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.topic-card .topic-progress-fill {
    height: 100%;
    background: var(--v2-grad-main);
    border-radius: 999px;
    transition: width 1s ease;
}

/* ==========================================
   Quiz Interface
   ========================================== */
.quiz-panel {
    background: var(--v2-card-bg);
    border: 1px solid var(--v2-border-color);
    border-radius: var(--v2-radius);
    overflow: hidden;
}

.quiz-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--v2-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.quiz-header .quiz-topic-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--v2-cyan);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.quiz-progress-bar {
    flex: 1;
    max-width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.quiz-progress-bar-fill {
    height: 100%;
    background: var(--v2-grad-main);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.quiz-counter {
    font-size: 0.85rem;
    color: var(--v2-muted);
    font-weight: 600;
}

.quiz-body {
    padding: 2.5rem 2rem;
}

.quiz-question {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--v2-white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.5;
    margin-bottom: 2rem;
    text-align: left;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: var(--v2-transition);
    text-align: left;
    color: var(--v2-white);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quiz-option:hover {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.4);
    transform: translateX(4px);
}

.quiz-option.correct {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--v2-emerald);
    color: #6ee7b7;
}

.quiz-option.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--v2-danger);
    color: #fca5a5;
}

.quiz-option .option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    transition: var(--v2-transition);
}

.quiz-option.correct .option-letter {
    background: var(--v2-emerald);
    color: white;
}

.quiz-option.incorrect .option-letter {
    background: var(--v2-danger);
    color: white;
}

.randy-explanation {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 16px;
    display: none;
}

.randy-explanation.visible {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.randy-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--v2-grad-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

.randy-explanation-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
}

.randy-explanation-text strong {
    color: var(--v2-violet);
    font-weight: 700;
}

.quiz-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--v2-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-quiz-next {
    background: var(--v2-grad-main);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--v2-transition);
}

.btn-quiz-next:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

/* ==========================================
   Streak & Earn Widgets
   ========================================== */
.streak-widget {
    text-align: center;
    padding: 1.5rem;
}

.streak-flame {
    font-size: 3rem;
    display: block;
    animation: pulse-flame 2s ease-in-out infinite;
    line-height: 1;
    margin-bottom: 0.5rem;
}

@keyframes pulse-flame {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.streak-count {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--v2-warning);
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: block;
}

.streak-label {
    font-size: 0.8rem;
    color: var(--v2-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.streak-days {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1rem;
}

.streak-day {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--v2-muted);
}

.streak-day.done {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--v2-warning);
    color: var(--v2-warning);
}

.streak-day.today {
    background: var(--v2-warning);
    color: #000;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.earn-widget {
    padding: 1.25rem 1.5rem;
}

.earn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
}

.earn-row:last-child {
    border-bottom: none;
}

.earn-action {
    color: var(--v2-muted);
}

.earn-reward {
    font-weight: 700;
    color: var(--v2-warning);
}

.earn-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.earn-total-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--v2-white);
}

.earn-total-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--v2-warning);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ==========================================
   Troubleshoot Interface
   ========================================== */
.problem-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    width: 100%;
}

.problem-card {
    background: var(--v2-card-bg);
    border: 2px solid var(--v2-border-color);
    border-radius: 18px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--v2-transition);
    color: var(--v2-white);
    text-decoration: none;
}

.problem-card:hover,
.problem-card.selected {
    border-color: var(--v2-warning);
    background: rgba(245, 158, 11, 0.07);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(245, 158, 11, 0.15);
    color: var(--v2-white);
}

.problem-card .problem-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.problem-card h3 {
    font-size: 0.9rem;
    margin: 0;
    font-weight: 700;
}

/* Chat Interface */
.chat-window {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--v2-border-color);
    border-radius: var(--v2-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.chat-header {
    padding: 1.25rem 1.5rem;
    background: rgba(17, 24, 39, 0.8);
    border-bottom: 1px solid var(--v2-border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header .randy-status-dot {
    width: 10px;
    height: 10px;
    background: var(--v2-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--v2-emerald);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.chat-header .chat-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.chat-header .chat-subtitle {
    font-size: 0.78rem;
    color: var(--v2-emerald);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

.chat-msg {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    animation: msg-appear 0.3s ease;
}

@keyframes msg-appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.user {
    flex-direction: row-reverse;
}

.chat-msg .msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--v2-grad-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.chat-msg.user .msg-avatar {
    background: linear-gradient(135deg, var(--v2-warning), #f97316);
}

.chat-msg .msg-bubble {
    max-width: 75%;
    padding: 0.875rem 1.125rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.chat-msg.randy .msg-bubble {
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 4px 18px 18px 18px;
}

.chat-msg.user .msg-bubble {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 18px 4px 18px 18px;
    text-align: right;
}

.chat-typing {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0 1.5rem 1rem;
}

.chat-typing .dots {
    display: flex;
    gap: 4px;
}

.chat-typing .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--v2-violet);
    animation: bounce-dot 1.4s infinite;
}

.chat-typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce-dot {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-input-row {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--v2-border-color);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    color: var(--v2-white);
    font-size: 0.95rem;
    outline: none;
    transition: var(--v2-transition);
    font-family: 'Inter', sans-serif;
}

.chat-input:focus {
    border-color: rgba(124, 58, 237, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

.chat-input::placeholder {
    color: var(--v2-muted);
}

.btn-chat-send {
    background: var(--v2-grad-main);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--v2-transition);
    color: white;
    flex-shrink: 0;
}

.btn-chat-send:hover {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* ==========================================
   Feed / Social Posts
   ========================================== */
.feed-search-bar {
    width: 100%;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.feed-search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    color: var(--v2-white);
    font-size: 0.95rem;
    outline: none;
    transition: var(--v2-transition);
    font-family: 'Inter', sans-serif;
}

.feed-search-input:focus {
    border-color: rgba(6, 182, 212, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

.feed-search-input::placeholder {
    color: var(--v2-muted);
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--v2-transition);
    color: var(--v2-muted);
    text-decoration: none;
}

.filter-tab:hover,
.filter-tab.active {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--v2-cyan);
    color: var(--v2-cyan);
}

.post-card {
    background: var(--v2-card-bg);
    border: 1px solid var(--v2-border-color);
    border-radius: 20px;
    padding: 1.75rem;
    transition: var(--v2-transition);
    cursor: pointer;
    text-align: left;
}

.post-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.post-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-category-tag {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    border: 1px solid transparent;
}

.tag-pumps {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.tag-blowers {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
    color: var(--v2-cyan);
}

.tag-scada {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
    color: #c4b5fd;
}

.tag-instrumentation {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--v2-warning);
}

.tag-treatment {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.tag-maintenance {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    color: #fdba74;
}

.tag-general {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--v2-muted);
}

.post-solved-badge {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
}

.post-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--v2-white);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.post-body {
    font-size: 0.9rem;
    color: var(--v2-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-author-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--v2-muted);
}

.post-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--v2-grad-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.post-vote-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--v2-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: var(--v2-transition);
}

.post-vote-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--v2-emerald);
    color: #6ee7b7;
}

.post-comment-count {
    font-size: 0.82rem;
    color: var(--v2-muted);
    margin-left: auto;
}

.ask-cta-banner {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
}

.ask-cta-banner h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.ask-cta-banner p {
    font-size: 0.9rem;
    color: var(--v2-muted);
    margin-bottom: 1.25rem;
}

.btn-platform {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--v2-transition);
    text-decoration: none;
}

.btn-platform-primary {
    background: var(--v2-grad-main);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
}

.btn-platform-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.35);
    color: white;
}

.btn-platform-outline {
    background: transparent;
    border: 2px solid var(--v2-cyan);
    color: var(--v2-cyan);
}

.btn-platform-outline:hover {
    background: rgba(6, 182, 212, 0.1);
    transform: translateY(-2px);
}

.btn-platform-orange {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}

.btn-platform-orange:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35);
    color: white;
}

/* ==========================================
   Profile Page
   ========================================== */
.profile-header-card {
    background: var(--v2-card-bg);
    border: 1px solid var(--v2-border-color);
    border-radius: 28px;
    padding: 2.5rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    background: var(--v2-grad-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border: 3px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
}

.profile-cert-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: var(--v2-warning);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.profile-info {
    flex: 1;
    text-align: left;
}

.profile-info h2 {
    text-align: left;
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

.profile-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1rem;
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--v2-muted);
}

.profile-meta-item span:first-child {
    font-size: 1rem;
}

.specialty-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.specialty-chip {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: var(--v2-cyan);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
}

.stat-card {
    background: var(--v2-card-bg);
    border: 1px solid var(--v2-border-color);
    border-radius: 18px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--v2-transition);
}

.stat-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--v2-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.progress-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
}

.progress-label-row .topic-name {
    color: var(--v2-white);
    font-weight: 600;
}

.progress-label-row .pct {
    color: var(--v2-cyan);
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--v2-grad-main);
    transition: width 1.2s ease;
}

.badge-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 0.875rem 1rem;
    text-align: center;
    min-width: 90px;
    transition: var(--v2-transition);
}

.badge-item:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.06);
    transform: translateY(-2px);
}

.badge-icon {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.25rem;
}

.badge-name {
    font-size: 0.72rem;
    color: var(--v2-muted);
    font-weight: 700;
}

.contrib-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.contrib-item:last-child {
    border-bottom: none;
}

.contrib-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.contrib-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.contrib-meta {
    font-size: 0.78rem;
    color: var(--v2-muted);
    margin-top: 0.2rem;
}

/* ==========================================
   Guild Cards
   ========================================== */
.guilds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.guild-card {
    background: var(--v2-card-bg);
    border: 1px solid var(--v2-border-color);
    border-radius: 24px;
    overflow: hidden;
    transition: var(--v2-transition);
    position: relative;
    text-align: left;
}

.guild-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.guild-banner {
    height: 8px;
}

.guild-body {
    padding: 2rem;
}

.guild-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.guild-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 0.6rem;
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.guild-invite-badge {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--v2-warning);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
}

.guild-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--v2-white);
    margin-bottom: 0.4rem;
    text-align: left;
}

.guild-desc {
    font-size: 0.88rem;
    color: var(--v2-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.guild-stats-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.guild-stat {
    font-size: 0.82rem;
}

.guild-stat-value {
    font-weight: 800;
    color: var(--v2-white);
    display: block;
    font-size: 1rem;
}

.guild-stat-label {
    color: var(--v2-muted);
}

.guild-req {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    font-size: 0.82rem;
    color: var(--v2-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.guild-req strong {
    color: var(--v2-white);
}

/* ==========================================
   Leaderboard Widget
   ========================================== */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    transition: var(--v2-transition);
    font-size: 0.88rem;
}

.lb-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.lb-rank {
    width: 24px;
    font-weight: 800;
    color: var(--v2-muted);
    text-align: center;
    font-size: 0.82rem;
}

.lb-row:nth-child(1) .lb-rank {
    color: #ffd700;
}

.lb-row:nth-child(2) .lb-rank {
    color: #c0c0c0;
}

.lb-row:nth-child(3) .lb-rank {
    color: #cd7f32;
}

.lb-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--v2-grad-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.lb-name {
    flex: 1;
    color: var(--v2-white);
    font-weight: 600;
}

.lb-pts {
    color: var(--v2-warning);
    font-weight: 800;
    font-size: 0.85rem;
}

/* ==========================================
   Section Headers
   ========================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    width: 100%;
}

.section-header h2,
.section-header h3 {
    text-align: left;
    margin: 0;
}

.section-header a {
    font-size: 0.85rem;
    color: var(--v2-cyan);
    text-decoration: none;
    font-weight: 700;
    transition: var(--v2-transition);
}

.section-header a:hover {
    opacity: 0.75;
}

/* ==========================================
   Divider
   ========================================== */
.platform-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    margin: 3rem 0;
    width: 100%;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .side-layout {
        grid-template-columns: 1fr;
    }

    .side-panel {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .platform-header {
        padding: 8rem 0 3rem;
    }

    .side-panel {
        grid-template-columns: 1fr;
    }

    .topic-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .problem-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-header-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-info h2 {
        text-align: center;
    }

    .profile-meta {
        justify-content: center;
    }

    .specialty-chips {
        justify-content: center;
    }

    .guilds-grid {
        grid-template-columns: 1fr;
    }

    .chat-msg .msg-bubble {
        max-width: 90%;
    }
}