:root {
    --bg-dark: #020617;
    --sidebar-bg: #0f172a;
    --accent-green: #22c55e;
    --accent-green-glow: rgba(34, 197, 94, 0.4);
    --accent-orange: #22c55e;
    /* Alterado para verde */
    --accent-blue: #3b82f6;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --card-bg: rgba(15, 23, 42, 0.6);
    --border-color: rgba(255, 255, 255, 0.05);
    --transition-speed: 0.3s;
    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Glassmorphism Classes */
.glass {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    padding: 2.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    text-decoration: none;
    color: white;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.logo-bold {
    font-weight: 900;
    color: var(--accent-green);
    margin-right: 4px;
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.3));
}

.logo-img {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: block;
}

.sidebar-nav {
    padding-top: 1.5rem;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav li.active a {
    color: white;
    background: rgba(34, 197, 94, 0.05);
    border-left: 3px solid var(--accent-green);
    padding-left: calc(1.8rem - 3px);
    box-shadow: inset 10px 0 20px -10px rgba(34, 197, 94, 0.2);
}

.sidebar-nav li.active a i {
    color: var(--accent-green);
    filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.5));
    opacity: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.8rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.85rem;
    gap: 1.2rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.sidebar-nav a:hover:not(.active) {
    color: white;
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(4px);
}

.sidebar-nav a i {
    width: 24px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
}

/* FAQ / Ajuda Section Styling */
.help-section {
    padding: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-title {
    color: var(--accent-green);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

.faq-container {
    display: flex;
    flex-direction: column;
}

.faq-item {
    border-bottom: 2px solid #233554;
}

.faq-question {
    padding: 1.2rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
    transition: all 0.2s ease;
}

.faq-question:hover {
    color: var(--accent-green);
}

.faq-question i {
    font-size: 1rem;
    transition: transform 0.3s ease;
    color: #475569;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.95rem;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding-bottom: 1.5rem;
}

.faq-item.active .faq-question {
    color: var(--accent-green);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: var(--accent-green);
}

.faq-item.active {
    border-bottom: 2px solid var(--accent-green);
}

/* Sub-nav Styling */
.sub-nav {
    list-style: none;
    padding-left: 3.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav li.expanded .sub-nav {
    max-height: 300px;
    /* Large enough to fit content */
    opacity: 1;
    margin-bottom: 1rem;
}



.has-submenu a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.has-submenu a::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: auto;
    opacity: 0.5;
}

.has-submenu.expanded a::after {
    transform: rotate(180deg);
    opacity: 1;
}

.sub-nav a {
    padding: 0.4rem 0 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    text-transform: none !important;
    background: none !important;
    border: none !important;
    letter-spacing: 0 !important;
}

.sidebar-nav li.logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, #0f172a 0%, #020617 100%);
}

/* Top Bar Styling */
.top-bar {
    height: 80px;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: sticky;
    top: 0;
    z-index: 90;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    overflow: hidden;
}

.badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.marquee {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
    animation: marquee-scroll 25s linear infinite;
    opacity: 0.9;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(30%);
    }

    100% {
        transform: translateX(-100%);
    }
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.username {
    font-weight: 600;
    font-size: 0.95rem;
    background: linear-gradient(90deg, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.progress-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.8s ease-in-out;
    stroke-linecap: round;
}

.progress-text {
    position: absolute;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* Premium Hero Landing */
.hero-landing {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    padding: 2rem 4rem;
    /* Reduzi padding */
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 70% 50%, rgba(34, 197, 94, 0.05) 0%, transparent 50%);
}

.hero-landing .hero-content {
    max-width: 650px;
    z-index: 2;
    animation: slideRight 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-badge {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.2);
    margin-bottom: 1rem;
    /* Reduzi margem */
    display: inline-block;
    box-shadow: none;
}

.hero-landing h1 {
    font-size: 3.5rem;
    /* Reduzi tamanho */
    line-height: 1.1;
    margin-bottom: 1rem;
    /* Reduzi margem */
    font-weight: 800;
}

.hero-landing h1 span {
    color: var(--accent-green);
    position: relative;
}

.hero-landing p {
    font-size: 1.1rem;
    /* Reduzi tamanho */
    color: var(--text-secondary);
    margin-bottom: 2rem;
    /* Reduzi margem para subir o botão */
    line-height: 1.6;
}

.cta-main-btn {
    background: linear-gradient(135deg, var(--accent-green), #16a34a);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.3);
}

.cta-main-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(34, 197, 94, 0.5);
}

.hero-visual {
    position: absolute;
    right: -10%;
    top: 50%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    z-index: 1;
}

.glow-circle {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: pulseGlow 4s infinite ease-in-out;
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
}

.scroll-indicator i {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-12px);
    }

    60% {
        transform: translateY(-6px);
    }
}

