/* 
 * DWPortal Custom CSS - Sistema de Seguimiento de Documentos Laborales
 * Tema verde: #03AC13
 */

:root {
    --primary: #03AC13;
    --primary-dark: #028E10;
    --primary-light: #4BDE59;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --sidebar-bg: #2f3c35;  /* Tono oscuro verde-grisáceo */
    --sidebar-header-bg: #03AC13;
    --content-bg: #f5f7f6;  /* Fondo claro con un tinte verdoso muy sutil */
    --card-bg: #ffffff;
}

/* Layout & General Styles */
body {
    background-color: var(--content-bg);
    color: #333333;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#content {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

#content.expanded {
    width: calc(100% - var(--sidebar-collapsed-width));
}

.content-wrapper {
    flex: 1 0 auto;
    padding-bottom: 60px; /* Ensures footer doesn't overlap content */
}

.footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* Sidebar Styles */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    transition: all 0.3s;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
}

#sidebar.collapsed {
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
}

#sidebar .sidebar-header {
    padding: 15px;
    background-color: var(--sidebar-header-bg);
    cursor: pointer;
}

#sidebar .sidebar-header a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

#sidebar .sidebar-header a i {
    margin-right: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

#sidebar-toggle-icon {
    transition: transform 0.3s;
}

#sidebar.collapsed .sidebar-header a span {
    display: none;
}

#sidebar.collapsed .sidebar-header a i {
    margin-right: 0;
    font-size: 1.5rem;
    transform: rotate(180deg);
}

#sidebar ul.components {
    padding: 20px 0;
    flex-grow: 1;
    overflow-y: auto;
}

#sidebar ul li a {
    padding: 10px 20px;
    font-size: 1.1em;
    display: block;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul li a:hover,
#sidebar ul li a.active {
    color: #fff;
    background: rgba(3, 172, 19, 0.1);
    border-left: 4px solid var(--primary);
}

#sidebar ul li a i {
    margin-right: 10px;
    min-width: 20px;
    text-align: center;
}

#sidebar.collapsed ul li a span {
    display: none;
}

#sidebar.collapsed ul li a {
    padding: 15px;
    text-align: center;
}

#sidebar.collapsed ul li a i {
    margin-right: 0;
    font-size: 1.2rem;
}

/* Submenu styles */
#sidebar .dropdown-toggle::after {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

#sidebar.collapsed .dropdown-toggle::after {
    display: none;
}

#sidebar ul ul a {
    font-size: 0.9em !important;
    padding-left: 50px !important;
    background: rgba(0, 0, 0, 0.2);
}

#sidebar .sidebar-footer ul ul a {
    padding-left: 50px !important;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.85em !important;
    color: #ddd;
    display: flex;
    align-items: center;
}

#sidebar .sidebar-footer ul ul a i {
    margin-right: 10px;
    min-width: 20px;
    text-align: center;
}

#sidebar .sidebar-footer ul ul a:hover {
    background: rgba(3, 172, 19, 0.15);
}

#sidebar.collapsed .sidebar-footer .dropdown-toggle::after {
    display: none;
}

#sidebar.collapsed ul ul,
#sidebar.collapsed .sidebar-footer ul ul {
    display: none !important;
}

/* Profile styles */
.profile-menu-item {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

.profile-link {
    display: flex !important;
    align-items: center;
    padding: 10px 15px !important;
}

.profile-image-container {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    border: 2px solid var(--primary);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.profile-text {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Sidebar footer with profile */
.sidebar-footer {
    margin-top: auto;
    padding-bottom: 20px;
}

.sidebar-footer hr {
    margin: 15px 0 10px 0;
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-footer ul.components {
    padding: 0;
}

#sidebar.collapsed .sidebar-footer ul li a {
    padding: 15px;
    text-align: center;
    justify-content: center;
}

#sidebar.collapsed .profile-image-container {
    margin-right: 0;
}

#sidebar.collapsed .profile-info {
    display: none;
}

/* Card Styles */
.card {
    background-color: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    background-color: rgba(3, 172, 19, 0.05);
    border-bottom: 1px solid rgba(3, 172, 19, 0.1);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Card borders */
.border-left-primary {
    border-left: 4px solid var(--primary) !important;
}

.border-left-success {
    border-left: 4px solid #28a745 !important;
}

.border-left-info {
    border-left: 4px solid #17a2b8 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-left-danger {
    border-left: 4px solid #dc3545 !important;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: transparent;
    overflow: hidden;
    z-index: 9999;
}

.loading-indicator::before {
    content: "";
    position: absolute;
    height: 100%;
    width: 30%;
    background-color: var(--primary);
    animation: loading 1.5s infinite ease-in-out;
}

@keyframes loading {
    0% {
        left: -30%;
    }
    100% {
        left: 100%;
    }
}

/* Table Styles */
.table {
    color: #333333;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(3, 172, 19, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(3, 172, 19, 0.1);
    color: #333333;
}

/* Status Colors */
.text-success {
    color: #28a745 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-info {
    color: #17a2b8 !important;
}

.text-primary {
    color: var(--primary) !important;
}

/* Mobile Overlay */
.overlay {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: all 0.5s ease-in-out;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile styles */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
        position: fixed;
        z-index: 999;
        height: 100%;
    }
    
    #sidebar.active {
        margin-left: 0;
    }
    
    #content {
        width: 100%;
    }
    
    #content.expanded {
        width: 100%;
    }
    
    #sidebarCollapse {
        display: block;
    }
    
    .user-mobile-profile {
        display: flex !important;
    }
}

/* Toast notification */
.toast {
    background-color: var(--card-bg);
    color: #333333;
}

.toast-header {
    background-color: rgba(3, 172, 19, 0.05);
    color: #333333;
    border-bottom: 1px solid rgba(3, 172, 19, 0.1);
}

/* Form Styles */
.form-control {
    background-color: #ffffff;
    border: 1px solid #ced4da;
    color: #333333;
}

.form-control:focus {
    background-color: #ffffff;
    color: #333333;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(3, 172, 19, 0.25);
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #333333;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Profile specific styles */
.profile-avatar-placeholder {
    background-color: var(--primary);
    color: white;
    font-size: 48px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.mobile-profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mobile-profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* SPA Navigation - Page transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(10px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 300ms, transform 300ms;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 300ms, transform 300ms;
}