/* Estilos padrão */
@import url('clarinha-theme-variables.css');
@import url('clarinha-header.css');
@import url('clarinha-footer.css');

/* Estilos do body */
body {
    background-color: var(--background-color);
    color: var(--text-color);
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 0;
}

.options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.options h1 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: var(--text-color);
}

/* Campo de busca */
.search-container {
    display: flex;
    width: 360px;
}

#searchInput {
    width: 100%;
    padding: 10px 24px;
    border: 1px solid var(--search-border);
    border-radius: 25px;
    background-color: var(--search-background);
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#searchInput:focus {
    background-color: var(--search-background);
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    caret-color: var(--constraint-color);
}

/* Container de comandos */
#command-container {
    width: 80%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Categorias */
.category {
    color: #fff;
    font-weight: 600;
    font-size: 1.3rem;
    border-radius: 10px;
    padding: 5px 20px;
    text-align: center;
    height: 45px;
    width: fit-content;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category.Moderação {
    background-color: var(--color-moderacao);
}

.category.Utilidade {
    background-color: var(--color-utilidade);
}

.category.Diversão {
    background-color: var(--color-diversao);
}

.category.Economia {
    background-color: var(--color-economia);
}

.category svg {
    margin-right: 10px;
}

/* Cards de comando */
.command-card {
    background: var(--card-background);
    padding: 15px;
    border-radius: 5px;
    box-shadow: var(--card-shadow);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    min-height: 60px;
}

.command-card.expanded {
    max-height: 1000px;
}

.command-name {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 6px;
}

.command-name::first-letter {
    text-transform: uppercase;
}

.command-description {
    display: flex;
    justify-content: space-between;
    white-space: normal;
    overflow: visible;
    height: auto;
    line-height: 1.4;
    gap: 10px;
    width: 100%;
}

.arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: #888;
    flex-shrink: 0;
}

.arrow::before {
    display: inline-block;
    transition: transform 0.3s ease;
}

.arrow.collapsed::before {
    content: '▼';
    transform: rotate(0deg);
}

.arrow.expanded::before {
    content: '▲';
    transform: rotate(360deg);
}

/* Exemplos de comando */
.command-example {
    margin-top: 5px;
}

.command-example .example-label {
    font-weight: 500;
    color: var(--text-color);
}

.command-example code {
    font-style: italic;
    background-color: var(--example-background);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Subcomandos */
.subcommand-container {
    background-color: var(--subcommand-background);
    padding: 10px;
    border: 1px solid var(--subcommand-border);
    border-radius: 5px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
}

.subcommand-card {
    height: auto;
    overflow: visible;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.subcommand-card:last-child {
    margin-bottom: 0;
}

.subcommand-example code {
    background-color: var(--example-code-background);
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--example-code-color);
}

.subcommand-card .command-example {
    color: var(--text-color);
    display: block;
    margin-bottom: 10px;
}

.subcommand-name {
    font-weight: bold;
}

.subcommand-description {
    color: #666;
}

.inner-subcommand-container {
    position: relative;
    padding-left: 10px;
}

.vertical-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--text-color);
}

.command-card.expanded .command-example {
    display: block;
}

/* Filtros de categoria */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.category-box {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    border-radius: 10px;
    transition: opacity 0.3s;
}

.tooltip {
    font-size: 18px;
    font-weight: 700;
    visibility: hidden;
    max-width: 200px;
    background: var(--constraint-color);
    color: var(--constraint-color-reverse);
    border-radius: 10px;
    padding: 5px 10px;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    bottom: 125%;
}

.category-box:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.category-box.inactive {
    opacity: 0.5;
}

.category-box.active {
    opacity: 1;
}

.category-box svg {
    width: 24px;
    height: 24px;
    fill: white;
    transform: scale(0.9);
}

.category-box[data-category="Moderação"],
.tag.Moderação {
    background-color: var(--color-moderacao);
}

.category-box[data-category="Utilidade"],
.tag.Utilidade {
    background-color: var(--color-utilidade);
}

.category-box[data-category="Diversão"],
.tag.Diversão {
    background-color: var(--color-diversao);
}

.category-box[data-category="Economia"],
.tag.Economia {
    background-color: var(--color-economia);
}

/* Propriedades comuns */
.tag,
.command-permission {
    float: right;
    color: white;
    border-radius: 5px;
    padding: 3px 8px;
    font-weight: 400;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Propriedades específicas para .command-permission */
.command-permission {
    background-color: var(--color-permission);
    margin-right: 5px;
    display: none;
}

.command-permission svg,
.has-subcommand-permission svg,
.tag svg {
    margin-right: 2px;
    width: 15px;
    height: 15px;
}

.command-permission.visible {
    display: flex;
}

.has-subcommand-permission {
    background-color: var(--color-permission);
    color: white;
    border-radius: 5px;
    padding: 0px 5px;
    font-size: 12px;
    display: inline-block;
    margin-top: 5px;
}

.no-results {
    text-align: center;
    color: #666;
    max-width: 350px;
    margin: 40px auto;
}

.no-results h2 {
    font-size: 1.2em;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-color);
}

.no-results p {
    font-size: 0.9em;
    line-height: 1.3;
    color: var(--text-description-color);
}

/* Responsividade */
@media (max-width: 768px) {
    #command-container {
        width: 90%;
    }

    .category {
        text-align: center;
        margin: auto;
    }

    .search-container {
        width: 280px;
    }

    .category-box {
        width: 50px;
        height: 50px;
    }

    #searchInput {
        font-size: 1rem;
    }

    .category-box svg {
        transform: scale(1.1);
    }
}