upskill-event-manager/assets/css/hvac-announcements.css
Ben c20b461e7d feat: Implement secure Trainer Announcements system with comprehensive features
This commit introduces a complete announcement management system for HVAC trainers
with enterprise-grade security, performance optimization, and email notifications.

## Core Features
- Custom post type for trainer announcements with categories and tags
- Role-based permissions (master trainers can create/edit, all trainers can read)
- AJAX-powered admin interface with real-time updates
- Modal popup viewing for announcements on frontend
- Automated email notifications when announcements are published
- Google Drive integration for training resources

## Security Enhancements
- Fixed critical capability mapping bug preventing proper permission checks
- Added content disclosure protection for draft/private announcements
- Fixed XSS vulnerabilities with proper output escaping and sanitization
- Implemented permission checks on all AJAX endpoints
- Added rate limiting to prevent abuse (30 requests/minute)
- Email validation before sending notifications

## Performance Optimizations
- Implemented intelligent caching for user queries (5-minute TTL)
- Added cache versioning for announcement lists (2-minute TTL)
- Automatic cache invalidation on content changes
- Batch email processing to prevent timeouts (50 emails per batch)
- Retry mechanism for failed email sends (max 3 attempts)

## Technical Implementation
- Singleton pattern for all manager classes
- WordPress coding standards compliance
- Proper nonce verification on all AJAX requests
- Comprehensive error handling and logging
- Mobile-responsive UI with smooth animations
- WCAG accessibility compliance

## Components Added
- 6 PHP classes for modular architecture
- 2 page templates (master announcements, trainer resources)
- Admin and frontend JavaScript with jQuery integration
- Comprehensive CSS for both admin and frontend
- Email notification system with HTML templates
- Complete documentation and implementation plans

This system provides a secure, scalable foundation for trainer communications
while following WordPress best practices and maintaining high code quality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 13:34:15 -03:00

645 lines
No EOL
11 KiB
CSS

