/* HRMIS Components Styles */
/* Login, Forms, Tables, and other UI components */

/* Login Components */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-secondary) 100%);
    padding: 20px;
}

.login-box {
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border-color);
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    object-fit: contain;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form {
    padding: 32px;
}

.login-footer {
    text-align: center;
    padding: 24px 32px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.version {
    font-weight: 600;
    color: var(--primary);
}

.login-links {
    text-align: center;
    margin-top: 16px;
}

.login-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.login-links a:hover {
    text-decoration: underline;
}

/* Form Components */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    margin-right: 8px;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
}

.form-error {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
}

.form-help {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
}

/* Maintenance Page */
.maintenance-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 20px;
}

.maintenance-content {
    text-align: center;
    max-width: 500px;
}

.maintenance-content h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.maintenance-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.maintenance-info {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-top: 24px;
}

/* Table Components */
.table-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background: var(--secondary-light);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Modal Components */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Alert Components */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success {
    background: #f8f9fa;
    border-color: var(--success);
    color: #155724;
}

.alert-warning {
    background: #fff8e1;
    border-color: var(--warning);
    color: #856404;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--error);
    color: #721c24;
}

.alert-info {
    background: #e1f5fe;
    border-color: var(--info);
    color: #0c5460;
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-secondary {
    background: var(--secondary);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-error {
    background: var(--error);
    color: white;
}

/* Card Components */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Progress Components */
.progress {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: var(--transition);
}

.progress-bar.success {
    background: var(--success);
}

.progress-bar.warning {
    background: var(--warning);
}

.progress-bar.error {
    background: var(--error);
}

/* Dropdown Components */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-toggle:hover {
    border-color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--secondary-light);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Tooltip Components */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    margin-bottom: 5px;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Breadcrumb Components */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-hint);
}

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

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

.breadcrumb-item.active {
    color: var(--text-primary);
}

/* Tab Components */
.tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tab-item {
    margin-right: 2px;
}

.tab-link {
    display: block;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab-link:hover {
    color: var(--primary);
    background: var(--secondary-light);
}

.tab-item.active .tab-link {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Footer Components */
.app-footer {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left,
.footer-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-right {
    text-align: right;
}

.copyright,
.footer-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.footer-links {
    font-size: 12px;
    margin: 0;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
}

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

.footer-links .separator {
    margin: 0 8px;
    color: var(--text-hint);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    min-width: 300px;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.fade-out {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
}

/* Header User Info Enhancement */
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: normal;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* Dropdown Header */
.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-user-info strong {
    font-size: 14px;
    color: var(--text-primary);
}

.dropdown-user-info small {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.logout-item {
    color: var(--error) !important;
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: fixed;
    top: var(--header-height);
    right: 20px;
    width: 360px;
    max-height: 480px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
}

.notifications-dropdown.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.notifications-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.notifications-body {
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
}

.no-notifications {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.no-notifications .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.no-notifications p {
    color: var(--text-secondary);
    font-size: 14px;
}

.notifications-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Search Modal */
.search-modal-content {
    max-width: 600px;
    margin: 20px auto;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 8px;
    background: transparent;
}

.search-results {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.search-suggestions {
    text-align: center;
    padding: 40px 20px;
}

.search-hint {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Sidebar Enhancements */
.sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 16px 20px 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item.has-submenu {
    position: relative;
}

.nav-item.has-submenu .nav-link {
    padding-right: 40px; /* Make room for the toggle button */
}

.nav-submenu-toggle {
    position: absolute;
    right: 8px;
    top: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
}

.nav-submenu-toggle:hover {
    background: rgba(173, 216, 230, 0.3);
}

.nav-submenu-toggle .nav-arrow {
    font-size: 20px;
    transition: var(--transition);
}

.nav-item.has-submenu.open .nav-submenu-toggle .nav-arrow {
    transform: rotate(90deg);
}

.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.nav-item.has-submenu.open .nav-submenu {
    max-height: 500px;
}

.nav-subitem {
    margin: 0;
}

.nav-sublink {
    display: block;
    padding: 10px 20px 10px 52px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.nav-sublink:hover {
    background: var(--secondary-light);
    color: var(--text-primary);
}

.nav-badge {
    margin-left: auto;
    background: var(--error);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 16px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-version {
    text-align: center;
    font-size: 11px;
    color: var(--text-hint);
}

/* Modal Dialog Enhancements */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show .modal-content {
    animation: slideDown 0.3s ease-out;
}

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