modal.css
4.89 KB
/* WorkersPanel Modal System - Reusable Styles */
/* Modal Overlay */
.wp-modal-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 9999;
align-items: center;
justify-content: center;
padding: 20px;
opacity: 0;
transition: opacity 0.3s ease;
}
.wp-modal-overlay.active {
display: flex;
opacity: 1;
}
/* Modal Container */
.wp-modal {
background: var(--bg-card);
border-radius: 12px;
width: 100%;
max-height: 90vh;
overflow: hidden;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
transform: scale(0.9);
opacity: 0;
transition: transform 0.3s ease, opacity 0.3s ease;
}
.wp-modal-overlay.active .wp-modal {
transform: scale(1);
opacity: 1;
}
/* Modal Sizes */
.wp-modal-small {
max-width: 400px;
}
.wp-modal-medium {
max-width: 600px;
}
.wp-modal-large {
max-width: 900px;
}
.wp-modal-fullscreen {
max-width: 95vw;
max-height: 95vh;
}
/* Modal Header */
.wp-modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.wp-modal-title {
margin: 0;
font-size: 1.25rem;
font-weight: 700;
color: var(--text-main);
}
.wp-modal-close {
background: none;
border: none;
font-size: 1.5rem;
color: var(--text-muted);
cursor: pointer;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
transition: all 0.2s;
}
.wp-modal-close:hover {
background: var(--bg-hover);
color: var(--text-main);
}
/* Modal Body */
.wp-modal-body {
padding: 20px;
overflow-y: auto;
flex: 1;
/* Hide scrollbar but keep functionality */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE/Edge */
}
.wp-modal-body::-webkit-scrollbar {
display: none; /* Chrome/Safari */
}
/* Modal Footer */
.wp-modal-footer {
display: flex;
gap: 10px;
justify-content: flex-end;
padding: 20px;
border-top: 1px solid var(--border);
flex-shrink: 0;
}
/* Loading State */
.wp-modal.loading {
pointer-events: none;
opacity: 0.6;
}
.wp-modal.loading::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 40px;
height: 40px;
border: 4px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: translate(-50%, -50%) rotate(360deg); }
}
/* Mobile Responsive */
@media (max-width: 768px) {
.wp-modal-overlay {
padding: 10px;
}
.wp-modal {
max-width: 100%;
max-height: 95vh;
}
.wp-modal-header {
padding: 15px;
}
.wp-modal-title {
font-size: 1.1rem;
}
.wp-modal-body {
padding: 15px;
}
.wp-modal-footer {
padding: 15px;
flex-direction: column;
}
.wp-modal-footer .btn {
width: 100%;
}
}
@media (max-width: 480px) {
.wp-modal-overlay {
padding: 0;
}
.wp-modal {
border-radius: 0;
max-height: 100vh;
}
.wp-modal-header {
padding: 12px 16px;
}
.wp-modal-body {
padding: 16px;
}
.wp-modal-footer {
padding: 12px 16px;
}
}
/* Form Styling Inside Modals */
.wp-modal-body .form-group {
margin-bottom: 16px;
}
.wp-modal-body .form-group label {
display: block;
margin-bottom: 6px;
font-weight: 600;
color: var(--text-main);
font-size: 0.9rem;
}
.wp-modal-body .form-input,
.wp-modal-body .form-control {
width: 100%;
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--bg-panel);
color: var(--text-main);
font-size: 0.95rem;
transition: all 0.2s;
}
.wp-modal-body .form-input:focus,
.wp-modal-body .form-control:focus {
outline: none;
border-color: var(--accent);
background: var(--bg-card);
}
.wp-modal-body .form-help {
display: block;
margin-top: 4px;
font-size: 0.85rem;
color: var(--text-muted);
}
/* Info Display Styling */
.wp-modal-body .info-row {
margin-bottom: 16px;
}
.wp-modal-body .info-label {
font-weight: 700;
color: var(--text-muted);
font-size: 0.85rem;
display: block;
margin-bottom: 6px;
}
.wp-modal-body .info-value {
font-size: 1rem;
color: var(--text-main);
line-height: 1.5;
}
/* Annual Leave Staff Selector */
#selectedStaffBox {
max-height: 200px;
overflow-y: auto;
}
#selectedStaffList {
min-height: 50px;
}
.staff-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
background: var(--accent-soft);
border: 1px solid var(--accent);
border-radius: 6px;
font-size: 0.9rem;
margin: 2px;
}
.staff-badge button {
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: 0;
font-size: 1.1rem;
line-height: 1;
transition: color 0.2s;
}
.staff-badge button:hover {
color: var(--text-danger);
}