:root {
    --primary: #005b8f;
    --secondary: #008a4b;
    --accent: #c21c22;
    --light: #f8f9fa;
    --dark: #343a40;
}

* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
    padding-bottom: 100px;
    margin: 0;
}

.header-container {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    padding: 1% 0;
    border-bottom: 0.3rem solid var(--accent);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.brasao {
    width: 70%;
    height: auto;
    filter: drop-shadow(0 0.125rem 0.25rem rgba(0,0,0,0.2));
}

.titulo-prefeitura {
    font-weight: 700;
    letter-spacing: 0.125rem;
    margin-bottom: 0;
    text-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.2);
    font-size: clamp(1.5rem, 4vw, 3rem);
}

.subtitulo-prefeitura {
    font-weight: 300;
    letter-spacing: 0.5rem;
    opacity: 0.9;
    margin-bottom: -1%;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
}

.dti-text {
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    opacity: 0.85;
}

.main-container {
    margin-top: 1%;
    padding: 0 3%;
}

/* Container dos cards personalizados */
.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    justify-content: center;
    padding: 0rem;
    max-width: 100%;
    overflow-x: auto;
}

/* Cards personalizados com animação */
.custom-card {
    position: relative;
    width: 100%;
    height: 11rem;
    background: var(--dark);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    min-width: 0; /* Permite que os cards se ajustem */
}

.custom-card-before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    clip-path: circle(8rem at 80% 20%);
    transition: 0.5s ease-in-out;
}

.custom-card:hover .custom-card-before {
    clip-path: circle(18rem at 80% -20%);
}

.custom-card-after {
    position: absolute;
    justify-content: center;
    top: 30%;
    left: 10%;
    font-size: 3em;
    font-weight: 800;
    font-style: italic;
    color: rgba(255, 255, 255, 0.05);
}

.custom-card .imgBx, .imgBx-simbolo {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    z-index: 1000;
    width: 100%;
    height: 15rem;
    transition: 0.5s;
}

.custom-card:hover .imgBx {
    top: -15%;
    transform: translateY(0%);
}


.custom-card .imgBx img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    width: 8rem;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.custom-card .imgBx-simbolo img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    width: 18rem;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.custom-card:hover .imgBx-simbolo {
    top: -15%;
    transform: translateY(0%);
}

.custom-card .contentBx {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100px;
    text-align: center;
    transition: 1s;
    z-index: 10;
    background: rgba(35, 35, 35, 0.9);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.custom-card:hover .contentBx {
    height: 180px;
}

.custom-card .contentBx h2 {
    position: relative;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
    margin: 5px 0;
    font-size: 1.1rem;
}

.custom-card .contentBx .view-files {
    display: inline-block;
    padding: 6px 15px;
    background: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    color: #111;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.5s;
    font-size: 0.8rem;
    margin-top: 5px;
}

.custom-card:hover .contentBx .view-files {
    opacity: 1;
    transform: translateY(0px);
    transition-delay: 0.4s;
}

    .custom-card {
        height: 19rem;
    }

/* Container das listas de arquivos */
.files-lists-container {
    margin-top: 2rem;
}

/* Listas de arquivos */
.files-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: none;
    animation: slideDown 0.3s ease;
}

.files-list.active {
    display: block;
}

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

.files-list-header {
    background: var(--secondary);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: between;
    align-items: center;
    border-bottom: 3px solid var(--accent);
}

