/* Dify Output Display Styles - Daily Tech News */

/* Container */
.dify-output-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.dify-header {
    background: transparent;
    color: #000;
    padding: 10px 0 40px 0;
    text-align: center;
    border-radius: 0;
    margin-bottom: 20px;
    box-shadow: none;
    border-bottom: 1px solid #eee;
}

.dify-title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: #000;
    letter-spacing: -1px;
}

.dify-subtitle {
    opacity: 0.7;
    font-size: 16px;
    margin: 0;
    color: #000;
}

/* Content Area */
.dify-content {
    padding: 0;
}

/* Status Indicator */
.dify-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 14px;
}

.dify-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: dify-pulse 2s infinite;
    flex-shrink: 0;
}

.dify-status-dot.loading { background: #ffc107; }
.dify-status-dot.success { background: #28a745; animation: none; }
.dify-status-dot.error { background: #dc3545; animation: none; }

@keyframes dify-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Loading & Error States */
.dify-output-box.loading {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    min-height: 200px;
}

.dify-output-box.error {
    background: #fff5f5;
    border-color: #fc8181;
    color: #c53030;
    padding: 20px;
    border-radius: 12px;
}

.dify-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: dify-spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Refresh Button */
.dify-refresh-btn {
    margin-top: 40px;
    width: auto;
    padding: 12px 30px;
    background: #000;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.dify-refresh-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.dify-refresh-btn:active { transform: translateY(0); }
.dify-refresh-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.dify-timestamp {
    text-align: center;
    color: #6c757d;
    font-size: 12px;
    margin-top: 16px;
}

/* =========================================
   News Grid Layout (Ollama Style)
   ========================================= */

.dify-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 10px;
}

.dify-news-card {
    background: white;
    border-radius: 0; /* Squared corners */
    box-shadow: none; /* Clean look */
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100%;
}

.dify-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: #cbd5e0;
}

/* Visual Placeholder (Black box with icon) */
.dify-card-visual {
    background: #000;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.dify-card-icon {
    font-size: 80px;
    line-height: 1;
}

/* Content Area */
.dify-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Headline / Title */
.dify-card-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #000;
    line-height: 1.2;
}

/* Description / Preview */
.dify-card-description {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 25px;
    line-height: 1.6;
    flex-grow: 1;
}

/* Full Text (Expanded) */
.dify-card-full-text {
    display: none;
    margin-bottom: 25px;
    font-size: 16px;
    color: #2d3748;
    line-height: 1.8;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.dify-news-card.expanded .dify-card-full-text {
    display: block;
    animation: fadeIn 0.5s;
}

.dify-news-card.expanded .dify-card-description {
    display: none;
}

/* Button */
.dify-card-btn {
    margin-top: auto;
    background: transparent;
    border: 1px solid #000;
    color: #000;
    padding: 12px 24px;
    font-size: 14px;
    cursor: pointer;
    width: fit-content;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.dify-card-btn:hover {
    background: #000;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .dify-news-grid {
        grid-template-columns: 1fr;
    }
    
    .dify-card-title {
        font-size: 24px;
    }
    
    .dify-card-visual {
        height: 160px;
    }
}
