:root {
    --glass-bg: rgba(20, 25, 40, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --accent-color: #198754;
    --accent-glow: 0 0 10px rgba(25, 135, 84, 0.5);
    --text-primary: #e0e6ed;
    --text-secondary: #cbd5e1;
    /* Lighter for better contrast */
    --panel-bg: rgba(30, 41, 59, 0.7);
}

body {
    background-color: #000;
    color: var(--text-primary);
    font-family: 'Outfit', 'Inter', sans-serif;
    /* Fonte moderna e arredondada */
    font-weight: 500;
    /* Levemente mais grossa para legibilidade */
    overflow: hidden;
    height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6,
.sidebar-header h5 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    /* Títulos bem grossos */
    letter-spacing: -0.02em;
    /* Aproxima levemente as letras para toque moderno */
}

/* Contrast Overrides */
.text-muted {
    color: var(--text-secondary) !important;
    opacity: 0.8;
}

.text-white {
    color: #ffffff !important;
}

/* Sidebar Styling */
.sidebar {
    background: linear-gradient(180deg,
            rgba(15, 23, 42, 0.95) 0%,
            rgba(20, 25, 40, 0.95) 50%,
            rgba(15, 23, 42, 0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(25, 135, 84, 0.1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    padding-top: 0.5rem;
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.25rem 1.25rem 1.75rem;
    border-bottom: 1px solid rgba(25, 135, 84, 0.15);
    margin-bottom: 1rem;
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(25, 135, 84, 0.4) 50%,
            transparent 100%);
}

.sidebar-header a {
    transition: opacity 0.2s;
}

.sidebar-header a:hover {
    opacity: 0.8;
}

.sidebar-header h5 {
    color: var(--accent-color);
    font-family: 'Space Grotesk', 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(25, 135, 84, 0.3);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.sidebar-header small {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 1.5px;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.85rem 2rem 0.85rem;
    /* Padding bottom extra para garantir rolagem completa */
    scrollbar-gutter: stable;
    /* Evita layout shift */
}

/* Category Styling - Enhanced */
.sidebar-category {
    margin-bottom: 0.75rem;
    border-radius: 10px;
    padding: 0;
    transition: all 0.3s ease;
}

.sidebar-category .category-header {
    padding: 0.75rem 1.1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.sidebar-category .category-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg,
            transparent 0%,
            var(--accent-color) 50%,
            transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-category .category-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.sidebar-category .category-header:hover::before {
    opacity: 0.5;
}

.sidebar-category .category-header[aria-expanded="true"] {
    color: var(--accent-color);
    background: linear-gradient(135deg,
            rgba(25, 135, 84, 0.12) 0%,
            rgba(25, 135, 84, 0.05) 100%);
    border-color: rgba(25, 135, 84, 0.25);
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.1);
}

.sidebar-category .category-header[aria-expanded="true"]::before {
    opacity: 1;
}

.sidebar-category .category-header i.bi-chevron-down {
    transition: all 0.3s ease;
    opacity: 0.6;
    font-size: 0.85rem;
}

.sidebar-category .category-header:hover i.bi-chevron-down {
    opacity: 0.9;
}

.sidebar-category .category-header[aria-expanded="true"] i.bi-chevron-down {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--accent-color);
}

/* Items Styling - Enhanced */
.accordion-collapse {
    border-left: 2px solid rgba(25, 135, 84, 0.15);
    margin-left: 1.1rem;
    margin-top: 0.35rem;
    padding-left: 0.5rem;
    position: relative;
}

.accordion-collapse::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(180deg,
            var(--accent-color) 0%,
            transparent 100%);
    transition: height 0.4s ease;
}

.accordion-collapse.show::before {
    height: 100%;
}

.sidebar-item {
    padding: 0.55rem 1.1rem;
    margin-bottom: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 7px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.01);
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(25, 135, 84, 0.08) 0%,
            transparent 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.sidebar-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(5px);
    border-left: 2px solid rgba(25, 135, 84, 0.3);
    padding-left: calc(1.1rem - 2px);
}

.sidebar-item:hover::before {
    opacity: 1;
}

.sidebar-item.active {
    background: linear-gradient(90deg,
            rgba(25, 135, 84, 0.2) 0%,
            rgba(25, 135, 84, 0.05) 100%);
    color: var(--accent-color);
    font-weight: 600;
    border-left: 3px solid var(--accent-color);
    padding-left: calc(1.1rem - 3px);
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.15);
}

.sidebar-item.active::before {
    opacity: 0.6;
}

.sidebar-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
    transition: all 0.25s;
    filter: drop-shadow(0 0 0 transparent);
}

.sidebar-item:hover i {
    color: var(--accent-color);
    filter: drop-shadow(0 0 6px rgba(25, 135, 84, 0.5));
    transform: scale(1.1);
}

.sidebar-item.active i {
    color: var(--accent-color);
    filter: drop-shadow(0 0 8px rgba(25, 135, 84, 0.6));
}

