/**
 * ACHPER Renewal Dashboard CSS
 * Styles for the renewal column in the dashboard listings table
 */

/* Renewal Column */
.directorist-table-renewal {
    min-width: 150px;
    white-space: nowrap;
}

.directorist-table-renewal-cell {
    vertical-align: middle;
}

.achper-renewal-column {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

/* Renewal Status Badge */
.achper-renewal-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.achper-renewal-status.achper-renewal-none {
    color: #666;
    background: #f5f5f5;
}

.achper-renewal-status.achper-renewal-eligible {
    color: #856404;
    background: #fff3cd;
}

.achper-renewal-status.achper-renewal-pending {
    color: #004085;
    background: #cce5ff;
}

.achper-renewal-status.achper-renewal-requested {
    color: #155724;
    background: #d4edda;
}

.achper-renewal-status.achper-renewal-expire {
    color: #721c24;
    background: #f8d7da;
}

.achper-renewal-status.achper-renewal-expired {
    color: #721c24;
    background: #f8d7da;
    font-weight: 600;
}

/* Days Until Expiry Wrapper */
.achper-renewal-days-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Days Until Expiry */
.achper-renewal-days {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.achper-renewal-expired-days {
    color: #dc3545;
    font-weight: 600;
}

/* Change Link */
.achper-renewal-change-link {
    font-size: 11px;
    color: #124a99;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.achper-renewal-change-link:hover {
    color: #0d3a7a;
    text-decoration: underline;
}

.achper-renewal-change-link.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Renewal Actions */
.achper-renewal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.achper-renewal-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    transition: all 0.2s ease;
}

.achper-renewal-action:hover {
    background: #f8f9fa;
    border-color: #bbb;
    color: #000;
}

.achper-renewal-action.achper-renewal-yes {
    color: #28a745;
    border-color: #28a745;
}

.achper-renewal-action.achper-renewal-yes:hover {
    background: #28a745;
    color: #fff;
}

/* Active state for "yes" button (when intent is already 'yes') */
.achper-renewal-action.achper-renewal-yes.achper-renewal-active {
    background: #28a745;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.achper-renewal-action.achper-renewal-yes.achper-renewal-active:hover {
    background: #218838;
    border-color: #218838;
}

.achper-renewal-action.achper-renewal-no {
    color: #dc3545;
    border-color: #dc3545;
}

.achper-renewal-action.achper-renewal-no:hover {
    background: #dc3545;
    color: #fff;
}

/* Active state for "no" button (when intent is already 'no') */
.achper-renewal-action.achper-renewal-no.achper-renewal-active {
    background: #dc3545;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.achper-renewal-action.achper-renewal-no.achper-renewal-active:hover {
    background: #c82333;
    border-color: #c82333;
}

.achper-renewal-action.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.achper-renewal-action.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading State */
.achper-renewal-loading {
    opacity: 0.6;
    pointer-events: none;
}

.achper-renewal-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Invoice/Assessment Action Buttons - REMOVED from renewal column */
/* These buttons are now only available in the dedicated invoices/assessments sections */

/* Mobile Responsive - Keep existing table scroll behavior */
@media (max-width: 768px) {
    .directorist-table-renewal {
        min-width: 120px;
    }
    
    .achper-renewal-column {
        gap: 4px;
    }
    
    .achper-renewal-status {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .achper-renewal-days {
        font-size: 10px;
    }
    
    .achper-renewal-change-link {
        font-size: 10px;
    }
    
    .achper-renewal-actions {
        gap: 3px;
    }
    
    .achper-renewal-action {
        padding: 4px 8px !important;
    }
    
    .achper-renewal-action i {
        font-size: 14px !important;
    }
}

/* Ensure table scrolls on mobile (matches existing behavior) */
.directorist-table-responsive {
    display: block !important;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}
