/* API Dashboard Styles */
.api-dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Full width option */
.api-dashboard-container.full-width {
    max-width: 100%;
    padding: 20px 40px;
}

.api-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.api-dashboard-header h2 {
    margin: 0;
    color: #333;
    font-size: 28px;
}

.last-updated {
    color: #666;
    font-size: 14px;
}

.api-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

@media (min-width: 1400px) {
    .api-dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .api-dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .api-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dashboard-widget {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    max-height: 450px;
}

.dashboard-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.widget-header {
    background: #f5f5f5;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.widget-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Custom scrollbar for widget content */
.widget-content::-webkit-scrollbar {
    width: 6px;
}

.widget-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.widget-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.widget-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Weather Widget */
.weather-widget {
    text-align: center;
    max-height: none;
    overflow: visible;
}

.weather-main {
    margin-bottom: 25px;
}

.temperature {
    font-size: 48px;
    font-weight: 300;
    color: #2196F3;
    margin-bottom: 10px;
}

.description {
    font-size: 18px;
    color: #666;
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    text-align: left;
}

.weather-details .detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.weather-details .label {
    color: #999;
    font-size: 14px;
}

.weather-details .value {
    color: #333;
    font-weight: 500;
}

/* Stocks Widget */
.market-status {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.stocks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stocks-table th,
.stocks-table td {
    text-align: left;
    padding: 10px 6px;
    border-bottom: 1px solid #f0f0f0;
}

.stocks-table th {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}

.stocks-table .symbol small {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 2px;
}

.stocks-table .price {
    font-weight: 600;
}

.stocks-table .change.positive {
    color: #4CAF50;
}

.stocks-table .change.negative {
    color: #f44336;
}

.stocks-table .volume {
    color: #666;
    font-size: 14px;
}

/* Crypto Widget */
.crypto-widget {
    max-height: 350px;
    overflow-y: auto;
}

.crypto-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 0;
}

.crypto-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.crypto-item:first-child {
    padding-top: 0;
}

.crypto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.crypto-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.crypto-symbol {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.crypto-price {
    font-size: 28px;
    font-weight: 300;
    color: #333;
    margin-bottom: 3px;
}

.crypto-change {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.crypto-change.positive {
    color: #4CAF50;
}

.crypto-change.negative {
    color: #f44336;
}

.crypto-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
}

.crypto-stats .stat {
    flex: 1;
}

.crypto-stats .label {
    display: block;
    color: #999;
    font-size: 12px;
    margin-bottom: 2px;
}

.crypto-stats .value {
    color: #333;
    font-weight: 500;
}

.crypto-chart {
    width: 100%;
    height: 40px;
    margin-top: 10px;
}

/* News Widget */
.news-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    max-width: 100%;
    overflow: hidden;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.news-title a {
    color: #333;
    text-decoration: none;
}

.news-title a:hover {
    color: #2196F3;
}

.news-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #999;
}

.news-source {
    font-weight: 600;
}

.news-description {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Responsive */
@media (max-width: 767px) {
    .api-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .api-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
    }
}

/* Loading state */
.dashboard-widget.loading {
    opacity: 0.6;
    position: relative;
}

.dashboard-widget.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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