/**
 * ThemeLBd Widgets Styles
 * 
 * Tập hợp tất cả CSS cho widgets của theme
 * Giúp tối ưu performance và dễ quản lý
 * 
 * @package ThemeLBd
 * @since 1.0.0
 */

/* ==========================================================================
   Widget Common Styles
   ========================================================================== */
.themelbd-widget-container {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

/* ==========================================================================
   Social Media Widget
   ========================================================================== */
.themelbd-social-widget {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.themelbd-social-widget:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

.social-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 25px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* ==========================================================================
   Popular Posts Widget
   ========================================================================== */
.themelbd-popular-posts-widget {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 30px;
}

.popular-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-post-item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.popular-post-item:hover {
    background: #f8f9ff;
    transform: translateX(5px);
}

/* ==========================================================================
   About Me Widget
   ========================================================================== */
.themelbd-about-widget {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.about-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Newsletter Widget
   ========================================================================== */
.themelbd-newsletter-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.newsletter-form {
    margin-top: 20px;
}

.newsletter-input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.newsletter-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
}

.newsletter-submit {
    width: 100%;
    padding: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-submit:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* ==========================================================================
   Recent Comments Widget
   ========================================================================== */
.themelbd-recent-comments-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 30px;
}

.recent-comments-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.recent-comment-item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.recent-comment-item:hover {
    background: #f8f9ff;
    transform: translateX(5px);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Instagram Feed Widget
   ========================================================================== */
.themelbd-instagram-widget {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.instagram-header {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 0;
}

.instagram-item {
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.instagram-item:hover {
    transform: scale(1.05);
    z-index: 2;
}

/* ==========================================================================
   Tag Cloud Widget
   ========================================================================== */
.themelbd-tag-cloud-widget {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 30px;
}

.tag-cloud-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tag-cloud-item {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tag-cloud-item:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}

/* ==========================================================================
   Weather Widget
   ========================================================================== */
.themelbd-weather-widget {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    border-radius: 20px;
    color: white;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(116, 185, 255, 0.3);
}

.weather-content {
    padding: 25px;
    position: relative;
    z-index: 1;
}

.weather-temp {
    font-size: 48px;
    font-weight: 300;
    margin: 0;
    line-height: 1;
}

.weather-icon {
    font-size: 60px;
    line-height: 1;
    animation: weather-float 3s ease-in-out infinite;
}

@keyframes weather-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.weather-detail {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.weather-detail:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    .themelbd-social-widget,
    .themelbd-popular-posts-widget,
    .themelbd-about-widget,
    .themelbd-recent-comments-widget,
    .themelbd-instagram-widget,
    .themelbd-tag-cloud-widget {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .popular-post-item,
    .recent-comment-item {
        border-bottom-color: #404040;
    }
    
    .popular-post-item:hover,
    .recent-comment-item:hover {
        background: #333;
    }
    
    .widget-title {
        color: #e0e0e0;
    }
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .social-links {
        padding: 20px 15px;
        gap: 10px;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .popular-post-item,
    .recent-comment-item {
        padding: 15px;
    }
    
    .about-avatar {
        width: 70px;
        height: 70px;
    }
    
    .weather-temp {
        font-size: 40px;
    }
    
    .weather-icon {
        font-size: 50px;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .instagram-grid {
        gap: 1px;
    }
    
    .tag-cloud-item {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ==========================================================================
   Animation Classes
   ========================================================================== */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.5s ease forwards;
    transform: translateY(20px);
    opacity: 0;
}

@keyframes slideInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
}

.widget-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Error States
   ========================================================================== */
.widget-error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 15px;
    color: #c33;
    text-align: center;
    margin: 10px 0;
}

.widget-success {
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 8px;
    padding: 15px;
    color: #3c3;
    text-align: center;
    margin: 10px 0;
}