/* Brand Feature Section Styles */
.brand-feature-section {
    padding: 6rem 4rem 2rem 4rem;
}

.brand-content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.brand-text-side h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 900;
}

.brand-features-mini {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.f-mini {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* About Section Styles */
.about-section {
    padding: 6rem 4rem;
    background: linear-gradient(180deg, transparent 0%, rgba(34, 197, 94, 0.02) 100%);
}

.about-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.mini-badge-v2 {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.about-info-card h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.green-text {
    color: var(--accent-green);
}

.about-info-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-stats-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    backdrop-filter: blur(10px);
}

.target-score {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.score-num {
    font-size: 4rem;
    font-weight: 900;
    color: var(--accent-green);
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.score-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    line-height: 1.2;
}

.target-info h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.target-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.check-list li i {
    color: var(--accent-green);
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* Topic List Style (Improved Grid) */
.topics-list {
    padding: 2rem 4rem 6rem 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.topic-item {
    background: #0f1c30;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 100px;
}

.topic-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-green);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.topic-item:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 197, 94, 0.2);
    background: #142540;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.topic-item:hover::before {
    opacity: 1;
}

.topic-icon-circle {
    width: 50px;
    height: 50px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.topic-item:hover .topic-icon-circle {
    background: var(--accent-green);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.topic-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    flex: 1;
}

.topic-text em {
    font-style: italic;
    font-weight: 400;
    color: var(--text-secondary);
    display: block;
    font-size: 0.9rem;
    margin-top: 2px;
}

/* Section Titles */
.section-title-wrapper {
    max-width: 1000px;
    margin: 4rem auto 2rem;
    padding: 0 4rem;
}

.section-title-wrapper h2 {
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title-wrapper h2 i {
    color: var(--accent-green);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar a span,
    .sidebar .logo span:last-child {
        display: none;
    }

    .main-content {
        margin-left: 80px;
    }

    .logo {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .top-bar-left {
        display: none;
    }

    .top-bar {
        padding: 0 1.5rem;
    }
}

/* Profile Page Styles */
.profile-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.profile-header-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.profile-card {
    background: #0f2744;
    border: 1px solid #1e3a5f;
    border-radius: 20px;
    padding: 2rem;
    display: flex;
}

.user-info {
    align-items: center;
    gap: 2.5rem;
}

.avatar-large {
    font-size: 5rem;
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid rgba(34, 197, 94, 0.3);
}

.user-details h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.user-rank {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

.user-badges {
    display: flex;
    gap: 0.8rem;
}

.mini-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mini-badge i {
    color: var(--accent-orange);
}

.ibt-gauge-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.gauge-container {
    position: relative;
    width: 140px;
    height: 140px;
}

.main-gauge {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke: var(--accent-green);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 800;
}

.gauge-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.gauge-desc strong {
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat-box {
    background: #0f1c35;
    border: 1px solid #1e293b;
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-orange);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section Cards */
.profile-section-card {
    background: #0f2744;
    border: 1px solid #1e3a5f;
    border-radius: 20px;
    padding: 2rem;
}

.profile-section-card h3 {
    margin-bottom: 2rem;
    font-size: 1.3rem;
    border-left: 4px solid var(--accent-green);
    padding-left: 1rem;
}

.table-container {
    overflow-x: auto;
}

.recent-table {
    width: 100%;
    border-collapse: collapse;
}

.recent-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.recent-table td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.res-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.res-badge.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.res-badge.fail {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.themes-progress-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.theme-progress-item {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.theme-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 500;
}

.p-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    top: -10px;
}

.p-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #4ade80);
    border-radius: 5px;
}

/* --- RESPONSIVE DESIGN: PREMIUM MOBILE OVERHAUL --- */

/* Tablet / Medium Screens */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        transition: width 0.3s;
    }

    .sidebar .logo-bold+span,
    .sidebar-nav a span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
    }

    .sidebar-nav a {
        justify-content: center;
        padding: 1.5rem 0;
    }

    .sidebar-nav a i {
        margin-right: 0;
        font-size: 1.4rem;
    }
}

/* Smartphone (Telemóvel) - Unified Header Approach */
@media (max-width: 768px) {

    /* GLOBAL MOBILE INTERACTION FIXES */
    *,
    *:hover,
    *:active {
        -webkit-tap-highlight-color: transparent !important;
    }

    button,
    a,
    .topic-item,
    .option-btn,
    .nav-btn {
        touch-action: manipulation;
    }

    /* Disable all sticky hover transforms on mobile */
    .topic-item:hover,
    .option-btn:hover,
    .nav-btn:hover,
    .sidebar-nav a:hover {
        transform: none !important;
    }

    /* Standard active press feedback for all clickable things */
    .option-btn:active,
    .nav-btn:active,
    .cta-main-btn:active {
        transform: scale(0.96) !important;
        opacity: 0.8;
    }

    .app-container {
        flex-direction: column !important;
    }

    .cta-main-btn {
        width: 100% !important;
        justify-content: center;
        padding: 1.4rem !important;
        /* Aumentado para melhor toque */
        border-radius: 20px !important;
        font-size: 1.15rem !important;
        box-shadow: 0 10px 30px rgba(34, 197, 94, 0.4);
    }

    /* 1. Barra de Navegação Superior Fixa (Taskbar) - PERSISTENTE E GLOBAL */
    .sidebar {
        width: 100% !important;
        height: 64px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        flex-direction: row !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 1rem !important;
        background: #020617 !important;
        border-right: none !important;
        border-bottom: 2px solid var(--accent-green) !important;
        z-index: 999999 !important;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8);
        transform: translateZ(0);
    }

    /* Logo: Apenas ícone, fixo à esquerda */
    .sidebar-header {
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    .logo {
        font-size: 0 !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
    }

    .logo span,
    .logo-bold {
        display: none !important;
    }

    .logo-img {
        width: 34px !important;
        height: 34px !important;
        margin: 0 !important;
    }

    /* Navegação: Flexível para ocupar espaço e alinhar à direita */
    .sidebar-nav {
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex: 1 !important;
        justify-content: flex-end !important;
        width: auto !important;
    }

    .sidebar-nav ul {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.2rem !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        align-items: center !important;
    }

    .sidebar-nav li {
        margin: 0 !important;
        padding: 0 !important;
    }

    .sidebar-nav a {
        width: 58px !important;
        /* Ligeiramente maior para melhor toque */
        height: 64px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0 !important;
        color: transparent !important;
        text-decoration: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        /* PERFORMANCE E TOQUE: Garantir cliques instantâneos */
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        position: relative !important;
        z-index: 10 !important;
        user-select: none !important;
        /* Evita selecionar texto ao clicar rápido */
    }

    /* REMOVER EFEITOS DE HOVER NO MOBILE - Causam o bug de duplo toque */
    .sidebar-nav a:hover {
        transform: none !important;
        background: transparent !important;
        color: transparent !important;
    }

    .sidebar-nav a i {
        font-size: 1.5rem !important;
        /* Ícone ligeiramente maior */
        color: #94a3b8 !important;
        margin: 0 !important;
        transition: transform 0.1s ease !important;
        pointer-events: none !important;
        /* Garante que o clique vai para o 'a' */
    }

    /* Feedback tátil imediato ao pressionar */
    .sidebar-nav a:active i {
        transform: scale(0.85) !important;
        color: var(--accent-green) !important;
    }

    .sidebar-nav li.active a i {
        color: var(--accent-green) !important;
        filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.4)) !important;
        transform: none !important;
    }

    /* 2. Conteúdo Principal */
    .main-content {
        margin-left: 0 !important;
        margin-top: 64px !important;
        width: 100% !important;
        padding-bottom: 2rem !important;
        /* Otimização de scroll */
        -webkit-overflow-scrolling: touch;
    }

    /* Desativar Sticky Top Bar no Mobile - Evita sobreposições */
    .top-bar {
        position: relative !important;
        top: auto !important;
        padding: 1.5rem 1rem !important;
        height: auto !important;
        background: transparent !important;
        border: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.2rem;
    }

    /* Ocultar barra de topo na Home (Landing) para mobile - Estética Limpa */
    .top-bar:has(+ .hero-landing) {
        display: none !important;
    }

    /* Caso o seletor :has não seja suportado em browsers muito antigos, 
       podemos usar margem negativa na hero se estiver logo a seguir */
    .hero-landing {
        margin-top: 0 !important;
    }

    .top-bar-left {
        display: none !important;
    }

    .top-bar-right {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .user-profile {
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    .username {
        font-size: 0.95rem !important;
        color: white !important;
        font-weight: 600 !important;
        background: none !important;
        -webkit-text-fill-color: initial !important;
    }

    .progress-container {
        width: 42px !important;
        height: 42px !important;
    }

    /* 3. Perfil & Cards */
    .profile-content {
        padding: 1rem !important;
    }

    .profile-header-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .profile-card {
        border-radius: 24px !important;
        background: #0f1c35 !important;
        padding: 2rem 1.2rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        margin: 0 !important;
        /* Performance */
        box-shadow: none !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
    }

    .user-info {
        gap: 1.5rem !important;
    }

    .profile-avatar {
        width: 100px !important;
        height: 100px !important;
    }

    .user-details h2 {
        font-size: 1.7rem !important;
        margin-bottom: 0.5rem !important;
    }

    .user-badges {
        justify-content: center !important;
        width: 100% !important;
        display: flex !important;
        gap: 0.8rem !important;
    }

    .stats-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.8rem !important;
        width: 100% !important;
    }

    .stat-box {
        padding: 1.2rem 0.8rem !important;
        align-items: center !important;
        text-align: center !important;
    }

    .profile-section-card {
        border-radius: 20px !important;
        padding: 1.5rem !important;
        text-align: center !important;
    }

    .profile-section-card h3 {
        justify-content: center !important;
        font-size: 1.25rem !important;
    }

    /* 4. Categorias & Listas */
    .section-title-wrapper {
        padding: 3rem 1.5rem 1rem 1.5rem !important;
        text-align: center;
    }

    .section-title-wrapper h2 {
        font-size: 1.6rem !important;
        justify-content: center;
    }

    .topics-list {
        display: flex !important;
        flex-direction: column !important;
        padding: 1rem 1.5rem !important;
        gap: 1rem;
    }

    .topic-item {
        padding: 1.25rem !important;
        min-height: 85px !important;
        border-radius: 18px !important;
        background: rgba(30, 41, 59, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        width: 100% !important;
        /* PERFORMANCE: Instant touch feedback */
        touch-action: manipulation;
        transition: transform 0.1s ease, background-color 0.2s ease !important;
    }

    .topic-item:hover {
        transform: none !important;
        background: rgba(30, 41, 59, 0.6) !important;
    }

    .topic-item:active {
        transform: scale(0.97) !important;
        background: rgba(34, 197, 94, 0.1) !important;
    }

    .topic-item::before {
        display: none !important;
        /* Remove barra lateral no mobile para simplificar */
    }

    .topic-icon-circle {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
    }

    .topic-text {
        font-size: 1.05rem !important;
    }

    /* 6. Seções Adicionais */
    .profile-section-card {
        margin: 0 0 1.5rem 0 !important;
        padding: 1.5rem !important;
        border-radius: 24px !important;
        text-align: center;
    }

    .profile-section-card h3 {
        font-size: 1.2rem !important;
        margin-bottom: 1.5rem !important;
        justify-content: center;
    }

    .table-container {
        margin: 0 -0.5rem;
    }

    .recent-table td,
    .recent-table th {
        padding: 0.8rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Simuladores */
    .quiz-container {
        padding: 1.5rem !important;
        margin-top: 0 !important;
    }
}

/* Telas ultra-pequenas */
@media (max-width: 375px) {
    .sidebar-nav a {
        width: 42px !important;
    }

    .username {
        font-size: 0.8rem !important;
    }

    .stats-grid {
        gap: 0.8rem !important;
    }
}