/**
* HVAC Announcements General Styles
*
* @package HVAC_Community_Events
*/
/* Trainer Resources Page */
.hvac-trainer-resources-page {
padding: 20px 0;
}
.hvac-resources-wrapper {
max-width: 1200px;
margin: 0 auto;
}
.page-description {
color: #666;
font-size: 16px;
margin-top: 10px;
}
/* Resources Sections */
.resources-section {
margin-bottom: 50px;
background: #fff;
border-radius: 8px;
padding: 30px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.section-title {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 25px;
padding-bottom: 15px;
border-bottom: 2px solid #003366;
color: #003366;
font-size: 24px;
}
.section-title .dashicons {
font-size: 28px;
width: 28px;
height: 28px;
}
/* Announcements Timeline */
.hvac-announcements-timeline {
position: relative;
}
.timeline-wrapper {
position: relative;
padding-left: 40px;
}
.timeline-wrapper::before {
content: '';
position: absolute;
left: 15px;
top: 0;
bottom: 0;
width: 2px;
background: #e0e0e0;
}
.timeline-item {
position: relative;
margin-bottom: 40px;
}
.timeline-marker {
position: absolute;
left: -30px;
top: 5px;
width: 12px;
height: 12px;
border-radius: 50%;
background: #003366;
border: 3px solid #fff;
box-shadow: 0 0 0 2px #e0e0e0;
}
.timeline-content {
background: #f9f9f9;
padding: 20px;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
.timeline-header {
margin-bottom: 15px;
}
.timeline-title {
margin: 0 0 10px 0;
font-size: 20px;
}
.timeline-title a {
color: #003366;
text-decoration: none;
}
.timeline-title a:hover {
color: #0056b3;
text-decoration: underline;
}
.timeline-meta {
display: flex;
gap: 15px;
font-size: 14px;
color: #666;
}
.timeline-thumbnail {
margin: 15px 0;
}
.timeline-thumbnail img {
max-width: 100%;
height: auto;
border-radius: 4px;
}
.timeline-excerpt {
margin: 15px 0;
line-height: 1.6;
}
.timeline-categories {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 15px;
}
.category-badge {
display: inline-block;
padding: 4px 10px;
background: #003366;
color: white;
border-radius: 15px;
font-size: 12px;
}
.timeline-pagination {
text-align: center;
margin-top: 30px;
}
.load-more-announcements {
padding: 10px 30px;
background: #003366;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
.load-more-announcements:hover {
background: #0056b3;
}
.no-announcements {
text-align: center;
padding: 40px;
color: #666;
font-style: italic;
}
/* Announcements List */
.hvac-announcements-list {
margin: 20px 0;
}
.announcements-list {
list-style: none;
padding: 0;
margin: 0;
}
.announcement-item {
padding: 20px 0;
border-bottom: 1px solid #e0e0e0;
}
.announcement-item:last-child {
border-bottom: none;
}
.announcement-title {
margin: 0 0 10px 0;
font-size: 18px;
}
.announcement-meta {
display: flex;
gap: 15px;
font-size: 14px;
color: #666;
margin-bottom: 10px;
}
.announcement-excerpt {
line-height: 1.6;
color: #333;
}
/* Google Drive Section */
.google-drive-description {
margin-bottom: 20px;
color: #666;
}
.google-drive-container {
background: #f5f5f5;
padding: 20px;
border-radius: 4px;
}
.google-drive-iframe {
background: white;
border: 1px solid #ddd;
border-radius: 4px;
}
.google-drive-footer {
text-align: center;
margin-top: 20px;
}
.google-drive-footer .button {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 10px 20px;
background: #003366;
color: white;
text-decoration: none;
border-radius: 4px;
}
.google-drive-footer .button:hover {
background: #0056b3;
}
.help-text {
margin-top: 10px;
color: #666;
font-size: 14px;
}
/* Quick Links Grid */
.quick-links-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-top: 20px;
}
.resource-card {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 30px 20px;
background: #f9f9f9;
border: 1px solid #e0e0e0;
border-radius: 8px;
text-decoration: none;
color: #333;
transition: all 0.3s ease;
}
.resource-card:hover {
background: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}
.resource-card .dashicons {
font-size: 48px;
width: 48px;
height: 48px;
color: #003366;
margin-bottom: 15px;
}
.resource-card h3 {
margin: 0 0 10px 0;
font-size: 18px;
color: #003366;
}
.resource-card p {
margin: 0;
color: #666;
font-size: 14px;
}
/* Announcement Modal (for viewing) */
.announcement-full {
padding: 20px;
}
.announcement-header {
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 2px solid #e0e0e0;
}
.announcement-header h2 {
margin: 0 0 10px 0;
color: #003366;
}
.announcement-featured-image {
margin: 20px 0;
text-align: center;
}
.announcement-featured-image img {
max-width: 100%;
height: auto;
border-radius: 4px;
}
.announcement-content {
line-height: 1.6;
color: #333;
}
.announcement-content h1,
.announcement-content h2,
.announcement-content h3,
.announcement-content h4,
.announcement-content h5,
.announcement-content h6 {
color: #003366;
margin-top: 25px;
margin-bottom: 15px;
}
.announcement-footer {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #e0e0e0;
color: #666;
font-size: 14px;
}
/* Modal Styles */
.hvac-modal {
display: none;
position: fixed;
z-index: 999999;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.6);
animation: fadeIn 0.3s;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.hvac-modal .modal-content {
background-color: #fefefe;
margin: 40px auto;
padding: 0;
border-radius: 8px;
width: 90%;
max-width: 900px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
position: relative;
animation: slideIn 0.3s;
}
@keyframes slideIn {
from {
transform: translateY(-30px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.hvac-modal .modal-close {
color: #aaa;
position: absolute;
top: 15px;
right: 20px;
font-size: 32px;
font-weight: bold;
cursor: pointer;
z-index: 10;
background: white;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
transition: all 0.3s ease;
}
.hvac-modal .modal-close:hover,
.hvac-modal .modal-close:focus {
color: #003366;
transform: rotate(90deg);
}
.hvac-modal .modal-body {
padding: 30px;
}
/* Loading state */
.modal-loading {
text-align: center;
padding: 60px 20px;
}
.modal-loading .spinner {
display: inline-block;
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid #003366;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 20px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.modal-loading p {
color: #666;
font-size: 16px;
margin: 0;
}
/* Error state */
.modal-error {
text-align: center;
padding: 40px 20px;
color: #d32f2f;
}
.modal-error p {
margin: 0;
font-size: 16px;
}
/* Body state when modal is open */
body.modal-open {
overflow: hidden;
}
/* Announcement content in modal */
.hvac-modal .announcement-full {
padding: 0;
}
.hvac-modal .announcement-header {
margin-bottom: 25px;
padding-bottom: 20px;
border-bottom: 2px solid #003366;
}
.hvac-modal .announcement-header h2 {
margin: 0 40px 15px 0;
color: #003366;
font-size: 28px;
line-height: 1.3;
}
.hvac-modal .announcement-meta {
display: flex;
gap: 20px;
font-size: 14px;
color: #666;
}
.hvac-modal .announcement-meta span {
display: flex;
align-items: center;
gap: 5px;
}
.hvac-modal .announcement-featured-image {
margin: 25px 0;
text-align: center;
}
.hvac-modal .announcement-featured-image img {
max-width: 100%;
height: auto;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.hvac-modal .announcement-content {
font-size: 16px;
line-height: 1.7;
color: #333;
}
.hvac-modal .announcement-content h1,
.hvac-modal .announcement-content h2,
.hvac-modal .announcement-content h3,
.hvac-modal .announcement-content h4,
.hvac-modal .announcement-content h5,
.hvac-modal .announcement-content h6 {
color: #003366;
margin-top: 30px;
margin-bottom: 15px;
font-weight: 600;
}
.hvac-modal .announcement-content p {
margin-bottom: 15px;
}
.hvac-modal .announcement-content ul,
.hvac-modal .announcement-content ol {
margin: 0 0 20px 20px;
padding-left: 20px;
}
.hvac-modal .announcement-content li {
margin-bottom: 8px;
}
.hvac-modal .announcement-content a {
color: #0056b3;
text-decoration: underline;
}
.hvac-modal .announcement-content a:hover {
color: #003366;
}
.hvac-modal .announcement-content blockquote {
margin: 20px 0;
padding: 15px 20px;
background: #f5f5f5;
border-left: 4px solid #003366;
font-style: italic;
}
.hvac-modal .announcement-footer {
margin-top: 35px;
padding-top: 20px;
border-top: 1px solid #e0e0e0;
color: #666;
font-size: 14px;
}
.hvac-modal .announcement-footer strong {
color: #333;
margin-right: 5px;
}
/* Make announcement links look clickable */
.announcement-link {
cursor: pointer;
transition: color 0.2s ease;
}
.announcement-link:hover {
color: #0056b3 !important;
}
/* Responsive */
@media (max-width: 768px) {
.timeline-wrapper {
padding-left: 20px;
}
.timeline-wrapper::before {
left: 5px;
}
.timeline-marker {
left: -20px;
}
.quick-links-grid {
grid-template-columns: 1fr;
}
.section-title {
font-size: 20px;
}
.google-drive-iframe {
height: 400px !important;
}
/* Modal responsive styles */
.hvac-modal .modal-content {
margin: 20px auto;
width: 95%;
max-height: 95vh;
}
.hvac-modal .modal-body {
padding: 20px;
}
.hvac-modal .modal-close {
top: 10px;
right: 10px;
width: 35px;
height: 35px;
font-size: 28px;
}
.hvac-modal .announcement-header h2 {
font-size: 24px;
margin-right: 35px;
}
.hvac-modal .announcement-meta {
flex-direction: column;
gap: 10px;
}
}