.files-list-header h4 {
    margin: 0;
    flex-grow: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.btn-close-files {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-close-files:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.files-list .list-group {
    margin: 0;
    border: none;
}

.files-list .list-group-item {
    border: none;
    border-bottom: 1px solid #f8f9fa;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    justify-content: between;
    align-items: center;
}

.files-list .list-group-item:last-child {
    border-bottom: none;
}

.files-list .list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.files-list .list-group-item a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    flex-grow: 1;
    transition: color 0.3s ease;
}

.files-list .list-group-item:hover a {
    color: var(--primary);
}

/* Ajustes nos cards para remover a lista interna */
.custom-card .files-list {
    display: none !important;
}

/* Efeito de destaque no card quando a lista está aberta */
.custom-card.active {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Responsividade */
@media (max-width: 768px) {
    .files-list-header {
        padding: 0.8rem 1rem;
    }
    
    .files-list-header h4 {
        font-size: 1rem;
    }
    
    .files-list .list-group-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-close-files {
        width: 28px;
        height: 28px;
    }
}

.card-category {
    transition: all 0.3s ease;
    border: none;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 0.375rem 0.9375rem rgba(0, 0, 0, 0.08);
    height: 100%;
    background: white;
}

.card-category:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 0.75rem 1.25rem rgba(0, 0, 0, 0.15);
}

.card-category .card-body {
    padding: 5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-category i {
    font-size: 2.5rem;
    margin-bottom: 0px;
    color: var(--primary);
}

.card-category h5 {
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
    margin: 0.5rem 0 0rem 0;
}

.card-category .card-text {
    flex-grow: 1;
    margin: 0rem 0 1rem 0;
}

.card-category .btn {
    background: var(--primary);
    border: none;
    border-radius: 1.875rem;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s;
    color: white;
    align-self: center;
}

.card-category .btn:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

.help-btn {
    position: fixed;
    bottom: 5rem;
    right: 1.25rem;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
    z-index: 1100;
    transition: all 0.3s;
    text-decoration: none;
}

.help-btn:hover {
    transform: scale(1.1) rotate(10deg);
    background: var(--primary);
}

.section-title {
    position: relative;
    padding-bottom: 0.9375rem;
    margin-bottom: 1.875rem;
    color: var(--primary);
    font-weight: 700;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3.75rem;
    height: 0.25rem;
    background: var(--accent);
    border-radius: 0.125rem;
}

.favorite-card {
    border-radius: 0.625rem;
    border-left: 0.25rem solid var(--secondary);
    transition: all 0.3s;
}

.favorite-card:hover {
    border-left: 0.25rem solid var(--accent);
    transform: translateX(0.3125rem);
}

.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to right, var(--dark), #23272b);
    color: rgba(255,255,255,0.8);
    padding: 0.5% 0%;
    margin-top: 3.125rem;
    z-index: 1050;
    box-shadow: 0 -0.125rem 0.5rem rgba(0,0,0,0.2);
    font-size: 0.8rem;
}

.footer h5 {
    font-size: 1rem;
}

.footer p {
    font-size: 0.9rem;
}

.footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

.list-group-item {
    transition: all 0.3s;
    border: none;
    border-left: 0.1875rem solid transparent;
    padding: 0.9375rem 1.25rem;
    margin-bottom: 0.3125rem;
    border-radius: 0.5rem;
    background-color: white;
}

.list-group-item:hover {
    background-color: #e9f7ff;
    border-left: 0.1875rem solid var(--accent);
}

.list-group-item a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    flex-grow: 1;
}

.list-group-item:hover a {
    color: var(--accent);
}

.favorite-star {
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
    min-width: 1.5rem;
    text-align: center;
}

.favorite-star.active {
    color: #ffc107;
}

.favorite-star:hover {
    transform: scale(1.2);
}

.btn-type-access {
    background-color: var(--primary);
    color: white;
    border: none;
    transition: background-color 0.3s ease;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    padding: 0.5rem 1rem;
}

.btn-type-access:hover {
    background-color: var(--secondary);
    color: white;
}

.btn-type-access1 {
    background-color: var(--primary);
    color: white;
    border: none;
    transition: background-color 0.3s ease;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    padding: 0.5rem 1rem;
}

.btn-type-access1:hover {
    background-color: var(--secondary);
    color: white;
}

.section-title1 {
    position: relative;
    padding-bottom: 0px;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

/* Mobile Tabs System */
.mobile-tabs-title {
    color: var(--primary);
    font-weight: 700;
    font-size: clamp(1rem, 4vw, 1.2rem);
    margin: 0;
}

.mobile-tabs-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -17.5rem;
    width: 17.5rem;
    height: 100vh;
    background: white;
    box-shadow: -0.3125rem 0 0.9375rem rgba(0,0,0,0.1);
    z-index: 1100;
    padding: 1.25rem 0;
    overflow-y: auto;
    transition: right 0.3s ease;
}

.mobile-tabs-nav.show {
    display: flex;
    flex-direction: column;
    right: 0;
}

.mobile-tabs-nav-header {
    padding: 0.9375rem 1.25rem;
    border-bottom: 0.0625rem solid #eee;
    margin-bottom: 0.625rem;
}

.mobile-tabs-nav-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
}

.mobile-tabs-close {
    position: absolute;
    top: 0.9375rem;
    right: 0.9375rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--primary);
}

.mobile-tab-btn {
    padding: 0.75rem 1.25rem;
    margin: 0;
    border-radius: 0;
    background: none;
    border: none;
    text-align: left;
    font-weight: 500;
    color: var(--dark);
    transition: all 0.2s;
    border-left: 0.25rem solid transparent;
    display: flex;
    align-items: center;
}

.mobile-tab-btn.active {
    background-color: rgba(0, 91, 143, 0.05);
    color: var(--primary);
    border-left: 0.25rem solid var(--accent);
}

