/* Main Container */
.chat-status-container {
   max-width: 600px;
   margin: 20px auto;
   font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
}

/* Card Styles */
.chat-status-card {
   background: #ffffff;
   border-radius: 12px;
   box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
   overflow: hidden;
   transition: box-shadow 0.3s ease;
}

.chat-status-card:hover {
   box-shadow: 0 6px 28px rgba(0, 0, 0, 0.1);
}

/* Header Section */
.card-header {
   padding: 24px;
   background: linear-gradient(to right, #f8f9fa, #ffffff);
   border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-content {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 12px;
}

.card-header h3 {
   margin: 0;
   font-size: 1.25rem;
   font-weight: 600;
   color: #1a1f36;
   line-height: 1.4;
}

.last-checked {
   font-size: 0.875rem;
   color: #697386;
}

/* Status Badge */
.status-badge {
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 6px 12px;
   border-radius: 20px;
   font-size: 0.875rem;
   font-weight: 500;
   transition: all 0.2s ease;
}

.status-dot {
   width: 8px;
   height: 8px;
   border-radius: 50%;
   transition: all 0.2s ease;
}

.status-badge.online {
   background: #ecfdf3;
   color: #027a48;
}

.status-badge.online .status-dot {
   background: #12b76a;
   box-shadow: 0 0 0 2px rgba(18, 183, 106, 0.2);
}

.status-badge.offline {
   background: #fef3f2;
   color: #b42318;
}

.status-badge.offline .status-dot {
   background: #f04438;
   box-shadow: 0 0 0 2px rgba(240, 68, 56, 0.2);
}

/* Metrics Section */
.status-metrics {
   padding: 24px;
}

.metric-grid {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
   gap: 16px;
   margin-bottom: 24px;
}

.metric-item {
   display: flex;
   align-items: center;
   gap: 16px;
   padding: 16px;
   background: #f9fafb;
   border-radius: 8px;
   transition: all 0.2s ease;
}

.metric-item:hover {
   background: #f3f4f6;
   transform: translateY(-1px);
}

.metric-icon {
   width: 40px;
   height: 40px;
   display: flex;
   align-items: center;
   justify-content: center;
   border-radius: 8px;
   color: #475467;
}

.metric-content {
   flex: 1;
}

.metric-label {
   font-size: 0.875rem;
   color: #475467;
   margin-bottom: 4px;
}

.metric-value {
   font-size: 1.25rem;
   font-weight: 600;
   color: #1a1f36;
   transition: color 0.2s ease;
}

.metric-value.success {
   color: #027a48;
}

.metric-value.error {
   color: #b42318;
}

/* Error Alert */
.error-alert {
   display: flex;
   gap: 16px;
   padding: 16px;
   background: #fef3f2;
   border: 1px solid #fecdca;
   border-radius: 8px;
   margin-top: 16px;
   animation: fadeIn 0.3s ease;
}

.error-icon {
   color: #b42318;
}

.error-content {
   flex: 1;
}

.error-title {
   font-size: 0.875rem;
   font-weight: 500;
   color: #b42318;
   margin-bottom: 4px;
}

.error-message {
   font-size: 0.875rem;
   color: #7a271a;
   line-height: 1.5;
}

/* Info Section */
.info-section {
   padding: 24px;
   border-top: 1px solid rgba(0, 0, 0, 0.06);
   background: #f8f9fa;
}

.info-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 20px;
   cursor: pointer;
}

.info-header h4 {
   margin: 0;
   font-size: 1.1rem;
   color: #1a1f36;
   font-weight: 600;
}

.info-toggle {
   background: none;
   border: none;
   padding: 8px;
   cursor: pointer;
   color: #697386;
   border-radius: 50%;
   transition: all 0.2s ease;
}

.info-toggle:hover {
   background: rgba(0, 0, 0, 0.05);
   color: #1a1f36;
}

.info-toggle svg {
   transition: transform 0.3s ease;
}

.info-content {
   display: none;
}

.info-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
   gap: 20px;
   margin-bottom: 24px;
}

