/* Promise Source Cards - Clean Minimal Style CSS */

.st-source-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin: 4px 0;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: block;
    transition: border-color 0.2s ease;
}

.st-source-card:hover {
    border-color: #1da1f2;
}

.st-source-card-content {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    width: 100%;
}

.st-source-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.st-source-card-label {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    flex-shrink: 0;
}

.st-source-card-url {
    font-size: 10px;
    color: #6c757d;
    font-style: italic;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.st-promise-card-description {
    display: none; /* Hide description in tiny cards */
}

.st-source-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.st-source-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    border: 1px solid #dee2e6;
    cursor: pointer;
    min-height: 24px;
    box-sizing: border-box;
    white-space: nowrap;
    gap: 4px;
    transition: all 0.2s ease;
}

.st-source-card-btn-primary {
    background: #ffffff;
    color: #1da1f2;
    border-color: #1da1f2;
}

.st-source-card-btn-primary:hover {
    background: #1da1f2;
    border-color: #1da1f2;
    color: #ffffff;
    text-decoration: none;
}

.st-source-card-btn-secondary {
    background: #ffffff;
    color: #6c757d;
    border-color: #dee2e6;
}

.st-source-card-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    text-decoration: none;
}

.st-source-card-btn-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Loading States */
.st-promise-card-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #657786;
    font-size: 14px;
    gap: 12px;
}

.st-promise-card-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #1da1f2;
    border-radius: 50%;
    animation: st-spin 1s linear infinite;
}

@keyframes st-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.st-promise-card-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 16px;
    color: #c53030;
    font-size: 14px;
    text-align: center;
}

/* Container Styles */
.st-source-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin: 8px 0;
}

.st-source-card-item {
    display: block;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .st-promise-card {
        margin: 12px 0;
        border-radius: 8px;
    }
    
    .st-promise-card-content {
        padding: 12px;
    }
    
    .st-promise-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .st-promise-card-title {
        font-size: 15px;
    }
    
    .st-promise-card-actions {
        flex-direction: column;
    }
    
    .st-promise-card-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .st-promise-card {
        margin: 8px 0;
    }
    
    .st-promise-card-content {
        padding: 10px;
    }
    
    .st-promise-card-title {
        font-size: 14px;
    }
    
    .st-promise-card-description {
        font-size: 13px;
    }
    
    .st-promise-card-btn {
        font-size: 13px;
        padding: 6px 12px;
        min-height: 32px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .st-promise-card {
        background: #1a1a1a;
        border-color: #333333;
        color: #ffffff;
    }
    
    .st-promise-card-title {
        color: #ffffff;
    }
    
    .st-promise-card-date {
        background: #2d3748;
        color: #a0aec0;
    }
    
    .st-promise-card-description {
        color: #cbd5e0;
    }
    
    .st-promise-card-btn-secondary {
        background: #2d3748;
        color: #63b3ed;
        border-color: #63b3ed;
    }
    
    .st-promise-card-btn-secondary:hover {
        background: #4a5568;
        color: #90cdf4;
        border-color: #90cdf4;
    }
    
    .st-promise-card-error {
        background: #2d1b1b;
        border-color: #742a2a;
        color: #fc8181;
    }
}

/* Accessibility */
.st-promise-card-btn:focus {
    outline: 2px solid #1da1f2;
    outline-offset: 2px;
}

.st-promise-card-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Print Styles */
@media print {
    .st-promise-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .st-promise-card-btn {
        display: none;
    }
    
    .st-promise-card-loading {
        display: none;
    }
}
