/* Generic diff viewer styles - can be used for commits, versions, segments, etc. */

/* Base wrapper styles - generic for any diff view */
#wrapper.diff-viewer,
#wrapper.commit-diff {
    padding-left: 10px;
}

.diff-viewer #page-content-wrapper,
.commit-diff #page-content-wrapper {
    border-left: none;
}

/* Generic diff content layout */
.diff-content,
.main-content {
    width: 90%;
    margin: 0 auto;
}

/* Generic top navigation for diff views */
.diff-top-nav,
.top-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Generic revision banner - reusable for any diff comparison */
.revision-banner {
    background-color: #f8f9fa;
    color: #333;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.revision-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 100%;
    margin: 0 auto;
}

.revision-item {
    flex: 1;
    text-align: center;
    max-width: 40%;
    min-width: 0; /* Allow flex items to shrink below their content size */
}

.revision-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    margin-bottom: 0.25rem;
}

.revision-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #635c5c;
    text-align: center;
    margin-bottom: 0.25rem;
    display: block;
    width: 100%;
}

.commit-id-inline {
    font-family: monospace;
    font-size: 0.85rem;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    color: #495057;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.2;
    max-width: 100%;
    margin-left: 0.25rem;
    display: inline-block;
}

.revision-meta {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.3;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.author-name {
    font-weight: 500;
    color: #495057;
}

.timestamp {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.status-message-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.revision-arrow {
    font-size: 1.2rem;
    color: #b8babe;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.meta-text {
    margin-right: 0.25rem;
}

.author-arn {
    border-bottom: 1px dotted #4a5568;
}

.author-arn:hover {
    color: #2d3748;
    border-bottom-color: #2d3748;
}

.revision-info {
    margin-top: 5px;
    font-size: 14px;
    color: #6c757d;
}

.revision-text {
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Commit ID display styles */
.commit-id-display {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    margin: 0.25rem auto;
    max-width: 100%;
    overflow: hidden;
}

.commit-id-text {
    font-size: 0.85rem;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

/* Generic diff item styles - can be used for any diff item type */
.diff-item,
.app-config-item,
.version-item {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: white;
    transition: box-shadow 0.2s ease;
}

.diff-item:hover,
.app-config-item:hover,
.version-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.diff-item.expanded,
.app-config-item.expanded,
.version-item.expanded {
    border-color: #007bff;
}

/* Generic diff item header */
.diff-item-header,
.version-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    background-color: #f8f9fa;
    border-radius: 6px 6px 0 0;
}

.diff-item:not(.expanded) .diff-item-header,
.version-item:not(.expanded) .version-header {
    border-radius: 6px;
}

.diff-item-header:hover,
.version-header:hover {
    background-color: #e9ecef;
}

.left-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.right-content {
    display: flex;
    align-items: center;
}

/* Generic diff item content */
.diff-item-content,
.version-content {
    padding: 16px;
    border-top: 1px solid #dee2e6;
    background-color: white;
}

/* Generic sub-item styles for nested diff items */
.diff-sub-item,
.version-sub-item,
.segment-item {
    margin-left: 20px;
    border-left: 2px solid #e0e0e0;
    padding-left: 15px;
    margin-bottom: 10px;
}

.diff-sub-header,
.version-sub-header,
.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    cursor: pointer;
    border-radius: 4px;
}

.diff-sub-header:hover,
.version-sub-header:hover,
.segment-header:hover {
    background-color: #e9ecef;
}

.diff-sub-content,
.version-sub-content,
.segment-content {
    padding: 15px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.commit-diff-content {
    margin-top: 20px;
}

.commit-diff-content > h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-weight: 600;
}

.app-config-id {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: normal;
}

.versions-section {
    margin: 2rem 0;
}

.versions-section h4 {
    margin-bottom: 20px;
    color: #495057;
    font-weight: 600;
}

.version-id {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: normal;
}

/* Environment badges - rounded, solid backgrounds */
.environment-indicators {
    display: flex;
    gap: 8px;
    align-items: center;
}

.env-badge {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.env-badge.live {
    background-color: #28a745;
    color: white;
}

.env-badge.preprod {
    background-color: #fd7e14;
    color: white;
}

/* Version name */
.version-name {
    font-weight: 500;
    color: #495057;
}

/* Action tags and controls */
.action-tag {
    padding: 4px 8px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 0.5rem;
}

/* Smaller action tags for sub-items */
.action-tag-small {
    font-size: 10px;
    padding: 2px 6px;
}

.action-tag.created {
    border-color: #28a745;
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.action-tag.modified {
    border-color: #007bff;
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.action-tag.deleted {
    border-color: #dc3545;
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.action-tag.no_change {
    border-color: #6c757d;
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
}

.expand-icon {
    color: #6c757d;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.version-item.expanded .expand-icon {
    transform: rotate(0deg);
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.loading-spinner i {
    margin-right: 8px;
}

/* Error state */
.version-error,
.segment-error {
    padding: 12px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    position: relative;
}

.close-error {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
}

.close-error:hover {
    color: #000;
}

.segments-section h5 {
    margin: 15px 0 10px 0;
    color: #495057;
    font-weight: 500;
}

.sub-item-name,
.segment-name {
    font-weight: 500;
    color: #495057;
}

.segment-id {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: normal;
}

.action-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