.mobile-tab-btn i {
    margin-right: 0.75rem;
    color: var(--primary);
    width: 1.25rem;
    text-align: center;
}

.mobile-tabs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1090;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-tabs-overlay.show {
    display: block;
    opacity: 1;
}

body.menu-open {
    overflow: hidden;
}

.mobile-tabs-container {
    margin-top: 1rem;
}

.mobile-tabs-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    padding: 0.3125rem 0.625rem;
}

.mobile-tab-content {
    display: none;
}

.mobile-tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(0.625rem); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.6s ease forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* Responsividade para tablets */
@media (max-width: 1198px) and (min-width: 768px) {
    .brasao {
        width: 60%;
    }
    
    .card-category .card-body {
        padding: 1rem;
    }
    
    .card-category i {
        font-size: 2rem;
    }
    
    .card-category h5 {
        font-size: 1rem;
    }
    
    /* Ocultar cards em tablets */
    .card-category {
        display: none;
    }

    .mobile-tabs-container {
        display: block;
    }
    .btn-type-access1 {
        font-size: 0.8rem;
        margin: 0 0 0 0;
        padding: 0.45rem 0.9rem;
    }
    .footer {
        padding: 0.5rem 0;
    }

    .footer h5 {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .footer .mb-0 {
        line-height: 1.2;
        font-size: 0.65rem;
    }
    .header-container {
        padding: 0.8rem 0;
    }

    .brasao {
        width: 80%;
        margin-bottom: 2%;
    }
    .mobile-tabs-title {
        font-size: 1rem;
    }
}

/* Responsividade para celulares */
@media (max-width: 767px) {
    .header-container {
        padding: 0.8rem 0;
    }
    .card-category {
        display: none;
    }

    .brasao {
        width: 20%;
        margin-bottom: 2%;
    }

    .footer {
        padding: 0.8rem 0;
    }

    .footer h5 {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .footer .mb-0 {
        line-height: 1.2;
        font-size: 0.7rem;
    }

    .help-btn {
        font-size: 1rem;
        bottom: 4rem;
        right: 0.8rem;
        width: 2.5rem;
        height: 2.5rem;
    }

    .section-title1:after {
        display: none;
    }

    #favorites-list {
        max-height: 50vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #favorites-list .list-group-item {
        min-height: 2.5rem;
    }

    #favorites-list .text-truncate {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        flex-grow: 1;
        word-break: break-word;
    }
}

/* Responsividade para tablets */
@media (max-width: 1198px) and (min-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr); /* 2 colunas em tablets */
        gap: 1rem;
    }
    
    .custom-card {
        height: 13rem; /* Altura um pouco maior em tablets */
    }
    
    .custom-card .imgBx, .imgBx-simbolo {
        height: 9rem;
    }
    
    .custom-card .imgBx img {
        width: 6rem;
    }
    
    .custom-card .imgBx-simbolo img {
        width: 12rem;
    }
    
    .custom-card .contentBx {
        height: 70px;
    }
    
    .custom-card:hover .contentBx {
        height: 120px;
    }
    
    .custom-card .contentBx h2 {
        font-size: 1rem;
    }
    
    .custom-card-after {
        font-size: 2.5em;
    }
}

/* Responsividade para celulares */
@media (max-width: 767px) {
    .cards-container {
        grid-template-columns: 1fr; /* 1 coluna em celulares */
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .custom-card {
        height: 12rem; /* Altura para celulares */
    }
    
    .custom-card .imgBx, .imgBx-simbolo {
        height: 7rem;
    }
    
    .custom-card .imgBx img {
        width: 5rem;
    }
    
    .custom-card .imgBx-simbolo img {
        width: 9rem;
    }
    
    .custom-card .contentBx {
        height: 60px;
    }
    
    .custom-card:hover .contentBx {
        height: 100px;
    }
    
    .custom-card .contentBx h2 {
        font-size: 0.9rem;
        margin: 2px 0;
    }
    
    .custom-card .contentBx .view-files {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
    
    .custom-card-after {
        font-size: 1.8em;
        left: 5%;
    }
    
    .custom-card-before {
        clip-path: circle(5rem at 80% 20%);
    }
    
    .custom-card:hover .custom-card-before {
        clip-path: circle(10rem at 80% -20%);
    }
}

/* Ajustes específicos para o imgBx-simbolo em diferentes telas */
@media (max-width: 1198px) and (min-width: 768px) {
    .custom-card .imgBx-simbolo img {
        width: 12rem;
    }
}

@media (max-width: 767px) {
    .custom-card .imgBx-simbolo img {
        width: 10rem;
    }
}

@media (min-width: 1400px) {
    .custom-card .imgBx-simbolo img {
        width: 14rem;
    }
}
