/* Sidebar Styles for Tam An Clinic */

.sidebar {
    background: transparent;
    padding: 0;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Widget General Styles */
.widget {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(135deg, #4fd1c7 0%, #38b2ac 100%);
}

.widget-title i {
    color: #4fd1c7;
    font-size: 1rem;
}

/* Author Widget */
.author-widget .author-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    transition: border-color 0.3s ease;
}

.author-avatar img:hover {
    border-color: #4fd1c7;
}

.author-name {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.author-name a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.3s ease;
}

.author-name a:hover {
    color: #4fd1c7;
}

.author-bio {
    font-size: 0.875rem;
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.author-stats {
    font-size: 0.75rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.author-stats i {
    color: #4fd1c7;
}

/* Table of Contents Widget */
.toc-widget .table-of-contents {
    max-height: 300px;
    overflow-y: auto;
}

.table-of-contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #4a5568;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.table-of-contents a:hover,
.table-of-contents a.active {
    background: #f0fff4;
    color: #4fd1c7;
    border-left-color: #4fd1c7;
    transform: translateX(3px);
}

.table-of-contents .toc-h2 { padding-left: 0.75rem; }
.table-of-contents .toc-h3 {padding-left: 0;margin-bottom: 10px;}
.table-of-contents .toc-h4 { padding-left: 2.25rem; }

/* Popular Posts & Recent Posts Widgets */
.sidebar-post {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-post:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-post-thumbnail {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.sidebar-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-post-thumbnail:hover img {
    transform: scale(1.1);
}

.no-thumbnail {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.sidebar-post-content {
    flex: 1;
    min-width: 0;
}

.sidebar-post-title {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.sidebar-post-title a {
    color: #2d3748;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.sidebar-post-title a:hover {
    color: #4fd1c7;
}

.sidebar-post-meta {
    font-size: 0.75rem;
    color: #718096;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-post-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar-post-meta i {
    color: #4fd1c7;
    width: 12px;
}

.no-posts {
    text-align: center;
    color: #718096;
    font-style: italic;
    font-size: 0.875rem;
}

/* Tags Widget */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    background: #f7fafc;
    color: #4a5568;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.tag-link:hover {
    background: #4fd1c7;
    color: white;
    border-color: #4fd1c7;
    transform: translateY(-2px);
}

/* Search Widget */
.widget_search .search-form {
    position: relative;
}

.widget_search input[type="search"] {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.widget_search input[type="search"]:focus {
    outline: none;
    border-color: #4fd1c7;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 209, 199, 0.1);
}

.widget_search button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #4fd1c7;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.widget_search button:hover {
    background: #38b2ac;
}

/* Recent Entries Widget */
.recent-entries {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-entries li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.recent-entries li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-entries a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.4;
    display: block;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.recent-entries a:hover {
    color: #4fd1c7;
}

.recent-entries .post-date {
    font-size: 0.75rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.recent-entries .post-date i {
    color: #4fd1c7;
}

/* Categories Widget */
.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-list li {
    margin-bottom: 0.75rem;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #4a5568;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.categories-list a:hover {
    background: #f0fff4;
    color: #4fd1c7;
    border-left-color: #4fd1c7;
    transform: translateX(3px);
}

.categories-list .post-count {
    background: #e2e8f0;
    color: #718096;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
}

.categories-list a:hover .post-count {
    background: #4fd1c7;
    color: white;
}

/* Contact Widget */
.clinic-contact-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 2rem;
}

.clinic-contact-widget .widget-title {
    color: white;
    border-bottom-color: rgba(255,255,255,0.2);
}

.clinic-contact-widget .widget-title::after {
    background: white;
}

.clinic-contact-widget .widget-title i {
    color: rgba(255,255,255,0.9);
}

.contact-info {
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.contact-item:hover {
    background: rgba(255,255,255,0.15);
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item i {
    color: rgba(255,255,255,0.9);
    width: 16px;
    text-align: center;
}

.contact-item a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.contact-item a:hover {
    opacity: 0.8;
}

.contact-item span {
    color: rgba(255,255,255,0.95);
    font-size: 0.875rem;
    line-height: 1.4;
}

.appointment-cta .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.appointment-cta .btn:hover {
    background: white;
    color: #4fd1c7;
    border-color: white;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        margin-top: 3rem;
    }
    
    .clinic-contact-widget {
        position: static;
    }
}

@media (max-width: 768px) {
    .widget {
        padding: 1.5rem;
    }
    
    .sidebar-post {
        flex-direction: column;
        text-align: center;
    }
    
    .sidebar-post-thumbnail {
        width: 100px;
        height: 100px;
        align-self: center;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .sidebar-content {
        gap: 1.5rem;
    }
    
    .widget {
        padding: 1rem;
    }
    
    .widget-title {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
