﻿/* Funcionalidades Page Specific Layout */
body { background-color: var(--bg-color); color: var(--text-primary); }

.func-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 80px);
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 100px;
}

/* Sidebar Dropdown Menu */
.func-sidebar {
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    background: var(--bg-color);
}

.category-group { margin-bottom: 1.5rem; }

.category-title {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color 0.2s;
}

.category-title:hover { color: var(--primary); }

.subcategory-list {
    list-style: none;
    padding-top: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
}

.category-group.open .subcategory-list { display: flex; }
.category-group.open .category-title svg { transform: rotate(180deg); }

.subcategory-item {
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.subcategory-item:hover, .subcategory-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

/* Main Content Area */
.func-main {
    padding: 3rem 4rem;
    overflow: visible !important;
}

.func-detail {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
    overflow: visible !important;
}

.func-detail.active {
    display: block;
}

.func-detail h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.func-detail .badge { margin-bottom: 1rem; }

.func-detail p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.func-feature-list {
    list-style: none;
    margin-top: 2rem;
    overflow: visible !important;
}

.func-feature-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    overflow: visible !important;
}

.func-feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* Mobile Sidebar Overlay */
.mobile-menu-toggle {
    display: none;
    width: 100%;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: white;
    font-family: var(--font-title);
    font-size: 1.1rem;
    text-align: left;
    position: sticky;
    top: 70px;
    z-index: 90;
    border-radius: 8px;
    margin: 1rem 0;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 992px) {
    .func-layout { display: block; padding: 80px 1rem 2rem 1rem; }
    .func-main { padding: 1.5rem 0; }
    .mobile-menu-toggle { display: flex; }
    .func-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
        background: var(--bg-color);
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    .func-sidebar.open { left: 0; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.7);
        z-index: 99;
        backdrop-filter: blur(4px);
    }
    .sidebar-overlay.active { display: block; }
}

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

/* ===================================================
   Tooltip (i) Info Badge Component
   =================================================== */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(100, 29, 222, 0.35);
    border: 1px solid #a78bfa;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-title), sans-serif;
    cursor: pointer;
    margin-left: 6px;
    position: relative;
    vertical-align: middle;
    user-select: none;
    transition: all 0.25s ease;
    box-shadow: 0 0 8px rgba(100, 29, 222, 0.4);
}

.info-icon:hover, .info-icon.active-tooltip {
    background: #641dde;
    color: #ffffff;
    border-color: #c4b5fd;
    transform: scale(1.1);
    box-shadow: 0 0 14px rgba(100, 29, 222, 0.9);
}

/* Floating Tooltip Box */
.info-icon .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #11111c;
    border: 1px solid #a78bfa;
    color: #f8fafc;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 400;
    font-style: normal;
    white-space: normal;
    width: 280px;
    box-shadow: 0 14px 35px rgba(0,0,0,0.9), 0 0 20px rgba(100,29,222,0.5);
    z-index: 999999;
    line-height: 1.45;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.info-icon .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #11111c transparent transparent transparent;
}

.info-icon:hover .tooltip-text,
.info-icon:focus .tooltip-text,
.info-icon.active-tooltip .tooltip-text {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(-50%) translateY(-4px) !important;
}

@media (max-width: 600px) {
    .info-icon .tooltip-text {
        width: 220px;
        left: 0;
        transform: translateX(-30%);
    }
    .info-icon .tooltip-text::after {
        left: 30%;
    }
}

/* ===================================================
   Search Bar Component
   =================================================== */
.search-container {
    position: relative;
    width: 100%;
}
.search-input {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 2.5rem;
    font-size: 0.95rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    transition: all 0.3s ease;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.clear-icon {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    transition: all 0.2s;
    padding: 3px;
    z-index: 10;
}
.clear-icon:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}
