/* ===========================
   ESTILOS GLOBAIS - PORTAL MCM
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #16a085;
    --light-bg: #f5f7fa;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #ecf0f1;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ===========================
   HEADER
   =========================== */

header {
    background-color: #0d1735;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.header-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    color: #ffffff;
    border-bottom-color: #98c3e3;
}

.nav-link.active {
    color: #98c3e3;
    border-bottom-color: #98c3e3;
    font-weight: 600;
}

.nav-link i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.nav-link.logout {
    color: #ff6b6b;
}

.nav-link.logout:hover {
    border-bottom-color: #ff6b6b;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-info i {
    font-size: 1.2rem;
    color: #98c3e3;
}

/* ===========================
   MAIN CONTAINER
   =========================== */

main {
    min-height: calc(100vh - 200px);
    padding: 0 2rem;
    background-image: url('../img/engrenagem_mcm.png');
    background-position: left bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: 500px auto;
    background-color: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===========================
   FOOTER
   =========================== */

footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: var(--white);
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ===========================
   HOME PAGE - CARDS
   =========================== */

.home-container {
    padding: 2rem 0;
}

.home-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.home-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.search-container {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    pointer-events: none;
    font-size: 1rem;
    z-index: 1;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-search {
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-search:hover {
    background-color: #2980b9;
}

.search-results {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.search-results h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    color: var(--secondary-color);
}

.card img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card:hover img {
    filter: drop-shadow(0 2px 8px rgba(52, 152, 219, 0.3));
}

/* ===========================
   AVISOS SECTION
   =========================== */

.avisos {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    margin: 3rem 0;
    box-shadow: var(--shadow);
}

.avisos-titulo {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.aviso-item {
    padding: 1rem;
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 1rem;
    background-color: var(--light-bg);
    border-radius: 4px;
}

.aviso-item h3 {
    margin-bottom: 0.5rem;
}

.aviso-item p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.aviso-item small {
    color: var(--text-light);
    font-size: 0.85rem;
}

.btn-ver-todos {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-ver-todos:hover {
    background-color: #2980b9;
}

/* ===========================
   BUTTONS
   =========================== */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: var(--text-light);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #6c7a7a;
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-info {
    background-color: var(--info-color);
    color: var(--white);
}

.btn-info:hover {
    background-color: #138d75;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-height: 36px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ===========================
   ALERTS
   =========================== */

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===========================
   FORMS
   =========================== */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ===========================
   EMPTY STATE
   =========================== */

.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    nav {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
        align-items: stretch;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 2px solid transparent;
        border-left: 4px solid transparent;
        text-align: center;
        transition: all 0.3s ease;
    }

    .nav-link:hover,
    .nav-link.active {
        background: var(--light-bg);
        border-left-color: var(--secondary-color);
        border-bottom-color: transparent;
    }

    .user-info {
        width: 100%;
        justify-content: center;
        border-radius: 6px;
    }

    main {
        padding: 0 1rem;
    }

    .home-title {
        font-size: 1.75rem;
    }

    .search-form {
        flex-direction: column;
    }

    .card-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .card {
        padding: 1rem;
    }
}

/* ===========================
   MENU SIMPLES - Importar PDF, Meus Documentos, Buscar em IA
   =========================== */

.simple-menu {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.simple-menu-item {
    padding: 0.75rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.simple-menu-item:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* ===========================
   MENU CUSTOMIZÁVEL
   =========================== */

.custom-menus-container {
    margin: 3rem 0;
}

.custom-menus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.custom-menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 140px;
    text-align: center;
}

.custom-menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.custom-menu-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.custom-menu-card:nth-child(2):hover {
    box-shadow: 0 10px 25px rgba(245, 87, 108, 0.4);
}

.custom-menu-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.custom-menu-card:nth-child(3):hover {
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.4);
}

.custom-menu-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.custom-menu-card:nth-child(4):hover {
    box-shadow: 0 10px 25px rgba(67, 233, 123, 0.4);
}

.custom-menu-card:nth-child(5) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.custom-menu-card:nth-child(5):hover {
    box-shadow: 0 10px 25px rgba(250, 112, 154, 0.4);
}

.custom-menu-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.custom-menu-title {
    font-weight: 600;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .simple-menu {
        gap: 1rem;
    }

    .simple-menu-item {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .custom-menus-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .custom-menu-card {
        padding: 1rem;
        min-height: 120px;
    }

    .custom-menu-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .custom-menu-title {
        font-size: 0.85rem;
    }
}

/* ===========================
   SEÇÃO DE AVISOS
   =========================== */

.notices-section {
    margin: 3rem 0 2rem 0;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.notices-titulo {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid #ecf0f1;
}

.notices-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.notice-item {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-item:hover {
    background: #fafbfc;
}

.notice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.notice-header h3 {
    font-size: 0.95rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.notice-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #95a5a6;
    white-space: nowrap;
}

.notice-date i {
    color: #bdc3c7;
}

.notice-description {
    color: #7f8c8d;
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    transition: color 0.2s ease;
    word-wrap: break-word;
}

.notice-link {
    color: #0066cc !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 4px 8px;
    background-color: rgba(0, 102, 204, 0.08);
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    word-break: keep-all;
}

.notice-link:hover {
    color: #004999 !important;
    background-color: rgba(0, 102, 204, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.notice-link::after {
    content: "\f35d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.8em;
}

.notice-description:hover {
    color: #34495e;
}

@media (max-width: 768px) {
    .notices-section {
        margin: 2rem 0 1.5rem 0;
    }

    .notices-titulo {
        font-size: 1.1rem;
        padding: 1.2rem 1.2rem 0.8rem 1.2rem;
    }

    .notice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .notice-item {
        padding: 1rem 1.2rem;
    }
}

/* ===========================
   PAGINAÇÃO
   =========================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.4rem 0.8rem;
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.pagination-btn:hover {
    background-color: var(--light-bg);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.pagination-btn:disabled {
    background-color: transparent;
    color: #bdc3c7;
    border-color: #e8ecf1;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pagination-num {
    padding: 0.35rem 0.6rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 400;
    font-size: 0.9rem;
    min-width: 30px;
    text-align: center;
}

.pagination-num:hover {
    border-color: var(--secondary-color);
    background-color: var(--light-bg);
    color: var(--secondary-color);
}

.pagination-current {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    cursor: default;
    font-weight: 500;
}

.pagination-current:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.pagination-dots {
    color: var(--text-light);
    padding: 0 0.2rem;
    font-weight: 400;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pagination {
        gap: 0.3rem;
        padding: 0.8rem;
    }

    .pagination-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .pagination-num {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-width: 28px;
    }

    .pagination-info {
        font-size: 0.8rem;
        width: 100%;
        order: 3;
        margin-top: 0.5rem;
    }
}