.info-item {
   display: flex;
   gap: 16px;
   padding: 16px;
   background: #ffffff;
   border-radius: 12px;
   transition: all 0.2s ease;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.info-item:hover {
   transform: translateY(-2px);
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.info-icon {
   color: #2563eb;
}

.info-text h5 {
   margin: 0 0 8px 0;
   font-size: 1rem;
   color: #1a1f36;
}

.info-text p {
   margin: 0;
   font-size: 0.875rem;
   color: #697386;
   line-height: 1.5;
}

/* Usage Stats */
.usage-stats {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 16px;
   margin-top: 24px;
}

.stat-box {
   padding: 16px;
   text-align: center;
   background: #ffffff;
   border-radius: 12px;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
   transition: all 0.2s ease;
}

.stat-box:hover {
   transform: translateY(-1px);
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-number {
   display: block;
   font-size: 1.5rem;
   font-weight: 700;
   color: #2563eb;
   margin-bottom: 4px;
}

.stat-label {
   font-size: 0.875rem;
   color: #697386;
}

/* Footer Section */
.card-footer {
   padding: 24px;
   background: #f9fafb;
   border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Check Button */
.status-check-btn {
   width: 100%;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   padding: 12px 20px;
   background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
   color: white;
   border: none;
   border-radius: 8px;
   font-size: 0.875rem;
   font-weight: 500;
   cursor: pointer;
   transition: all 0.2s ease;
}

.status-check-btn:hover {
   background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
   transform: translateY(-1px);
}

.status-check-btn:active {
   transform: translateY(1px);
}

.status-check-btn:disabled {
   background: #e5e7eb;
   cursor: not-allowed;
   transform: none;
}

.btn-icon {
   transition: transform 0.3s ease;
}

.status-check-btn.loading .btn-icon {
   animation: spin 1s linear infinite;
}

.auto-check-info {
   text-align: center;
   margin-top: 12px;
   font-size: 0.875rem;
   color: #697386;
}

/* Animations */
@keyframes spin {
   0% { transform: rotate(0deg); }
   100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
   from { opacity: 0; transform: translateY(-10px); }
   to { opacity: 1; transform: translateY(0); }
}

.chat-status-container.updated .chat-status-card {
   animation: update-pulse 1s cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes update-pulse {
   0%, 100% { 
       box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
   }
   50% { 
       box-shadow: 0 4px 32px rgba(0, 0, 0, 0.12);
   }
}

/* Loading Animation */
.loading-pulse {
   position: relative;
   overflow: hidden;
}

.loading-pulse::after {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: linear-gradient(
       90deg,
       transparent,
       rgba(255, 255, 255, 0.2),
       transparent
   );
   animation: pulse 1.5s infinite;
}

@keyframes pulse {
   0% { transform: translateX(-100%); }
   100% { transform: translateX(100%); }
}

/* Responsive Design */
@media (max-width: 640px) {
   .chat-status-container {
       margin: 10px;
   }

   .header-content {
       flex-direction: column;
       align-items: flex-start;
       gap: 12px;
   }

   .status-badge {
       align-self: flex-start;
   }

   .metric-grid {
       grid-template-columns: 1fr;
   }

   .info-grid {
       grid-template-columns: 1fr;
   }

   .usage-stats {
       grid-template-columns: 1fr;
   }

   .card-header,
   .status-metrics,
   .info-section,
   .card-footer {
       padding: 16px;
   }

   .metric-item,
   .info-item {
       padding: 12px;
   }

   .metric-icon,
   .info-icon {
       width: 32px;
       height: 32px;
   }

   .metric-value {
       font-size: 1.125rem;
   }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
   .status-badge {
       border: 1px solid currentColor;
   }

   .metric-item,
   .info-item {
       border: 1px solid #475467;
   }

   .status-check-btn {
       border: 2px solid transparent;
   }

   .status-check-btn:focus {
       outline: 2px solid #1a1f36;
       outline-offset: 2px;
   }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
   .chat-status-container.updated .chat-status-card,
   .status-check-btn,
   .metric-item,
   .info-item,
   .btn-icon {
       transition: none;
       animation: none;
   }
}


/* DeepSeek Link Style */
.deepseek-link {
    color: #2563eb;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.deepseek-link:hover {
    color: #1e40af;
    border-bottom-color: currentColor;
}

.deepseek-link:focus {
    outline: 2px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
    border-radius: 2px;
}

.deepseek-link:active {
    color: #1e3a8a;
}



/* Status Description */
.status-description {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f9fafb;
}

.status-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.925rem;
    line-height: 1.5;
}

.status-message.success {
    color: #027a48;
}

.status-message.error {
    color: #b42318;
}

.status-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.status-message.success .status-icon {
    color: #12b76a;
}

.status-message.error .status-icon {
    color: #f04438;
}

.status-message strong {
    font-weight: 600;
}

.error-code {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.875rem;
    color: #697386;
}

/* Enhanced Status Badge */
.status-badge {
    padding: 8px 16px;
    font-weight: 600;
}

.status-badge.online {
    background: #ecfdf3;
    color: #027a48;
    box-shadow: 0 2px 4px rgba(18, 183, 106, 0.1);
}

.status-badge.offline {
    background: #fef3f2;
    color: #b42318;
    box-shadow: 0 2px 4px rgba(240, 68, 56, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .status-description {
        margin: 12px 0;
        padding: 10px;
    }

    .status-message {
        font-size: 0.875rem;
    }

    .error-code {
        font-size: 0.8125rem;
    }
}

/* Animation for Status Changes */
.status-description {
    transition: all 0.3s ease;
}

.status-message {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}