/*
 * Dabiryab SEO Pages - Professional List View Stylesheet v4.0.0
 */
:root {
    --brand-primary: #0056b3;
    --brand-secondary: #f0f6fc;
    --text-primary: #24292e;
    --text-secondary: #586069;
    --border-color: #e1e4e8;
    --background-color: #ffffff;
    --sidebar-bg: #f6f8fa;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.12);
    --card-shadow-hover: 0 10px 20px rgba(0,0,0,0.1), 0 3px 6px rgba(0,0,0,0.07);
}

body {
    background-color: #fdfdfd;
}

/* --- Layout --- */
.dabiryab-header-wrapper {
    text-align: center;
    padding: 25px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 30px auto;
    width: 98%;
    max-width: 1280px;
}
.dabiryab-header-wrapper h1 { margin: 0 0 10px 0; font-size: 2.5rem; }
.dabiryab-header-wrapper p { margin: 0; font-size: 1.1rem; color: var(--text-secondary); }

.dabiryab-container {
    display: flex;
    flex-wrap: wrap;
    width: 98%;
    max-width: 1280px;
    margin: 30px auto;
    gap: 30px;
}
#dabiryab-sidebar { flex: 1 1 280px; max-width: 280px; }
#dabiryab-main-content { flex: 1 1 calc(100% - 310px); }

/* --- Sidebar & Widget --- */
#dabiryab-sidebar .widget { background: #7c418205; border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
#dabiryab-sidebar .widget-title { font-size: 1.25rem; font-weight: 600; margin-top: 0; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.dabiryab-category-widget { list-style: none; padding: 0; margin: 0; }
.dabiryab-category-widget .grade-item { position: relative; margin-bottom: 5px; }
.dabiryab-category-widget .grade-item > a { display: block; padding: 10px 15px; text-decoration: none; font-weight: 500; color: var(--text-primary); border-radius: 5px; transition: background-color 0.2s, color 0.2s; }
.dabiryab-category-widget .grade-item > a:hover { background-color: var(--brand-secondary); }
.dabiryab-category-widget .grade-item.active > a { background-color: var(--brand-primary); color: white; font-weight: 600; }
.dabiryab-category-widget .toggle-icon { position: absolute; left: 15px; top: 10px; cursor: pointer; font-size: 1.2rem; color: var(--text-secondary); user-select: none; }
.dabiryab-category-widget .subject-list { list-style: none; padding-right: 25px; margin-top: 5px; display: none; }
.dabiryab-category-widget .subject-item a { display: block; padding: 8px 10px; color: var(--text-secondary); text-decoration: none; border-radius: 5px; }
.dabiryab-category-widget .subject-item a:hover { background-color: var(--brand-secondary); }
.dabiryab-category-widget .subject-item.active a { color: var(--brand-primary); font-weight: 600; }

/* --- Main Content --- */
#dabiryab-main-content section { margin-bottom: 40px; }
#dabiryab-main-content section h2 { font-size: 1.8rem; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }

/* --- Subcategory Cards --- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.category-card { padding: 20px; border: 1px solid var(--border-color); border-radius: 8px; text-align: center; text-decoration: none; color: var(--text-primary); background: var(--background-color); transition: transform 0.2s, box-shadow 0.2s; }
.category-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow); }
.category-card .card-title { font-weight: 500; }

/* --- START: Professional Teacher List View --- */
.teacher-list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.teacher-list-item {
    display: flex;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    gap: 20px;
    transition: box-shadow 0.3s, border-color 0.3s;
}
.teacher-list-item:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--brand-primary);
}

.teacher-list-main {
    display: flex;
    gap: 20px;
    flex: 3; /* Takes more space */
}

.teacher-list-avatar img {
    border-radius: 50%;
    width: 96px;
    height: 96px;
}

.teacher-list-info {
    display: flex;
    flex-direction: column;
}

.teacher-list-info .teacher-name {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}
.teacher-list-info .teacher-name a {
    text-decoration: none;
    color: var(--text-primary);
}

.teacher-list-info .teacher-education {
    display: inline-block;
    color: var(--brand-primary);
    font-weight: 500;
    margin-bottom: 15px;
}

