/* 
 * SKiL MATRiX - Profile Page Styles
 * Dark Futuristic Theme | Glassmorphism | Neon Accents
 */

:root {
    --profile-bg: radial-gradient(circle at top right, #0a0e1a 0%, #05070a 100%);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent-blue: #00d2ff;
    --accent-purple: #9d50bb;
    --neon-glow-blue: 0 0 15px rgba(0, 210, 255, 0.4);
    --neon-glow-purple: 0 0 15px rgba(157, 80, 187, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
}

.profile-wrapper {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

/* Background Particles Placeholder */
.profile-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: var(--profile-bg);
}

/* Header Section */
.profile-header-card {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 3rem;
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.profile-avatar-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.avatar-main {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-border);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--neon-glow-blue);
    cursor: pointer;
}

.avatar-main:hover {
    transform: scale(1.05);
    border-color: var(--accent-blue);
}

.avatar-overlay {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    font-size: 0.8rem;
    color: white;
    text-align: center;
    padding: 1rem;
}

.profile-avatar-container:hover .avatar-overlay {
    opacity: 1;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at center, var(--accent-blue) 0%, #121826 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
    border: 4px solid var(--card-border);
    box-shadow: var(--neon-glow-blue);
    cursor: pointer;
}

/* Interactive Form States */
.cyber-input:focus, 
.cyber-select:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2) !important;
    background: rgba(0, 210, 255, 0.05) !important;
}

.avatar-overlay {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    font-size: 0.8rem;
    color: white;
    text-align: center;
    padding: 1rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.greeting-row {
    margin-bottom: 0.25rem;
}

.greeting-text {
    font-size: 0.9rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0.2rem 0;
    color: #ffffff;
    letter-spacing: -1px;
    line-height: 1.1;
    text-transform: uppercase;
}

.user-email {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.profile-header-btns {
    display: flex;
    gap: 1rem;
}

.profile-header-btns .btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 700;
    padding: 0.8rem 1.8rem;
    border-radius: 14px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.profile-header-btns .btn-ghost i {
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-header-btns .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.25);
    color: #ffffff;
}

.profile-header-btns .btn-ghost:active {
    transform: translateY(-1px) scale(0.98);
}

/* Grid Layout for Forms */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--accent-blue);
}

/* Form Styling */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-weight: 600;
}

.cyber-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.cyber-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 210, 255, 0.05);
    box-shadow: var(--neon-glow-blue);
}

.skill-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.skills-entry {
    display: flex;
    gap: 0.5rem;
}

.skill-level-group {
    flex: 0.5;
}

.btn-add-skill-mobile {
    height: 42px;
    width: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cyber-select {
    appearance: none;
    background: #121826;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: white !important;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300d2ff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 15px) center;
    padding-right: 2.5rem;
}

.cyber-select option {
    background-color: #0a0e1a;
    color: white;
    padding: 10px;
}

/* Specific Row Layouts */
.contact-row {
    display: flex;
    gap: 1rem;
}

.country-group {
    flex: 0.35;
}

.phone-group {
    flex: 0.65;
}

.academic-details {
    display: flex;
    gap: 1rem;
}

.academic-details .input-group {
    flex: 1;
}

/* Skill Matrix */
.skill-matrix-container {
    grid-column: span 2;
}

.skills-layout {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.radar-wrapper {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.05) 0%, transparent 70%);
}

