upskill-event-manager/assets/css/hvac-announcements.css
Ben cc34abb5fe feat: implement announcement modal system with comprehensive documentation
- Add interactive modal popup for announcement 'Read More' functionality
- Fix nonce conflict by creating separate hvac_announcements_ajax object
- Implement secure AJAX handler with rate limiting and permission checks
- Add comprehensive modal CSS with smooth animations and responsive design
- Include accessibility features (ARIA, keyboard navigation, screen reader support)
- Create detailed documentation in docs/ANNOUNCEMENT-MODAL-SYSTEM.md
- Update API-REFERENCE.md with new modal endpoints and security details
- Add automated Playwright E2E testing for modal functionality
- All modal interactions working: click to open, X to close, ESC to close, outside click
- Production-ready with full error handling and content sanitization

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 16:28:55 -03:00

1116 lines
No EOL
19 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 List */
.hvac-announcements-list {
max-width: 100%;
margin: 0 auto;
}
.announcement-item {
background: white;
border: 1px solid #e1e5e9;
border-radius: 8px;
margin-bottom: 20px;
padding: 25px;
transition: box-shadow 0.3s ease;
}
.announcement-item:hover {
box-shadow: 0 4px 12px rgba(0, 51, 102, 0.1);
}
.announcement-content {
display: flex;
gap: 20px;
align-items: flex-start;
}
.announcement-text {
flex: 1;
}
.announcement-title {
font-size: 24px;
font-weight: bold;
color: #003366;
margin: 0 0 10px 0;
line-height: 1.3;
}
.announcement-meta {
display: flex;
gap: 15px;
font-size: 14px;
color: #666;
margin-bottom: 15px;
}
.announcement-date {
font-weight: 500;
}
.announcement-excerpt {
color: #333;
line-height: 1.6;
margin-bottom: 15px;
font-size: 16px;
}
.announcement-actions {
margin-top: 15px;
}
.read-more-btn {
background: #003366;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: background-color 0.3s ease;
}
.read-more-btn:hover {
background: #0056b3;
}
.announcement-image {
flex-shrink: 0;
max-width: 200px;
}
.announcement-thumb {
width: 100%;
height: auto;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
/* Pagination */
.announcements-pagination {
text-align: center;
margin-top: 30px;
}
.load-more-announcements {
background: #003366;
color: white;
border: none;
padding: 12px 25px;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
font-weight: 500;
transition: background-color 0.3s ease;
}
.load-more-announcements:hover {
background: #0056b3;
}
/* No announcements state */
.no-announcements {
text-align: center;
padding: 40px 20px;
color: #666;
font-style: italic;
}
/* Announcement Modal */
.hvac-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
z-index: 10000;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.hvac-modal.active {
opacity: 1;
visibility: visible;
}
.hvac-modal .modal-content {
background: white;
border-radius: 8px;
max-width: 700px;
max-height: 80vh;
width: 90%;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
overflow: hidden;
transform: translateY(-20px);
transition: transform 0.3s ease;
}
.hvac-modal.active .modal-content {
transform: translateY(0);
}
.modal-header {
background: #003366;
color: white;
padding: 20px 25px;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-title {
margin: 0;
font-size: 22px;
font-weight: bold;
flex: 1;
}
.modal-close {
font-size: 28px;
font-weight: bold;
cursor: pointer;
color: white;
opacity: 0.7;
transition: opacity 0.3s ease;
margin-left: 15px;
}
.modal-close:hover {
opacity: 1;
}
.modal-body {
padding: 25px;
max-height: 60vh;
overflow-y: auto;
}
.modal-meta {
display: flex;
gap: 15px;
font-size: 14px;
color: #666;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.modal-meta .meta-date {
font-weight: 500;
}
.modal-content-text {
color: #333;
line-height: 1.7;
font-size: 16px;
}
.modal-content-text h1,
.modal-content-text h2,
.modal-content-text h3,
.modal-content-text h4,
.modal-content-text h5,
.modal-content-text h6 {
color: #003366;
margin-top: 25px;
margin-bottom: 15px;
}
.modal-content-text h1:first-child,
.modal-content-text h2:first-child,
.modal-content-text h3:first-child,
.modal-content-text h4:first-child,
.modal-content-text h5:first-child,
.modal-content-text h6:first-child {
margin-top: 0;
}
.modal-content-text p {
margin-bottom: 15px;
}
.modal-content-text ul,
.modal-content-text ol {
margin: 15px 0;
padding-left: 25px;
}
.modal-content-text li {
margin-bottom: 8px;
}
.modal-content-text strong {
font-weight: 600;
color: #003366;
}
/* Loading state */
.modal-loading {
text-align: center;
padding: 40px;
color: #666;
}
.modal-loading:before {
content: '';
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid #003366;
border-radius: 50%;
border-right-color: transparent;
animation: modal-spin 1s linear infinite;
margin-right: 10px;
vertical-align: middle;
}
@keyframes modal-spin {
to {
transform: rotate(360deg);
}
}
/* Prevent page scroll when modal is open */
body.modal-open {
overflow: hidden;
}
/* Responsive Design */
@media (max-width: 768px) {
.announcement-content {
flex-direction: column-reverse;
}
.announcement-image {
max-width: 100%;
margin-bottom: 15px;
}
.announcement-title {
font-size: 20px;
}
}
/* Announcements Timeline (Legacy) */
.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;
}
/* Iframe Isolation Wrapper */
.iframe-isolation-wrapper {
position: relative;
isolation: isolate;
contain: layout style;
background: white;
border-radius: 4px;
overflow: hidden;
}
.google-drive-iframe {
background: white;
border: 1px solid #ddd;
border-radius: 4px;
display: block;
transition: opacity 0.3s ease;
}
.google-drive-iframe:not([src]) {
opacity: 0.5;
background: #f9f9f9;
}
/* Google Drive Preview Card */
.google-drive-preview-card {
display: flex;
gap: 25px;
align-items: flex-start;
background: white;
padding: 30px;
border-radius: 12px;
border: 1px solid #e0e0e0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
margin: 20px 0;
}
.google-drive-preview-card:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
transform: translateY(-2px);
}
.drive-icon {
flex-shrink: 0;
margin-right: 5px;
}
.drive-content {
flex: 1;
}
.drive-content h3 {
margin: 0 0 15px 0;
color: #003366;
font-size: 24px;
font-weight: 600;
}
.drive-content > p {
margin: 0 0 20px 0;
color: #666;
line-height: 1.6;
}
.drive-features {
display: flex;
flex-wrap: wrap;
gap: 15px;
margin: 20px 0 25px 0;
}
.feature-item {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 15px;
background: #f0f7ff;
border: 1px solid #e3f2fd;
border-radius: 20px;
font-size: 14px;
color: #1976d2;
font-weight: 500;
}
.feature-item .dashicons {
font-size: 16px;
width: 16px;
height: 16px;
}
.drive-actions {
display: flex;
gap: 15px;
flex-wrap: wrap;
}
.primary-button {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 24px;
background: #4285F4;
color: white !important;
text-decoration: none;
border-radius: 8px;
font-weight: 600;
transition: all 0.3s ease;
border: 2px solid #4285F4;
}
.primary-button:hover {
background: #3367D6;
border-color: #3367D6;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}
.secondary-button {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 24px;
background: white;
color: #4285F4 !important;
text-decoration: none;
border: 2px solid #4285F4;
border-radius: 8px;
font-weight: 600;
transition: all 0.3s ease;
}
.secondary-button:hover {
background: #f0f7ff;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}
.primary-button .dashicons,
.secondary-button .dashicons {
font-size: 18px;
width: 18px;
height: 18px;
}
.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;
}
/* Google Drive Preview Card - Mobile */
.google-drive-preview-card {
flex-direction: column;
gap: 20px;
padding: 25px 20px;
text-align: center;
}
.drive-icon {
align-self: center;
}
.drive-features {
justify-content: center;
}
.feature-item {
font-size: 13px;
padding: 6px 12px;
}
.drive-actions {
justify-content: center;
flex-direction: column;
gap: 10px;
}
.primary-button,
.secondary-button {
justify-content: center;
padding: 14px 20px;
width: 100%;
max-width: 280px;
}
}