.teacher-list-info .teacher-summary {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.teacher-list-details {
    flex: 1.5; /* Takes less space */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

.teacher-list-details .details-meta {
    margin-bottom: 10px;
}

.teacher-list-details .meta-item {
    display: inline-block;
    margin-left: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.teacher-list-details .details-tags {
    margin-bottom: 15px;
}

.teacher-list-details .tag {
    display: inline-block;
    background-color: var(--brand-secondary);
    color: var(--brand-primary);
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 15px;
    margin: 3px;
}

.teacher-list-details .profile-button {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    background: var(--brand-primary);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.teacher-list-details .profile-button:hover {
    background-color: #004494;
}
/* --- END: Professional Teacher List View --- */

/* --- Pagination --- */
.dabiryab-pagination { text-align: center; margin-top: 30px; }
.dabiryab-pagination .page-numbers { padding: 8px 15px; margin: 0 4px; border: 1px solid var(--border-color); border-radius: 5px; text-decoration: none; color: var(--brand-primary); }
.dabiryab-pagination .page-numbers:hover { background: var(--brand-secondary); }
.dabiryab-pagination .page-numbers.current { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }

/* --- Responsive --- */
@media (max-width: 960px) {
    .dabiryab-container { flex-direction: column; }
    #dabiryab-sidebar, #dabiryab-main-content { max-width: 100%; flex-basis: 100%; }
    .teacher-list-item { flex-direction: column; }
    .teacher-list-details { border-right: none; border-top: 1px solid var(--border-color); padding-right: 0; padding-top: 20px; width: 100%; align-items: center; }
}

/* --- START: Filter Widget Styles --- */
.dabiryab-filter-widget {
    display: flex;
    gap: 10px;
}
.dabiryab-filter-widget input[type="search"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
.dabiryab-filter-widget label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* --- AJAX Loading State --- */
#dabiryab-ajax-results-wrapper.loading {
    opacity: 0.5;
    position: relative;
    min-height: 200px;
}
#dabiryab-ajax-results-wrapper.loading::before {
    content: 'در حال بارگذاری...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: var(--brand-primary);
}
/* --- END: Filter Widget Styles --- */


.teacher-list-avatar img {
  min-width: 96px;
}


/* Mobile layout adjustments to show main content before sidebar */
@media (max-width: 768px) {
  .dabiryab-container {
    /* Ensure the container uses flexbox and stacks vertically on mobile */
    display: flex;
    flex-direction: column;
  }

  /* Set the visual order for the main content to appear first */
  #dabiryab-main-content {
    order: 1;
  }

  /* Set the visual order for the sidebar to appear second */
  #dabiryab-sidebar {
    order: 2;
  }
}

#dabiryab-main-content section h2 {
  font-size: 1.2rem;
}

/* Fallback Message Styles */
.fallback-message {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fallback-btn {
    width: 100%;
    max-width: 500px;
    text-align: center;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s ease;
    margin: 10px auto;
    box-shadow: 0 2px 5px rgba(124, 65, 130, 0.3);
    display: block;
    font-size: 1.55rem;
    line-height: 1.6;
}

.fallback-btn-primary {
    background: #288327;
}

.fallback-btn-primary:hover {
    background: #1f6b1f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 131, 39, 0.4);
}

.fallback-btn-secondary {
    background: #0056b3;
}

.fallback-btn-secondary:hover {
    background: #004494;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.4);
}

/* Responsive Fallback Buttons */
@media (max-width: 768px) {
    .fallback-message {
        padding: 20px 15px;
    }
    
    .fallback-btn {
        font-size: 1.5rem;
        padding: 12px 15px;
        margin: 8px auto;
        line-height: 1.5;
    }
}

/* Bridged WooCommerce tutor-category: keep Woodmart chrome, style SEO pieces inside it */
body.dabiryab-seo-bridged-catalog .dabiryab-bridged-sidebar #dabiryab-sidebar {
    width: 100%;
    max-width: 100%;
}
body.dabiryab-seo-bridged-catalog .dabiryab-bridged-teachers-loop #dabiryab-main-content {
    width: 100%;
    max-width: 100%;
}
body.dabiryab-seo-bridged-catalog .dabiryab-bridged-teachers-loop .dabiryab-header-wrapper {
    display: none; /* page title comes from Woodmart / term-description */
}
body.dabiryab-wc-storefront-disabled .wd-header-cart,
body.dabiryab-wc-storefront-disabled .woodmart-shopping-cart,
body.dabiryab-wc-storefront-disabled .wd-header-wishlist,
body.dabiryab-wc-storefront-disabled .wd-header-compare,
body.dabiryab-wc-storefront-disabled .menu-item-object-product,
body.dabiryab-wc-storefront-disabled a[href*="/cart/"],
body.dabiryab-wc-storefront-disabled a[href*="/checkout/"] {
    display: none !important;
}