.skills-manager {
    flex: 1;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.skill-tag {
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}

.skill-tag i {
    cursor: pointer;
    opacity: 0.6;
}

.skill-tag i:hover {
    opacity: 1;
    color: #ff4757;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255,255,255,0.05);
    transform: translateY(-5px);
    border-color: var(--accent-purple);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Profile Completion Ring */
.completion-container {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ring-svg {
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 6;
}

.ring-progress {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

/* Mobile Desktop (Tablet) Responsive */
@media (max-width: 1024px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .contact-row, .academic-details, .form-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    .profile-header-card {
        padding: 2rem;
        gap: 2rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .stat-card {
        padding: 1rem;
    }
    .skill-matrix-container {
        grid-column: span 1;
    }
    .skills-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    .radar-wrapper {
        width: 100%;
        max-width: 280px;
        height: 280px;
        margin: 0 auto;
    }
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .skill-matrix-container {
        grid-column: span 1;
    }
    .skills-layout {
        flex-direction: column;
        gap: 2rem;
    }
    .radar-wrapper {
        width: 100%;
        max-width: 280px;
        height: 280px;
        margin: 0 auto;
    }
    .profile-header-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    .profile-info {
        margin-top: 1rem;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .greeting-text {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
        justify-content: center;
    }
    .user-name {
        font-size: 1.6rem;
        margin-bottom: 0;
    }
    .user-email {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        width: 100%;
        text-align: center;
    }
    .profile-header-btns {
        display: flex;
        gap: 1rem;
        margin-top: 1.5rem;
        justify-content: center;
        width: 100%;
    }
    .profile-avatar-container {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }
    .avatar-fallback {
        font-size: 2rem;
    }
    .academic-details, .form-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .completion-container {
        position: relative;
        top: 0;
        right: 0;
        margin: 0 auto 0.5rem;
        width: fit-content;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        padding: 0.5rem 1.2rem;
        border-radius: 10px;
        order: -1; 
        border: 1px solid var(--card-border);
    }

    .completion-container svg {
        width: 50px;
        height: 50px;
    }
    
    .completion-container #completion-text {
        font-size: 0.75rem !important;
    }

    .ring-bg, .ring-progress {
        r: 45;
        stroke-width: 6;
    }
    
    .profile-wrapper {
        padding: 0.5rem;
        padding-top: 1rem;
        padding-bottom: 5rem;
    }

    .skill-input-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .skill-level-group {
        flex: 1;
        margin-bottom: 0.5rem;
    }

    .btn-add-skill-mobile {
        width: 100%;
        height: 48px;
        border-radius: 12px;
    }

    .profile-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding-bottom: 6rem; /* Space for FAB buttons */
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .user-name {
        font-size: 1.75rem;
    }
    .user-email {
        font-size: 0.85rem;
    }
    .section-title {
        font-size: 1.1rem;
    }
    .glass-card {
        padding: 1.5rem;
    }
}

/* Save Animation */
.saved-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #00ff88;
    color: #05070a;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(100px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.saved-indicator.active {
    transform: translateY(0);
}

/* Auth Guard Styling */
.profile-auth-guard {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 1.5rem;
}

.guard-card {
    max-width: 540px;
    text-align: center;
    padding: 2.5rem 2rem;
    animation: slideUpFade 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.guard-icon {
    font-size: 3rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    text-shadow: var(--neon-glow-blue);
}

.guard-card h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.accent-text {
    background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.guard-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.feature-highlights {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
    margin-bottom: 2.5rem;
}

.feature-item {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.feature-item i {
    font-size: 1.25rem;
    color: var(--accent-purple);
    width: 24px;
    text-align: center;
}

.feature-item h4 {
    color: white;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.guard-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: var(--neon-glow-blue);
}

.guard-footer {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   EDIT / VIEW MODE TOGGLE
   ============================================= */

/* Default: View Mode — inputs are read-only */
.profile-wrapper:not(.mode-editing) .cyber-input,
.profile-wrapper:not(.mode-editing) .cyber-select {
    pointer-events: none;
    opacity: 0.85;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    cursor: default;
    border-radius: 10px;
}

/* View Mode: disable skill inputs and hide add buttons */
.profile-wrapper:not(.mode-editing) .skill-input-row .btn,
.profile-wrapper:not(.mode-editing) .btn-add-skill-mobile {
    display: none !important;
}

.profile-wrapper:not(.mode-editing) .skill-input-row input[type="range"] {
    pointer-events: none;
    opacity: 0.5;
}

/* View mode: hide skill remove buttons */
.profile-wrapper:not(.mode-editing) .skill-tag i {
    display: none;
}

/* View Mode: dim avatar container */
.profile-wrapper:not(.mode-editing) .profile-avatar-container::after {
    content: none;
}

/* Edit Mode: animate the Save button */
#save-profile-btn {
    animation: pulseSave 2s ease-in-out infinite;
}

@keyframes pulseSave {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
}

/* Edit Mode: show edit hint on avatar */
.profile-wrapper.mode-editing .profile-avatar-container:hover::after {
    content: '📷 Change';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #00ff88;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 8px;
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 1px;
}

/* =============================================
   REFERRAL CARD
   ============================================= */

.referral-card {
    position: relative;
    background: linear-gradient(135deg, rgba(0,210,255,0.04) 0%, rgba(157,80,187,0.04) 100%);
    border: 1.5px solid rgba(0,210,255,0.2);
    border-radius: 24px;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.3s ease;
}
.referral-card:hover { border-color: rgba(0,210,255,0.45); }

.referral-card-glow {
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(0,210,255,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.referral-card-inner {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.referral-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.referral-icon-wrap {
    width: 42px; height: 42px;
    background: rgba(0,210,255,0.08);
    border: 1px solid rgba(0,210,255,0.25);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px;
}

.referral-stats-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.ref-stat-pill {
    flex: 1;
    min-width: 100px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 0.75rem;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.ref-stat-pill:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.16); }

.ref-stat-num {
    display: block;
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.3rem;
    font-family: 'JetBrains Mono', monospace;
}

.ref-stat-lbl {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.referral-code-section,
.referral-link-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.referral-code-label {
    font-size: 0.63rem;
    letter-spacing: 2.5px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
}

.referral-code-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #00d2ff 0%, #9d50bb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: codeGlow 3s ease-in-out infinite alternate;
}

@keyframes codeGlow {
    from { filter: drop-shadow(0 0 8px rgba(0,210,255,0.2)); }
    to   { filter: drop-shadow(0 0 22px rgba(0,210,255,0.55)); }
}

.referral-link-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.referral-link-input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    cursor: text;
    transition: border-color 0.25s;
}
.referral-link-input:focus { border-color: var(--accent-blue); }

.ref-copy-btn {
    width: 42px; height: 42px;
    background: rgba(0,210,255,0.1);
    border: 1px solid rgba(0,210,255,0.3);
    border-radius: 10px;
    color: var(--accent-blue);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
}
.ref-copy-btn:hover { background: rgba(0,210,255,0.25); transform: scale(1.08); }

.referral-share-btns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ref-share-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.ref-wa {
    background: linear-gradient(135deg, rgba(37,211,102,0.15), rgba(37,211,102,0.06));
    border: 1px solid rgba(37,211,102,0.35);
    color: #25d366;
}
.ref-wa:hover {
    background: linear-gradient(135deg, rgba(37,211,102,0.3), rgba(37,211,102,0.12));
    box-shadow: 0 4px 18px rgba(37,211,102,0.22);
    transform: translateY(-2px);
    color: #25d366;
}

.ref-tw {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.75);
}
.ref-tw:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    color: #fff;
}

.ref-tg {
    background: linear-gradient(135deg, rgba(0,136,204,0.15), rgba(0,136,204,0.06));
    border: 1px solid rgba(0,136,204,0.35);
    color: #29b6f6;
}
.ref-tg:hover {
    background: linear-gradient(135deg, rgba(0,136,204,0.3), rgba(0,136,204,0.12));
    box-shadow: 0 4px 18px rgba(0,136,204,0.25);
    transform: translateY(-2px);
    color: #29b6f6;
}

.ref-li {
    background: linear-gradient(135deg, rgba(10,102,194,0.15), rgba(10,102,194,0.06));
    border: 1px solid rgba(10,102,194,0.35);
    color: #0a66c2;
}
.ref-li:hover {
    background: linear-gradient(135deg, rgba(10,102,194,0.3), rgba(10,102,194,0.12));
    box-shadow: 0 4px 18px rgba(10,102,194,0.25);
    transform: translateY(-2px);
    color: #0a9cff;
}

.ref-mail {
    background: linear-gradient(135deg, rgba(123,97,255,0.15), rgba(123,97,255,0.06));
    border: 1px solid rgba(123,97,255,0.35);
    color: #a78bfa;
}
.ref-mail:hover {
    background: linear-gradient(135deg, rgba(123,97,255,0.3), rgba(123,97,255,0.12));
    box-shadow: 0 4px 18px rgba(123,97,255,0.25);
    transform: translateY(-2px);
    color: #c4b5fd;
}

.ref-native {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
}
.ref-native:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    color: #fff;
}

/* =============================================
   BADGES CARD
   ============================================= */

.badges-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 24px;
    padding: 2rem;
}

.badges-tier-section { margin-bottom: 2rem; }
.badges-tier-section:last-child { margin-bottom: 0; }

.badges-tier-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 0.65rem;
}

.badge-tile {
    position: relative;
    background: rgba(255,255,255,0.025);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 0.85rem 0.5rem 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
    overflow: visible;
}

.badge-tile.earned:hover {
    transform: translateY(-6px) scale(1.04);
}

.badge-tile.locked {
    filter: grayscale(0.7);
    opacity: 0.5;
}
.badge-tile.locked:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

.badge-svg-wrap {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.badge-tile.earned:hover .badge-svg-wrap {
    transform: scale(1.12) rotate(6deg);
    filter: drop-shadow(0 4px 12px rgba(255,255,255,0.15));
}

.badge-lock-overlay {
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    color: rgba(255,255,255,0.45);
}

.badge-earned-check {
    position: absolute;
    top: 8px; right: 8px;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #000;
    font-weight: 900;
}

.badge-name {
    font-size: 0.63rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    text-align: center;
    line-height: 1.3;
}

.badge-tier-pill {
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 1px solid;
    border-radius: 4px;
    padding: 0.08rem 0.35rem;
    opacity: 0.7;
}

/* Tooltip */
.badge-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8,12,22,0.98);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    min-width: 160px;
    max-width: 210px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 200;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 36px rgba(0,0,0,0.6);
    transform: translateX(-50%) translateY(4px);
}
.badge-tile:hover .badge-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.badge-tooltip strong {
    display: block;
    font-size: 0.82rem;
    color: #fff;
    margin-bottom: 0.25rem;
}
.badge-tooltip span {
    font-size: 0.74rem;
    color: rgba(255,255,255,0.52);
    line-height: 1.45;
}
.badge-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(255,255,255,0.14);
}

/* Mobile */
@media (max-width: 768px) {
    .referral-stats-row { flex-direction: column; }
    .referral-share-btns { flex-direction: column; }
    .ref-share-btn { min-width: unset; }
    .referral-code-display { font-size: 1.7rem; letter-spacing: 5px; }
    .badges-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 0.5rem; }
    .badge-svg-wrap { width: 36px; height: 36px; }
    .badge-tooltip { display: none; } /* avoid tooltip overflow on mobile */
}
