/* ============================================
   HRMS Portal - Stylesheet
   ============================================ */

/* Dashboard Cards */
.hrms-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.hrms-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.hrms-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.hrms-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 20px;
    flex-shrink: 0;
}

.hrms-card-blue .hrms-card-icon { background: #e8f4fd; color: #2196F3; }
.hrms-card-green .hrms-card-icon { background: #e8f5e9; color: #4CAF50; }
.hrms-card-orange .hrms-card-icon { background: #fff3e0; color: #FF9800; }
.hrms-card-purple .hrms-card-icon { background: #f3e5f5; color: #9C27B0; }
.hrms-card-red .hrms-card-icon { background: #ffebee; color: #f44336; }

.hrms-card-info h3 {
    font-size: 28px;
    margin: 0;
    color: #333;
}

.hrms-card-info p {
    margin: 5px 0 0;
    color: #777;
    font-size: 14px;
}

/* Sections */
.hrms-section, .hrms-wrap .hrms-section {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.hrms-section h2, .hrms-section h3 {
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #333;
}

.hrms-section h2 i, .hrms-section h3 i {
    margin-right: 8px;
    color: #2196F3;
}

/* Status Badges */
.hrms-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrms-status-present, .hrms-status-approved, .hrms-status-paid { background: #e8f5e9; color: #2e7d32; }
.hrms-status-absent, .hrms-status-rejected { background: #ffebee; color: #c62828; }
.hrms-status-half_day, .hrms-status-pending { background: #fff3e0; color: #e65100; }
.hrms-status-late { background: #fce4ec; color: #c2185b; }
.hrms-status-holiday, .hrms-status-week_off { background: #e3f2fd; color: #1565c0; }
.hrms-status-active { background: #e8f5e9; color: #2e7d32; }
.hrms-status-inactive, .hrms-status-terminated { background: #f5f5f5; color: #757575; }
.hrms-status-hold { background: #fff3e0; color: #e65100; }

/* Forms */
.hrms-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.hrms-form-group {
    margin-bottom: 15px;
}

.hrms-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.hrms-form-group input[type="text"],
.hrms-form-group input[type="email"],
.hrms-form-group input[type="number"],
.hrms-form-group input[type="date"],
.hrms-form-group input[type="time"],
.hrms-form-group input[type="password"],
.hrms-form-group textarea,
.hrms-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

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

.hrms-form-full {
    grid-column: 1 / -1;
}

/* Tables */
.hrms-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.hrms-table th,
.hrms-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.hrms-table thead th {
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrms-table tbody tr:hover {
    background: #f8f9fa;
}

/* Buttons */
.hrms-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    line-height: 1.4;
}

.hrms-btn i { margin-right: 6px; }

.hrms-btn-primary {
    background: #2196F3;
    color: #fff;
}

.hrms-btn-primary:hover {
    background: #1976D2;
    color: #fff;
    text-decoration: none;
}

.hrms-btn-success {
    background: #4CAF50;
    color: #fff;
}

.hrms-btn-success:hover {
    background: #388E3C;
    color: #fff;
    text-decoration: none;
}

.hrms-btn-danger {
    background: #f44336;
    color: #fff;
}

.hrms-btn-danger:hover {
    background: #d32f2f;
    color: #fff;
    text-decoration: none;
}

.hrms-btn-large {
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 8px;
}

.hrms-btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.hrms-btn-full {
    width: 100%;
}

/* Login Form */
.hrms-login-form {
    max-width: 400px;
    margin: 40px auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

.hrms-login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.hrms-login-form .hrms-form-group {
    margin-bottom: 20px;
}

.hrms-login-form input {
    padding: 12px 15px;
    font-size: 15px;
}

/* Alert Messages */
.hrms-alert {
    padding: 12px 20px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
}

.hrms-alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4CAF50; }
.hrms-alert-error { background: #ffebee; color: #c62828; border-left: 4px solid #f44336; }
.hrms-alert-warning { background: #fff3e0; color: #e65100; border-left: 4px solid #FF9800; }
.hrms-alert-info { background: #e3f2fd; color: #1565c0; border-left: 4px solid #2196F3; }

/* Modal */
.hrms-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hrms-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.hrms-modal-large {
    max-width: 700px;
}

.hrms-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.hrms-modal-close:hover {
    color: #333;
}

/* Action Bar */
.hrms-action-bar {
    margin: 20px 0;
}

/* Flex Row */
.hrms-flex-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.hrms-half {
    flex: 1;
    min-width: 300px;
}

/* Employee Dashboard */
.hrms-employee-dashboard .hrms-welcome {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.hrms-employee-dashboard .hrms-welcome h2 {
    margin: 0 0 5px;
    color: #fff;
}

.hrms-employee-dashboard .hrms-welcome p {
    margin: 0;
    opacity: 0.9;
}

/* Check-in/out Area */
.hrms-checkin-area {
    text-align: center;
    padding: 40px 20px;
}

.hrms-checkin-area p {
    margin-top: 10px;
    color: #999;
}

.hrms-attendance-status {
    text-align: center;
    padding: 20px;
}

.hrms-attendance-status p {
    margin: 10px 0;
    color: #555;
}

/* Attendance Check-in Button Pulse Animation */
@keyframes hrms-pulse {
    0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.5); }
    70% { box-shadow: 0 0 0 20px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.hrms-checkin-btn {
    animation: hrms-pulse 2s infinite;
    padding: 20px 60px !important;
    font-size: 20px !important;
    border-radius: 50% !important;
    width: 150px;
    height: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Leave Balance */
.hrms-leave-balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.hrms-balance-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid #eee;
}

.hrms-balance-card h4 {
    margin: 0 0 10px;
    color: #333;
}

.hrms-balance-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

.hrms-taken { color: #f44336; font-weight: 600; }
.hrms-remaining { color: #4CAF50; font-weight: 600; }

.hrms-balance-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.hrms-balance-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #FF9800);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Profile Page */
.hrms-profile-header {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
    margin-bottom: 20px;
}

.hrms-profile-avatar i {
    font-size: 80px;
    opacity: 0.9;
}

.hrms-profile-basic h3 {
    margin: 0 0 5px;
    font-size: 24px;
    color: #fff;
}

.hrms-profile-basic p {
    margin: 3px 0;
    opacity: 0.9;
}

/* Filter Form */
.hrms-filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hrms-filter-form select,
.hrms-filter-form input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Payslip Page */
.hrms-payslips-page .hrms-table td strong {
    color: #2e7d32;
}

/* Responsive */
@media (max-width: 768px) {
    .hrms-dashboard-cards {
        grid-template-columns: 1fr;
    }

    .hrms-flex-row {
        flex-direction: column;
    }

    .hrms-form-grid {
        grid-template-columns: 1fr;
    }

    .hrms-profile-header {
        flex-direction: column;
        text-align: center;
    }

    .hrms-table {
        font-size: 12px;
    }

    .hrms-table th,
    .hrms-table td {
        padding: 8px 10px;
    }

    .hrms-checkin-btn {
        width: 120px;
        height: 120px;
        font-size: 16px !important;
        padding: 15px !important;
    }
}

/* Admin Wrap Override */
.hrms-wrap .wp-list-table {
    margin-top: 10px;
}

.hrms-wrap h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hrms-wrap h1 i {
    color: #2196F3;
}

/* Dashboard Sections Layout */
.hrms-dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1200px) {
    .hrms-dashboard-sections {
        grid-template-columns: 1fr;
    }
}

/* Action Button Spacing */
.wp-list-table .button {
    margin-right: 5px;
}

.wp-list-table .button:last-child {
    margin-right: 0;
}

/* ============================================
   Frontend Navigation Bar
   ============================================ */
.hrms-frontend-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.hrms-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #f8f9fa;
    color: #555;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.hrms-nav-btn:hover {
    background: #e3f2fd;
    color: #2196F3;
    text-decoration: none;
}

.hrms-nav-btn.hrms-nav-active {
    background: #2196F3;
    color: #fff;
    border-color: #1976D2;
}

.hrms-nav-btn.hrms-nav-logout {
    margin-left: auto;
    background: #ffebee;
    color: #c62828;
}

.hrms-nav-btn.hrms-nav-logout:hover {
    background: #f44336;
    color: #fff;
}

/* ============================================
   Admin HRMS Navigation Bar
   ============================================ */
.hrms-admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 15px 0 15px 0;
    margin: 0 0 15px 0;
    border-bottom: 3px solid #2196F3;
    background: #fff;
}

.hrms-admin-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #f0f0f0;
    color: #555;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.hrms-admin-nav-btn:hover {
    background: #e3f2fd;
    color: #2196F3;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.hrms-admin-nav-btn.hrms-nav-active {
    background: #2196F3;
    color: #fff;
    border-color: #1976D2;
    box-shadow: 0 2px 8px rgba(33,150,243,0.3);
}

.hrms-admin-nav-btn i {
    font-size: 14px;
}

/* Filter Bar */
.hrms-filter-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Work From Home status */
.hrms-status-work_from_home { background: #e3f2fd; color: #1565c0; }
.hrms-status-processing { background: #fff3e0; color: #e65100; }

/* Payslip Download Button */
.hrms-payslips-page a[target="_blank"] {
    text-decoration: none;
}

/* Responsive admin nav */
@media (max-width: 768px) {
    .hrms-admin-nav {
        gap: 4px;
    }
    .hrms-admin-nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}
