/* Global Reset & Base */
:root {
    --bg-color: #0d1117;
    --list-bg: #161b22;
    --list-hover: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-color: #238636;
    --accent-hover: #2ea043;
    --border-color: #30363d;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    margin-bottom: 2.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* List View */
.artifact-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    background: var(--list-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease-out forwards;
    gap: 1rem;
}

.list-item:hover {
    background: var(--list-hover);
    border-color: #58a6ff;
}

.list-item.expired {
    opacity: 0.6;
    border-style: dashed;
}

/* Item Columns */
.item-info {
    display: flex;
    align-items: center;
}

.basic-info {
    flex: 2;
    gap: 1rem;
    min-width: 0;
    /* Text truncation handling */
}

.artifact-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artifact-size {
    font-size: 0.85rem;
    background: rgba(110, 118, 129, 0.4);
    padding: 2px 8px;
    border-radius: 99px;
    color: var(--text-primary);
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

.time-info {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.9rem;
    gap: 6px;
    justify-content: center;
    /* Center align time */
}

.item-actions {
    flex: 0 0 auto;
}

/* Buttons */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
    line-height: normal;
}

.btn-download:hover {
    background-color: var(--accent-hover);
}

.status-expired {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    cursor: not-allowed;
}

/* States */
.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #58a6ff;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */
@media (max-width: 700px) {
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .basic-info {
        width: 100%;
        justify-content: space-between;
    }

    .time-info {
        justify-content: flex-start;
        font-size: 0.8rem;
    }

    .item-actions {
        width: 100%;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }
}

/* Pending Build Styles */
.list-item.pending-item {
    border-color: #d2a8ff;
    background: rgba(56, 139, 253, 0.05);
}

.status-pending {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d2a8ff;
    font-size: 0.9rem;
    font-weight: 500;
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(210, 168, 255, 0.3);
    border-radius: 50%;
    border-top-color: #d2a8ff;
    animation: spin 1s linear infinite;
}

.tag-live {
    background: #d2a8ff;
    color: #0d1117;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}