/********************************************************************************
 * Copyright (C) 2026 EclipseSource GmbH.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the Eclipse
 * Public License v. 2.0 are satisfied: GNU General Public License, version 2
 * with the GNU Classpath Exception which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
 ********************************************************************************/

/* Base card container */
.theia-Card {
    display: flex;
    align-items: flex-start;
    padding: calc(var(--theia-ui-padding) * 1.5) calc(var(--theia-ui-padding) * 2);
    background-color: var(--theia-editor-background);
    border: var(--theia-border-width) solid var(--theia-dropdown-border);
    border-radius: calc(var(--theia-ui-padding) * 2);
    text-align: left;
    box-shadow: 0 1px 3px var(--theia-widget-shadow);
}

/* Interactive card variant for clickable actions. */
.theia-Card-interactive {
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.theia-Card-interactive:hover {
    background-color: color-mix(in srgb, var(--theia-list-hoverBackground) 50%, var(--theia-editor-background));
    border-color: var(--theia-focusBorder);
    box-shadow: 0 2px 6px var(--theia-widget-shadow);
}

.theia-Card-interactive:focus {
    outline: 1px solid var(--theia-focusBorder);
    outline-offset: -1px;
}

.theia-Card-icon {
    margin-right: calc(var(--theia-ui-padding) * 1.5);
    color: var(--theia-descriptionForeground);
    flex-shrink: 0;
}

.theia-Card-content {
    flex: 1;
    align-self: stretch;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.theia-Card-title {
    font-weight: 500;
    color: var(--theia-foreground);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.theia-Card-subtitle {
    font-size: var(--theia-ui-font-size0);
    color: var(--theia-descriptionForeground);
    margin-top: auto;
    padding-top: calc(var(--theia-ui-padding) / 2);
}

/* Footer area used when actionButtons are present */
.theia-Card-footer {
    font-size: var(--theia-ui-font-size0);
    color: var(--theia-descriptionForeground);
    margin-top: auto;
    padding-top: calc(var(--theia-ui-padding) / 2);
    position: relative;
}

.theia-Card-footer-time {
    display: block;
    transition: opacity 0.15s;
}

.theia-Card-footer-actions {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--theia-ui-padding);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.theia-Card:hover .theia-Card-footer-time {
    opacity: 0;
}

.theia-Card:hover .theia-Card-footer-actions {
    opacity: 1;
    pointer-events: auto;
}

.theia-Card-action-btn {
    background: transparent;
    border: none;
    padding: 0 var(--theia-ui-padding);
    cursor: pointer;
    color: var(--theia-icon-foreground);
    display: inline-flex;
    align-items: center;
    border-radius: calc(var(--theia-ui-padding) / 2);
    font-size: inherit;
    line-height: 1;
    transition: background-color 0.15s, color 0.15s;
}

.theia-Card-action-btn:hover {
    background-color: var(--theia-list-hoverBackground);
    color: var(--theia-foreground);
}
