/**
 * Workflow Dynamic Content Styles
 * Styles for dynamically loaded workflow data from XML
 * Based on real app patterns from JSP files
 */

/* ===== Shared Card Styles ===== */
.activity-card,
.report-card,
.table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gw-gray-200, #e8eaed);
    overflow: hidden;
}

.activity-card-header,
.report-card-header,
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gw-gray-50, #f8f9fa);
    border-bottom: 1px solid var(--gw-gray-200, #e8eaed);
}

.activity-card-body,
.report-card-body {
    padding: 16px 20px;
}

/* ===== Shared Table Styles ===== */
.data-table,
.report-table,
.log-table,
.members-table,
.roles-table,
.workflow-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.report-table th,
.log-table th,
.members-table th,
.roles-table th,
.workflow-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 500;
    font-size: 12px;
    color: var(--gw-gray-600, #5f6368);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gw-gray-200, #e8eaed);
    background: var(--gw-gray-50, #f8f9fa);
}

.data-table td,
.report-table td,
.log-table td,
.members-table td,
.roles-table td,
.workflow-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--gw-gray-100, #f1f3f4);
    color: var(--gw-gray-800, #3c4043);
}

.data-table tr:hover,
.report-table tr:hover,
.log-table tr:hover,
.members-table tr:hover,
.roles-table tr:hover,
.workflow-table tr:hover {
    background: var(--gw-gray-50, #f8f9fa);
}

.data-table tr.selected,
.members-table tr.selected,
.roles-table tr.selected,
.workflow-table tr.selected {
    background: #e8f0fe;
}

/* ===== Shared Toolbar Styles ===== */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gw-gray-200, #e8eaed);
    background: var(--gw-gray-50, #f8f9fa);
}

.table-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--gw-gray-800, #3c4043);
}

.table-title i {
    font-size: 18px;
    color: var(--gw-primary, #1a73e8);
}

.table-actions {
    display: flex;
    gap: 4px;
}

.toolbar-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gw-gray-600, #5f6368);
    transition: background 0.2s ease;
}

.toolbar-btn:hover {
    background: var(--gw-gray-200, #e8eaed);
}

.toolbar-btn i {
    font-size: 18px;
}

/* ===== Table Footer ===== */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--gw-gray-200, #e8eaed);
    font-size: 12px;
    color: var(--gw-gray-500, #80868b);
}

/* ===== Radio Cell ===== */
.radio-cell {
    text-align: center;
    width: 40px;
}

/* ===== Action Buttons ===== */
.result-btn,
.action-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-btn i,
.action-link-btn i {
    font-size: 18px;
}

.result-btn.btn-success {
    background: var(--gw-success, #34a853);
    color: white;
}

.result-btn.btn-success:hover {
    background: #2d9249;
}

.result-btn.btn-danger {
    background: #ea4335;
    color: white;
}

.result-btn.btn-danger:hover {
    background: #d33426;
}

.result-btn.btn-primary {
    background: var(--gw-primary, #1a73e8);
    color: white;
}

.result-btn.btn-primary:hover {
    background: #1557b0;
}

.result-btn.btn-secondary {
    background: #5f6368;
    color: white;
}

.result-btn.btn-secondary:hover {
    background: #4a4d51;
}

.action-link-btn {
    background: none;
    border: none;
    color: var(--gw-primary, #1a73e8);
    padding: 4px 8px;
}

.action-link-btn:hover {
    background: rgba(26, 115, 232, 0.1);
}

/* ===== Badges ===== */
.type-badge,
.role-badge,
.event-badge,
.item-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.type-badge.user {
    background: #e3f2fd;
    color: #1565c0;
}

.type-badge.group {
    background: #e8f5e9;
    color: #2e7d32;
}

.role-badge {
    background: var(--gw-gray-100, #f1f3f4);
    color: var(--gw-gray-700, #5f6368);
    border-radius: 12px;
    padding: 3px 10px;
}

.event-badge.event-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.event-badge.event-started {
    background: #e3f2fd;
    color: #1565c0;
}

.event-badge.event-created {
    background: #fff3e0;
    color: #ef6c00;
}

.item-type-badge {
    background: var(--gw-gray-100, #f1f3f4);
    color: var(--gw-gray-600, #5f6368);
}

/* ===== Search Box ===== */
.search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--gw-gray-300, #dadce0);
    border-radius: 4px;
    padding: 4px 8px;
}

.search-box i {
    font-size: 18px;
    color: var(--gw-gray-500);
    margin-right: 4px;
}

.search-box input {
    border: none;
    outline: none;
    font-size: 13px;
    width: 150px;
}

/* ===== Pagination ===== */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    background: transparent;
    border: 1px solid var(--gw-gray-300, #dadce0);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn i {
    font-size: 18px;
}

.page-info {
    font-size: 12px;
    color: var(--gw-gray-600);
}

/* ===== Workflow Timeline ===== */
.workflow-timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    display: flex;
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gw-gray-200, #e8eaed);
    color: var(--gw-gray-600, #5f6368);
    z-index: 1;
}

.timeline-item.activity-completed .timeline-marker {
    background: var(--gw-success, #34a853);
    color: white;
}

.timeline-item.activity-current .timeline-marker {
    background: var(--gw-primary, #1a73e8);
    color: white;
    animation: pulse 2s infinite;
}

.timeline-item.activity-pending .timeline-marker {
    background: var(--gw-gray-200, #e8eaed);
    color: var(--gw-gray-500, #80868b);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(26, 115, 232, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); }
}

.timeline-marker i {
    font-size: 20px;
}

.timeline-line {
    position: absolute;
    left: 19px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: var(--gw-gray-300, #dadce0);
}

.timeline-item.activity-completed .timeline-line {
    background: var(--gw-success, #34a853);
}

.timeline-content {
    flex: 1;
    margin-left: 16px;
    background: var(--gw-gray-50, #f8f9fa);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--gw-gray-200, #e8eaed);
}

.timeline-item.activity-current .timeline-content {
    border-color: var(--gw-primary, #1a73e8);
    background: rgba(26, 115, 232, 0.05);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.timeline-title {
    font-weight: 500;
    font-size: 15px;
    color: var(--gw-gray-900, #202124);
}

.timeline-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.timeline-status.activity-completed {
    background: rgba(52, 168, 83, 0.1);
    color: var(--gw-success, #34a853);
}

.timeline-status.activity-current {
    background: rgba(26, 115, 232, 0.1);
    color: var(--gw-primary, #1a73e8);
}

.timeline-status.activity-pending {
    background: var(--gw-gray-100, #f1f3f4);
    color: var(--gw-gray-600, #5f6368);
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--gw-gray-600, #5f6368);
}

.timeline-meta span {
    display: inline-flex;
    align-items: center;
}

.timeline-completed,
.timeline-date {
    font-size: 12px;
    color: var(--gw-gray-500, #80868b);
    margin-top: 8px;
}

/* ===== Sub-Activities ===== */
.sub-activities {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--gw-gray-300, #dadce0);
}

.sub-activity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    border: 1px solid var(--gw-gray-200, #e8eaed);
}

.sub-activity-item i {
    font-size: 16px;
    color: var(--gw-gray-500, #80868b);
}

.sub-activity-item .sub-name {
    font-weight: 500;
    color: var(--gw-gray-800, #3c4043);
}

.sub-activity-item .sub-role {
    color: var(--gw-gray-600, #5f6368);
}

.sub-activity-item .sub-status {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: capitalize;
}

.sub-activity-item.completed .sub-status {
    background: rgba(52, 168, 83, 0.1);
    color: var(--gw-success, #34a853);
}

.sub-activity-item.in-progress .sub-status {
    background: rgba(26, 115, 232, 0.1);
    color: var(--gw-primary, #1a73e8);
}

.sub-activity-item.pending .sub-status {
    background: var(--gw-gray-100, #f1f3f4);
    color: var(--gw-gray-600, #5f6368);
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.activity-completed {
    background: rgba(52, 168, 83, 0.1);
    color: var(--gw-success, #34a853);
}

.status-badge.activity-current {
    background: rgba(26, 115, 232, 0.1);
    color: var(--gw-primary, #1a73e8);
}

.status-badge.activity-pending {
    background: var(--gw-gray-100, #f1f3f4);
    color: var(--gw-gray-600, #5f6368);
}

/* ===== Data Table Enhancements ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: var(--gw-gray-100, #f1f3f4);
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    color: var(--gw-gray-700, #5f6368);
    border-bottom: 2px solid var(--gw-gray-200, #e8eaed);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gw-gray-200, #e8eaed);
    color: var(--gw-gray-800, #3c4043);
}

.data-table tr:hover {
    background: var(--gw-gray-50, #f8f9fa);
}

.data-table tr.activity-completed td:first-child {
    border-left: 3px solid var(--gw-success, #34a853);
}

.data-table tr.activity-current td:first-child {
    border-left: 3px solid var(--gw-primary, #1a73e8);
}

.data-table .actions-preview {
    font-size: 12px;
    color: var(--gw-gray-500, #80868b);
    cursor: help;
}

/* ===== Members List Enhancements ===== */
.members-list {
    display: grid;
    gap: 12px;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gw-gray-200, #e8eaed);
    transition: all 0.2s ease;
}

.member-item:hover {
    border-color: var(--gw-primary, #1a73e8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gw-primary, #1a73e8), #4285f4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 16px;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    margin-left: 16px;
}

.member-name {
    font-weight: 500;
    color: var(--gw-gray-900, #202124);
    font-size: 14px;
}

.member-role {
    font-size: 13px;
    color: var(--gw-primary, #1a73e8);
    margin-top: 2px;
}

.member-email {
    font-size: 12px;
    color: var(--gw-gray-500, #80868b);
    margin-top: 2px;
}

.member-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.member-status.active {
    background: rgba(52, 168, 83, 0.1);
    color: var(--gw-success, #34a853);
}

/* ===== Roles Table ===== */
.roles-table {
    width: 100%;
}

/* ===== Loading States ===== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .timeline-content {
        margin-left: 12px;
        padding: 12px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .timeline-meta {
        flex-direction: column;
        gap: 4px;
    }

    .sub-activity-item {
        flex-wrap: wrap;
    }

    .sub-activity-item .sub-status {
        margin-left: 24px;
        margin-top: 4px;
    }

    .member-item {
        flex-wrap: wrap;
    }

    .member-status {
        margin-left: 60px;
        margin-top: 8px;
    }
}