/* Enhancing Content Area Background with Grid */
.content-area {
    margin-left: 260px;
    height: 100vh;
    padding: 1.5rem;
    /* Reduced padding */
    overflow-y: auto;
    background-color: #0f172a;
    background-image:
        radial-gradient(at 0% 0%, rgba(25, 135, 84, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 0, 0, 0.5) 0px, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    background-position: 0 0, 0 0, -1px -1px, -1px -1px;
}

/* Welcome Screen & Hero */
.hero-section {
    position: relative;
    z-index: 2;
}

.hero-icon-wrapper {
    position: relative;
    display: inline-block;
}

.hero-icon {
    font-size: 2.5rem;
    /* Reduced from 4rem */
    filter: drop-shadow(0 0 10px rgba(25, 135, 84, 0.4));
}

.hero-icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    /* Reduced from 100px */
    height: 60px;
    /* Reduced from 100px */
    background: radial-gradient(circle, rgba(25, 135, 84, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.2;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
}

.welcome-card {
    background: rgba(30, 41, 59, 0.4);
    border: var(--glass-border);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.welcome-card:hover {
    background: rgba(30, 41, 59, 0.85);
    /* Fundo mais claro/sólido */
    transform: translateY(-7px) scale(1.02);
    /* Movimento mais pronunciado */
    border-color: #198754;
    /* Borda verde sólida */
    box-shadow: 0 10px 30px -10px rgba(25, 135, 84, 0.5), 0 0 15px rgba(25, 135, 84, 0.2) inset;
    /* Glow externo e interno */
}

.welcome-card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
}

.welcome-card:hover .icon-box {
    transform: scale(1.1);
    background: rgba(25, 135, 84, 0.2) !important;
    color: #198754 !important;
}

.icon-box {
    width: 36px;
    /* Reduced from 48px */
    height: 36px;
    /* Reduced from 48px */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-box i {
    font-size: 1.1rem;
    /* Specific icon size inside cards */
}

/* Animations */
.animate-fade-up {
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Tool Panel Card */
.card.tool-panel-active {
    background: var(--panel-bg);
    border: var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(8px);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    max-width: 900px;
    /* Optional: Limit width on large screens */
    margin: 0 auto;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

.card-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: var(--glass-border);
    padding: 0.75rem 1.25rem;
}

.card-header h5 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.4rem;
}

.tool-category-badge {
    font-size: 0.9rem;
    padding: 0.35em 0.65em;
}

.card-body {
    padding: 1.5rem;
}

/* Inputs & Forms */
.form-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

/* Inputs Styling */
.form-label,
.form-check-label {
    color: #e2e8f0;
    /* Texto claro (quase branco) */
    font-weight: 500;
}

.form-check-input {
    background-color: rgba(20, 35, 25, 0.6);
    /* Verde bem escuro/neutro */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.4);
}

.form-control,
.form-select {
    background-color: rgb(0 0 0 / 60%);
    /* Verde/Cinza muito escuro, não azul */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    /* Texto claro */
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

/* Fix crítico para cores das opções do Select */
.form-select option {
    background-color: #0d1f15;
    /* Fundo sólido verde escuro para o dropdown */
    color: #e2e8f0;
    padding: 10px;
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(15, 40, 30, 0.8);
    /* Foco mais claro, tom de floresta escura */
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.25);
    outline: none;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Fix para Autofill do Chrome (evita fundo amarelo/branco) - Adaptado para verde */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0d1f15 inset !important;
    /* Verde escuro solido */
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

.tool-panel-desc {
    font-size: 0.9rem;
    margin-bottom: 1.5rem !important;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.2);
    font-weight: 600;
    padding: 0.45rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: var(--glass-border);
    color: var(--text-primary);
    padding: 0.45rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 6px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Clear Button */
.btn-outline-secondary {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
}

/* Results Area */
.result-area {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.25rem;
    border: var(--glass-border);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #a3cfbb;
}

.result-area pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 240px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content-area {
        margin-left: 0;
        padding: 1rem;
    }

    .card-body {
        padding: 1.25rem;
    }
}

/* Global Theme Overrides - Force Green instead of Blue */
.badge,
.badge-primary,
.bg-primary,
.bg-info {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: #20c997 !important;
    /* Verde mais claro/ciano para texto */
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.text-primary,
.text-info {
    color: #20c997 !important;
}

.btn-info {
    background-color: #0d1f15;
    border-color: #198754;
    color: #fff;
}

/* Scrollbar com tom esverdeado */
::-webkit-scrollbar-thumb {
    background: rgba(25, 135, 84, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(25, 135, 84, 0.5);
}

/* Copy Button Style */
.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    background: rgba(25, 135, 84, 0.2);
    color: #fff;
    border-color: rgba(25, 135, 84, 0.4);
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.2);
}

/* Dark Table Styles for Results */
.tool-panel-result .table {
    --bs-table-bg: transparent;
    background-color: transparent !important;
    color: rgba(255, 255, 255, 0.9);
}

.tool-panel-result .table td,
.tool-panel-result .table th {
    background-color: transparent !important;
    color: inherit;
    border-color: rgba(255, 255, 255, 0.1);
}

.tool-panel-result .table .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}