/**
 * CADENCE — FWC management styles.
 * SLA badges, color-coded sections, responsive design.
 */

/* ============ SLA COMPLIANCE BADGES ============ */

.sla-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.sla-complete {
    background-color: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.sla-complete:hover {
    background-color: #bbf7d0;
    transform: translateY(-1px);
}

.sla-pending {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.sla-pending:hover {
    background-color: #fde68a;
}

.sla-urgent {
    background-color: #fed7aa;
    color: #c2410c;
    border-color: #fdba74;
    animation: pulse-urgent 2s infinite;
}

@keyframes pulse-urgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.sla-overdue {
    background-color: #fecaca;
    color: #dc2626;
    border-color: #fca5a5;
    animation: pulse-overdue 1.5s infinite;
}

@keyframes pulse-overdue {
    0%, 100% { 
        background-color: #fecaca; 
        transform: scale(1);
    }
    50% { 
        background-color: #fca5a5;
        transform: scale(1.05);
    }
}

.sla-breach {
    background-color: #fecaca;
    color: #dc2626;
    border-color: #f87171;
    font-weight: 700;
}

.sla-unknown {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

/* ============ FWC TABLE ENHANCEMENTS ============ */

.fwc-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.fwc-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.fwc-table th {
    padding: 12px 16px;
    font-weight: 600;
    text-align: left;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.fwc-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.fwc-table tbody tr:hover {
    background-color: #f8fafc;
}

.fwc-table td {
    padding: 12px 16px;
    vertical-align: top;
    font-size: 14px;
}

/* ============ WORK PACKAGE TYPE SECTIONS ============ */

.fwc-section-amendments {
    background: #fef2f2;
    border-left: 4px solid #fca5a5;
    color: #991b1b;
}

.fwc-section-meetings {
    background: #eff6ff;
    border-left: 4px solid #93c5fd;
    color: #1d4ed8;
}

.fwc-section-reports {
    background: #f0fdf4;
    border-left: 4px solid #86efac;
    color: #166534;
}

.fwc-section-general {
    background: #f8fafc;
    border-left: 4px solid #cbd5e1;
    color: #475569;
}

/* ============ TYPE INDICATORS ============ */

.fwc-type-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 13px;
}

.fwc-type-indicator.amendments {
    color: #991b1b;
}

.fwc-type-indicator.meetings {
    color: #1d4ed8;
}

.fwc-type-indicator.reports {
    color: #166534;
}

/* ============ CONTENT STYLING ============ */

.fwc-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.4;
}

.fwc-subtitle {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.fwc-date {
    font-weight: 500;
    color: #374151;
}

.fwc-date-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* ============ ACTION BUTTONS ============ */

.fwc-action-button {
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fwc-action-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fwc-action-button.amendments {
    background: #991b1b;
}

.fwc-action-button.amendments:hover {
    background: #7f1d1d;
}

.fwc-action-button.meetings {
    background: #1d4ed8;
}

.fwc-action-button.meetings:hover {
    background: #1e40af;
}

.fwc-action-button.reports {
    background: #166534;
}

.fwc-action-button.reports:hover {
    background: #14532d;
}

/* ============ RESPONSIVE DESIGN ============ */

@media (max-width: 1200px) {
    .fwc-table th,
    .fwc-table td {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .fwc-title {
        font-size: 14px;
    }
    
    .sla-badge {
        padding: 4px 8px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .fwc-table {
        font-size: 12px;
    }
    
    .fwc-table th,
    .fwc-table td {
        padding: 6px 8px;
    }
    
    .fwc-table th:nth-child(3),
    .fwc-table td:nth-child(3),
    .fwc-table th:nth-child(4),
    .fwc-table td:nth-child(4) {
        display: none; /* Hide less critical columns on mobile */
    }
    
    .sla-badge {
        padding: 3px 6px;
        font-size: 10px;
    }
}

/* ============ ENHANCED VISUAL EFFECTS ============ */

.fwc-row-amendments {
    border-left: 4px solid #fca5a5;
    background: linear-gradient(90deg, #fef2f2 0%, #ffffff 2%);
}

.fwc-row-meetings {
    border-left: 4px solid #93c5fd;
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 2%);
}

.fwc-row-reports {
    border-left: 4px solid #86efac;
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 2%);
}

.fwc-row-general {
    border-left: 4px solid #cbd5e1;
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 2%);
}

/* ============ LOADING STATES ============ */

.fwc-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    font-size: 14px;
    color: #6b7280;
}

.fwc-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ EMPTY STATES ============ */

.fwc-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.fwc-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.fwc-empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.fwc-empty-description {
    font-size: 14px;
    line-height: 1.5;
}

/* ============ ENHANCED TOOLTIPS ============ */

.fwc-tooltip {
    position: relative;
    cursor: help;
}

.fwc-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

.fwc-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ============ STATUS INDICATORS ============ */

.fwc-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.fwc-status-dot.complete {
    background-color: #10b981;
}

.fwc-status-dot.pending {
    background-color: #f59e0b;
}

.fwc-status-dot.urgent {
    background-color: #f97316;
    animation: pulse-dot 2s infinite;
}

.fwc-status-dot.overdue {
    background-color: #ef4444;
    animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* ============ SECTION HEADERS ============ */

.fwc-section-header {
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 2px solid;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fwc-section-header .count {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ============ ACCESSIBILITY IMPROVEMENTS ============ */

.fwc-table:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.fwc-action-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.sla-badge[aria-label] {
    position: relative;
}

/* ============ PRINT STYLES ============ */

@media print {
    .fwc-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .fwc-action-button {
        display: none;
    }
    
    .sla-badge {
        border: 1px solid #000;
        background: white !important;
        color: black !important;
    }
    
    .fwc-row-amendments,
    .fwc-row-meetings,
    .fwc-row-reports,
    .fwc-row-general {
        background: white !important;
        border-left: 2px solid #000;
    }
}

/* ============ DARK MODE SUPPORT ============ */

@media (prefers-color-scheme: dark) {
    .fwc-table {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .fwc-table tbody tr {
        border-bottom-color: #374151;
    }
    
    .fwc-table tbody tr:hover {
        background-color: #374151;
    }
    
    .fwc-title {
        color: #f9fafb;
    }
    
    .fwc-subtitle,
    .fwc-date-label {
        color: #9ca3af;
    }
    
    .fwc-date {
        color: #d1d5db;
    }
    
    .fwc-empty {
        color: #9ca3af;
    }
    
    .fwc-empty-title {
        color: #d1d5db;
    }
}

/* ============ ANIMATION CLASSES ============ */

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============ UTILITY CLASSES ============ */

.fwc-text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fwc-text-wrap {
    word-wrap: break-word;
    word-break: break-word;
}

.fwc-hidden {
    display: none !important;
}

.fwc-visible {
    display: block !important;
}

.fwc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/**
 * Enhanced Card View Styles - Modern, Corporate, Functional
 * Add this CSS to your styles or include as separate stylesheet
 */

/* ===== CARD GRID LAYOUT ===== */
#cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    padding: 8px;
}

@media (max-width: 768px) {
    #cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ===== MODERN CARD DESIGN ===== */
.wp-card-modern {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.wp-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.wp-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wp-card-modern:hover::before {
    opacity: 1;
}

/* ===== CARD HEADER ===== */
.wp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.wp-card-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-icon {
    font-size: 18px;
    line-height: 1;
}

.type-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wp-card-id {
    font-size: 0.875rem;
    font-weight: 700;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

/* ===== CARD BODY ===== */
.wp-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wp-card-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
    color: #1e293b;
    min-height: 44px;
}

.wp-card-link {
    color: #1e293b;
    text-decoration: none;
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    transition: color 0.2s ease;
}

.wp-card-link:hover {
    color: #6366f1;
}

.wp-card-link .external-icon {
    font-size: 0.75rem;
    color: #94a3b8;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(2px);
}

.wp-card-link:hover .external-icon {
    opacity: 1;
    transform: translateY(0);
    color: #6366f1;
}

/* ===== CARD METADATA ===== */
.wp-card-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meta-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.meta-icon {
    font-size: 16px;
    line-height: 1;
    opacity: 0.6;
    flex-shrink: 0;
    margin-top: 2px;
}

.meta-content {
    flex: 1;
    min-width: 0;
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.meta-value {
    font-size: 0.875rem;
    color: #334155;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid;
    transition: all 0.2s ease;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Status variants */
.status-new {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-color: #3b82f6;
}

.status-new .status-dot {
    background: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.status-active {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #6d28d9;
    border-color: #8b5cf6;
}

.status-active .status-dot {
    background: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.status-complete {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-color: #10b981;
}

.status-complete .status-dot {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-rejected {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: #ef4444;
}

.status-rejected .status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #f59e0b;
}

.status-pending .status-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-default {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border-color: #94a3b8;
}

.status-default .status-dot {
    background: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
}

/* ===== CARD FOOTER ===== */
.wp-card-footer {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.card-action-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.card-action-btn:hover::before {
    left: 100%;
}

.card-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.card-action-btn:active {
    transform: translateY(0);
}

.btn-arrow {
    font-size: 1rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.card-action-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* ===== EMPTY STATE ===== */
.empty-state-modern {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state-modern h3 {
    font-size: 1.5rem;
    color: #475569;
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-state-modern p {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
}

/* ===== LOADING ANIMATION ===== */
.wp-card-modern.loading {
    pointer-events: none;
    opacity: 0.6;
}

.wp-card-modern.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    to { left: 100%; }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 480px) {
    .wp-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .wp-card-title {
        font-size: 0.95rem;
        min-height: auto;
    }
    
    .meta-item {
        font-size: 0.85rem;
    }
}

/* ===== ACCESSIBILITY ===== */
.wp-card-modern:focus-within {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.card-action-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .wp-card-modern {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .card-action-btn {
        display: none;
    }
}