/* ===================================
   SIGECAP Documentation Portal Styles
   =================================== */

:root {
    --sidebar-width: 280px;
    --header-height: 56px;
    --primary-color: #1e3a5f;
    --primary-dark: #0d2137;
    --secondary-color: #2d5a87;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --success-color: #28a745;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
}

/* Reset & Base */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
}

/* ===================================
   Sidebar Styles
   =================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
}

.sidebar-header small {
    opacity: 0.7;
}

.sidebar-search {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-search .input-group-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-search .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.sidebar-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-search .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
    color: #fff;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-nav .nav-item {
    margin: 2px 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-left-color: var(--warning-color);
    font-weight: 600;
}

/* Active state for submenu items */
.nav-submenu .nav-link.active {
    background: rgba(255, 193, 7, 0.15);
    border-left: 3px solid var(--warning-color);
    margin-left: -3px;
    padding-left: 57px;
}

.sidebar-nav .nav-link i:first-child {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-nav .nav-link span {
    flex: 1;
}

.sidebar-nav .nav-link .badge {
    font-size: 0.65rem;
    padding: 3px 6px;
}

/* Group Header (collapsible accordion) */
.nav-group-header {
    position: relative;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6) !important;
    cursor: pointer;
    padding: 15px 20px 8px 20px !important;
    margin-top: 10px;
}

.nav-group-header:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Seta de expansao do grupo */
.nav-group-header .group-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.nav-group-header.expanded .group-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Submenu Container (hidden by default - accordion) */
.nav-submenu-container {
    display: none;
}

.nav-submenu-container.show {
    display: block;
}

/* Submenu */
.nav-submenu {
    background: rgba(0, 0, 0, 0.1);
    padding: 5px 0;
}

.nav-submenu .nav-link {
    padding: 10px 20px 10px 54px;
    font-size: 0.9rem;
}

.nav-submenu .nav-link i:first-child {
    width: 20px;
    font-size: 0.85rem;
}

/* Nav Parent (report title with sections) */
.nav-parent {
    cursor: pointer;
}

.nav-parent .submenu-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.nav-parent.expanded .submenu-arrow {
    transform: rotate(180deg);
}

/* Section Submenu (hidden by default) */
.nav-section-submenu {
    display: none;
    background: rgba(0, 0, 0, 0.15);
    padding: 5px 0;
    margin: 0;
}

.nav-section-submenu.show {
    display: block;
}

.nav-section-link {
    padding: 6px 20px 6px 70px !important;
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.65) !important;
    border-left: 2px solid transparent !important;
    cursor: pointer;
}

.nav-section-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.nav-section-link.active {
    color: var(--warning-color) !important;
    border-left-color: var(--warning-color) !important;
    background: rgba(255, 193, 7, 0.1) !important;
}

/* Nav Item with sections container */
.nav-item-with-sections {
    margin-bottom: 0;
}

.nav-item-with-sections > .nav-parent {
    margin-bottom: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* ===================================
   Main Content Area
   =================================== */

.main-content {
    margin-left: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--light-bg);
}

/* Content Header */
.content-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
}

.content-header .breadcrumb {
    font-size: 0.9rem;
}

.content-header .breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.content-header .breadcrumb a:hover {
    text-decoration: underline;
}

#sidebarToggle {
    display: none;
    color: var(--primary-color);
    font-size: 1.25rem;
    padding: 0;
    margin-right: 15px;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Home Content */
.home-content {
    height: 100%;
    overflow-y: auto;
    padding: 30px;
}

/* Document Frame */
.doc-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ===================================
   Cards
   =================================== */

.doc-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.doc-card .card-header {
    font-weight: 600;
}

.doc-card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* ===================================
   Responsive Design
   =================================== */

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

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

    .main-content {
        margin-left: 0;
    }

    #sidebarToggle {
        display: block;
    }

    .home-content {
        padding: 20px 15px;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ===================================
   Custom Scrollbar
   =================================== */

.sidebar-nav::-webkit-scrollbar,
.home-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.home-content::-webkit-scrollbar-track {
    background: var(--light-bg);
}

.home-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ===================================
   Animations
   =================================== */

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

.home-content .card {
    animation: fadeIn 0.3s ease forwards;
}

.home-content .row .col-md-4:nth-child(1) .card { animation-delay: 0.1s; }
.home-content .row .col-md-4:nth-child(2) .card { animation-delay: 0.2s; }
.home-content .row .col-md-4:nth-child(3) .card { animation-delay: 0.3s; }
.home-content .row .col-md-6:nth-child(1) .card { animation-delay: 0.4s; }
.home-content .row .col-md-6:nth-child(2) .card { animation-delay: 0.5s; }

/* ===================================
   Home Page - Clean Design
   =================================== */

.hero-clean {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Accordion customizado para home */
.home-content .accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 8px !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.home-content .accordion-button {
    font-weight: 600;
    padding: 1rem 1.25rem;
    background: #fff;
}

.home-content .accordion-button:not(.collapsed) {
    background-color: rgba(30, 58, 95, 0.05);
    color: var(--primary-color);
    box-shadow: none;
}

.home-content .accordion-button:focus {
    box-shadow: none;
    border-color: var(--border-color);
}

.home-content .accordion-button::after {
    background-size: 1rem;
}

.home-content .accordion-body {
    padding: 0;
}

/* Lista de documentos dentro do accordion */
.doc-list-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

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

.doc-list-item:hover {
    background-color: #f8f9fa;
}

.doc-list-item .doc-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.doc-list-item .doc-info {
    flex: 1;
    min-width: 0;
}

.doc-list-item .doc-title {
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.doc-list-item .doc-desc {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-list-item .doc-badge {
    margin-left: 0.75rem;
    white-space: nowrap;
}

.doc-list-item .doc-metric {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
}

.doc-list-item .doc-arrow {
    margin-left: 0.75rem;
    color: #adb5bd;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    .sidebar,
    .content-header,
    #sidebarToggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .doc-frame {
        height: auto;
    }
}
