

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Kịch bản - CSS scaffold */
.tab-header { display:flex; align-items:center; justify-content:space-between; margin: 30px 0; }
.tab-header h2 { margin:0; font-size: 1.8rem; }
.search-wrapper { align-items:center; justify-content:space-between; margin-bottom: 12px; }
.heading-title { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    margin: 0 0 20px 0; 
    font-size: 18px; 
    font-weight: 600; 
    color: #374151; 
    padding-bottom: 10px; 
    border-bottom: 2px solid #e5e7eb; 
}

.heading-title .material-icons {
    font-size: 20px;
    color: #6b7280;
}
/* Clear button styles moved to search box section above */
@keyframes spin { from { transform:rotate(0); } to { transform:rotate(360deg); } }

/* Button Styles */
.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #0048d8;
    color: white;
}

.btn-primary:hover {
    background: #0040c1;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Additional Button Styles from doanh-nghiep.css */
.btn-primary-sm { 
    background: #0048d8; 
    color: #fff; 
    border: none; 
    border-radius: 6px; 
    padding: 8px 14px; 
    cursor: pointer; 
}

.btn-secondary-sm { 
    background: #f3f4f6; 
    color: #111827; 
    border: 1px solid #e5e7eb; 
    border-radius: 6px; 
    padding: 8px 14px; 
    cursor: pointer; 
}

.btn-add-taxonomy {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    transition: all 0.2s ease;
}

.btn-add-taxonomy:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-add-taxonomy .material-icons {
    font-size: 18px;
}

.btn-sm {
    background: #0048d8 !important;
    color: white !important;
    border: none;
    padding: 2px 20px !important;
    border-radius: 30px;
    text-transform: initial;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}
.btn-sm .material-icons{ 
	font-size: 16px;
    margin-right: 5px; 
}

/* Search Wrapper Layout */
.search-wrapper.flex {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


.btn-my-scripts .material-icons {
    font-size: 18px;
    color: white;
    transition: transform 0.3s ease;
}

.btn-my-scripts:hover .material-icons {
    transform: scale(1.1);
}

/* Save Script Button in Script Actions */


.script-actions .save-script-btn .material-icons {
    font-size: 16px;
    color: white;
    transition: transform 0.3s ease;
}

.script-actions .save-script-btn:hover .material-icons {
    transform: scale(1.1);
}

/* Search and Input Styles */
.search-input, .filter-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* Flex Utilities */
.flex {
    display: flex;
}

/* Search Box Styles */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-controls {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #64748b;
    font-size: 20px;
    pointer-events: none;
}

.search-input {
    width: 100% !important;
    padding: 10px 40px 10px 40px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #f8fafc !important;
}

.search-input:focus {
    outline: none;
    border-color: #0048d8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 72, 216, 0.1);
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #f1f5f9;
    color: #374151;
}

.clear-btn-hidden {
    display: none;
}

.search-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: #64748b;
    font-size: 14px;
}

.search-status-hidden {
    display: none;
}

.search-status .material-icons {
    animation: spin 1s linear infinite;
}

/* Pagination Styles */
.pagination-container {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}
#ds-kich-ban {
    margin:0 0 30px;
}
#ds-kich-ban.loading { opacity: 0.6; pointer-events:none; }
.no-scripts { display:flex; align-items:center; gap:8px; padding:12px; background:#f8fafc; border:1px dashed #e5e7eb; border-radius:8px; }
.script-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:25px; }
.script-item.script-item-child, .script-item.script-item-child-2, .script-item:not(.collapsed) { border-radius:10px; padding:12px; background: #e4edff; }
.script-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.script-item .script-title{
  font-size:1.4rem;
}
.script-item-child .script-title, .script-item-child-2 .script-title{
  font-size:1.2rem;
}
.script-title { font-weight:700; }
.script-actions { 
	display: inline-flex;
	gap: 5px;
	margin-top: 10px;
	align-items: center;
}

/* Script Rating Display */
.script-rating {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.script-rating:hover {
    background-color: #f3f4f6;
}

.script-rating .rating-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.script-rating .rating-stars-display {
    display: flex;
    gap: 2px;
}

.script-rating .star {
    color: #d1d5db;
    font-size: 16px;
    transition: color 0.2s ease;
}

.script-rating .star.active {
    color: #fbbf24;
}

.script-rating .rating-text {
    font-size: 12px;
    color: #6b7280;
    margin-left: 4px;
}

.script-rating .rating-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-left: 8px;
    font-style: italic;
    opacity: 0.8;
}

.script-rating .latest-comment {
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0048d8;
}

.script-rating .comment-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.script-rating .comment-author {
    font-size: 10px;
    color: #0048d8;
    font-weight: 600;
}

.script-rating .comment-text {
    font-size: 11px;
    color: #374151;
    line-height: 1.3;
}
.script-actions .btn { 
	display: flex;
	align-items: center;
	gap: 4px;}
.script-desc { 
    color:#e21736;
    font-style: italic;
    margin: 10px 0;
}
.script-type-badge{
    display: inline-block;
    background: #f27474;
    color: #ffffff;
    border: 1px solid #dbe4ff;
    border-radius: 999px;
    padding: 2px 8px;
    margin-right: 6px;
    font-size: 12px;
    vertical-align: middle;
}
/* .script-content-preview removed from markup */

/* Modal */
.custom-modal { display:none; position:fixed; z-index:9999; inset:0; background:rgba(0,0,0,.35); align-items:center; justify-content:center; padding:16px; }
.custom-modal-content { width:100%; max-width:720px; background:#fff; border-radius:12px; overflow:hidden; box-shadow:0 10px 30px rgba(0,0,0,.12); }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid #f1f5f9; }
.modal-body { 
    padding:16px; 
    max-height: 70vh; 
    overflow-y: auto; 
}

.preview-content h1, .preview-content h2, .preview-content h3, .preview-content h4, .preview-content h5, .preview-content h6{
    margin: 0.3rem 0 0.5rem 0;
}
.preview-content h1{
    font-size:1.6rem;
}
.preview-content h2{
    font-size:1.2rem;
}
.preview-content h3{
    font-size:1rem;
}
.preview-content h4{
    font-size:0.9rem;
}
.preview-content h5{
    font-size:0.8rem;
}
.preview-content h6{
    font-size:0.7rem;
}
.preview-content p {
    margin: 0 0 0.5rem 0;
}

.preview-content a {
    color: #0048d8;
    text-decoration: none;
}
.preview-content blockquote{
    font-style: italic;
}
.preview-content a:hover {
    text-decoration: underline;
}
/* Increase editor input height in modals */
#them-kich-ban-modal .ck-editor__editable,
#sua-kich-ban-modal .ck-editor__editable {
  min-height: 150px;
}
#them-kich-ban-modal #add-script-content,
#sua-kich-ban-modal #edit-script-content {
  height: 150px;
}
.modal-footer { padding:12px 16px; display:flex; align-items:center; justify-content:flex-end; gap:10px; border-top:1px solid #f1f5f9; }
.custom-modal-close { cursor:pointer; font-size:24px; }
.form-group { margin-bottom:12px; }
.form-control { width:100%; padding:8px 12px; border:1px solid #e5e7eb; border-radius:8px; }

/* Form enhancements */
.form-row { display:flex; gap:12px; margin-bottom:12px; }
.form-group label { display:flex; align-items:center; gap:6px; margin-bottom:4px; font-weight:500; }
.form-group label .material-icons { font-size:18px; color:#6b7280; }

/* Filter system */
.filter-wrapper { background:#f8fafc; border:1px solid #e5e7eb; border-radius:8px; padding:12px; margin-bottom:16px; }
.filter-row { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.filter-group {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
}
.filter-group label {
    display: flex
;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: .9rem;
    font-weight: 500;
    color: #374151;
}
.filter-group label .material-icons { font-size:16px; }
.filter-select { padding:6px 8px; border:1px solid #d1d5db; border-radius:6px;min-width:140px; }
.filter-actions { margin-left:auto; }

/* Script item enhancements */
.script-item { 
    position: relative; 
    transition: all 0.3s ease;
}

/* Stacked card effect - like a deck of cards */
.script-item.has-children {
    position: relative;
    z-index: 1;
    padding:0;
    background:none;
}

/* Stacked layers will be created dynamically by JavaScript */
/* Flex layout for script content and image */
.script-body { 
    display:flex; 
    align-items:flex-start; 
    gap:15px; 
}

/* Ensure parent item is above stacked layers */
.script-item.has-children .script-body {
    position: relative;
    z-index: 2;
    background: #e4edff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Hover effect for stacked cards */
.script-item.has-children:hover .stacked-layer {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
}

/* Individual layer hover effects */
.script-item.has-children .stacked-layer:nth-child(1) {
    transition-delay: 0ms;
}
.script-item.has-children .stacked-layer:nth-child(2) {
    transition-delay: 50ms;
}
.script-item.has-children .stacked-layer:nth-child(3) {
    transition-delay: 100ms;
}
.script-item.has-children .stacked-layer:nth-child(4) {
    transition-delay: 150ms;
}
.script-content { flex:1; min-width:0; }
.script-image { flex:0 0 220px; max-width:220px; }
.script-image img { display:block; width:100%; height:auto; border-radius:8px; }
.script-meta { display:flex; gap:8px; margin:10px 0; font-size:.85rem; color:#6b7280; }

/* Collapsible script items - stacked cards effect */
.script-item-child { 
    margin-left: 50px;
    background: #f9efff; 
    transition: all 0.3s ease;
    transform: scale(0.95) translateY(-5px);
    opacity: 0.6;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 3px solid #e879f9;
    position: relative;
}
.script-item-child-2 { 
    margin-left: 100px;
    background: #ffe2e2;
    transition: all 0.3s ease;
    transform: scale(0.9) translateY(-10px);
    opacity: 0.5;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 3px solid #f87171;
    position: relative;
}

/* Expanded state for child items */
.script-item-child.expanded {
    transform: scale(1) translateY(0);
    opacity: 1;
    margin-left: 50px;
    background: #f9efff;
}

.script-item-child-2.expanded {
    transform: scale(1) translateY(0);
    opacity: 1;
    margin-left: 100px;
    background: #ffe2e2;
}

/* Default state for child items - initially hidden */
.script-item-child,
.script-item-child-2 {
    display: none;
}

/* Expand/collapse indicator */
.script-item.has-children .script-title::after {
    content: 'keyboard_arrow_down';
    font-family: 'Material Icons';
    margin-left: 8px;
    font-size: 18px;
    transition: all 0.3s ease;
    color: #6b7280;
    vertical-align: middle;
}

.script-item.has-children.collapsed .script-title::after {
    content: 'keyboard_arrow_right';
}

/* Ensure collapsed state hides children */
.script-item.collapsed .script-item-child,
.script-item.collapsed .script-item-child-2 {
    display: none !important;
}


/* Hover effects for collapsible items */
.script-item-child:hover,
.script-item-child-2:hover {
    transform: scale(0.98);
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.script-item-child.expanded:hover,
.script-item-child-2.expanded:hover {
    transform: scale(1.02);
}
/* Material icon arrow outside the child item, on the left */
.script-item-child::before {
  content: 'subdirectory_arrow_right';
  font-family: 'Material Icons';
  position: absolute;
  left: -24px;
  top: 14px;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
}
/* Arrow for second-level child items to mirror parent->child indicator */
.script-item-child-2::before {
  content: 'subdirectory_arrow_right';
  font-family: 'Material Icons';
  position: absolute;
  left: -24px;
  top: 14px;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
}
.script-meta span, .preview-meta-tags span{ padding:2px 10px; border-radius:30px; font-size:.75rem; }	
.script-tag { background:#e5e7eb; color:#374151; padding:2px 6px !important; border-radius:4px; font-size:.75rem; }
.script-category { background:#dbeafe; color:#1e40af; }
.script-product { 
  background: #ffffff;
  color: #0048d8;}
.script-audience { background:#fef3c7; color:#92400e; }
.script-objective { background:#d1fae5; color:#065f46; }
.script-disease { background:#fde2e2; color:#b91c1c; }
.script-symptom { background:#ede9fe; color:#5b21b6; }

@media (max-width: 768px) {
  .script-body { flex-direction: column; }
  .script-image { flex: 0 0 auto; max-width: 100%; margin-top: 8px; }
}


/* Preview Modal */
.preview-section { margin-bottom:20px; }
#preview-children-container { margin-top: 12px; }

/* My Scripts Modal */
.my-scripts-content {
    padding: 0;
}

.my-scripts-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 500;
}

.stats-item .material-icons {
    font-size: 20px;
    color: #3b82f6;
}

.stats-text {
    font-size: 14px;
}

.my-scripts-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.my-scripts-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
}

.my-scripts-actions .btn-primary {
    background: #0048d8;
    color: white;
    border: none;
}

.my-scripts-actions .btn-primary:hover {
    background: #0040c1;
}

.my-scripts-actions .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.my-scripts-actions .btn-secondary:hover {
    background: #e2e8f0;
}

.saved-scripts-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.no-saved-scripts {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.no-saved-scripts .material-icons {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.no-saved-scripts p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.no-saved-scripts small {
    font-size: 14px;
    color: #94a3b8;
}

.saved-script-item {
    background: #e4edff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.saved-script-item:last-child {
    margin-bottom: 0;
}

.saved-script-item:hover {
    background: #dbeafe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.saved-script-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.saved-script-header h4 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
    margin-right: 12px;
}

.saved-date {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}




.saved-script-desc {
    color: #000;
    font-style: italic;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.5;
}

.saved-script-actions {
    display: inline-flex;
    gap: 5px;
    margin-top: 10px;
}

.saved-script-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.saved-script-actions .btn .material-icons {
    font-size: 16px;
}

.saved-script-actions .btn-primary {
    background: #0048d8;
    color: white;
    border: none;
}

.saved-script-actions .btn-primary:hover {
    background: #0040c1;
}

.saved-script-actions .btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.saved-script-actions .btn-danger:hover {
    background: #dc2626;
}

/* Preview modal specific styling */
#preview-kich-ban-modal .modal-body {
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Hide modal close button */
#preview-kich-ban-modal .custom-modal-close {
    display: none !important;
}

/* Ensure rating section is visible */
#preview-kich-ban-modal .rating-comments-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999 !important;
    margin: 20px 0 !important;
    min-height: 200px !important;
    width: 100% !important;
}

#preview-kich-ban-modal .rating-section,
#preview-kich-ban-modal .comments-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}
.preview-section h3 { margin:0 0 12px; color:#111827; }
.preview-section ul li{
    margin-left: 1.43em;
}
.preview-meta { margin-bottom:16px; }
.preview-meta-tags { display:flex; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.preview-desc { 
    color:#e21736; 
    font-style:italic; 
    margin:10px 0;
}


.preview-content {
    line-height:1.6; 
    white-space:pre-wrap; 
}


/* Highlight parent script section in modal */
.preview-parent h3,
.preview-parent h4 {
  color: #0f172a;
}

/* Style child sections in preview modal similar to script list */
.preview-section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #e4edff;
  margin-bottom: 10px;
}

/* First level child in modal */
.preview-section.preview-child-1 {
  margin-left: 50px;
  background: #f9efff;
  position: relative;
}

/* Second level child in modal */
.preview-section.preview-child-2 {
  margin-left: 100px;
  background: #ffe2e2;
}

/* Third level child in modal */
.preview-section.preview-child-3 {
  margin-left: 150px;
  background: #f0fdf4;
}

/* Add arrow indicator for child sections in modal */
.preview-section.preview-child-1::before,
.preview-section.preview-child-2::before,
.preview-section.preview-child-3::before {
  content: 'subdirectory_arrow_right';
  font-family: 'Material Icons';
  position: absolute;
  left: -24px;
  top: 14px;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
}

/* Style for parent content span in preview modal */
.preview-parent-content {
  display: block;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 500;
  color: #1e293b;
}


/* Sidebar */
.scripts-side-info .side-card { border:1px solid #e5e7eb; border-radius:10px; background:#fff; padding:12px; }
.scripts-side-info .side-title { display:flex; align-items:center; gap:6px; margin:0 0 8px; font-size:1.05rem; }
.scripts-side-info .side-list { margin:0; padding-left:18px; color:#4b5563; }

/* AJAX Product Search */
.ajax-product-search {position: relative; }
.ajax-product-search input{
    border-radius:8px;
}
.ajax-product-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
  max-height: 260px; overflow: auto; box-shadow: 0 6px 20px rgba(0,0,0,.08);
  display: none;
}
.ajax-product-results.show { display: block; }
.ajax-product-results .result-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; }
.ajax-product-results .result-item:hover { background: #f8fafc; }
.ajax-product-results img { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; }
.ajax-product-results .title { font-size: 13px; color: #374151; }

/* Sidebar Layout */
.main-content-wrapper {
    display: flex;
    gap: 20px;
    margin: 20px 0 30px;
}

.sidebar-left {
    width: 25%;
    min-width: 250px;
    background: #f8fafc;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.main-content {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.sidebar-section h3 .material-icons {
    font-size: 20px;
    color: #6b7280;
}

/* Filter group h3 styling to match sidebar */
.filter-group h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.filter-group h3 .material-icons {
    font-size: 20px;
    color: #6b7280;
}

.sidebar-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
}

.sidebar-list::-webkit-scrollbar {
    width: 6px;
}

.sidebar-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.sidebar-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item:hover {
    background: #f8fafc;
    color: #1e40af;
}

.sidebar-item.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 500;
}

.sidebar-item-name {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

.sidebar-item-count {
    background: #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.sidebar-item.active .sidebar-item-count {
    background: #3b82f6;
    color: white;
}

.loading-text {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.empty-text {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle-btn {
    display: none;
    background: #0048d8;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Fixed Mobile Toggle Button */
.mobile-sidebar-toggle-btn.fixed {
    position: fixed;
    bottom:10px;
    left:10px;
    transform: translateY(-50%);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 72, 216, 0.3);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    padding: 0;
    min-width: 60px;
}

.mobile-sidebar-toggle-btn.fixed .toggle-text {
    display: none;
}

.mobile-sidebar-toggle-btn.fixed .material-icons {
    font-size: 24px;
}

.mobile-sidebar-toggle-btn:hover {
    background: #0040c1;
    transform: translateY(-1px);
}

.mobile-sidebar-toggle-btn .material-icons {
    font-size: 20px;
}

.mobile-sidebar-toggle-btn .toggle-text {
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Sidebar Close Button */
.mobile-sidebar-close-section {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}

.mobile-sidebar-close-btn {
    width: 60px;
    height: 60px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.mobile-sidebar-close-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

.mobile-sidebar-close-btn:active {
    transform: scale(0.95);
}

.mobile-sidebar-close-btn .material-icons {
    font-size: 24px;
}

.mobile-sidebar-close-btn .close-text {
    display: none;
}

/* Tab Header Layout */
.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .tab-header {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 16px;
    }
    
    .mobile-sidebar-toggle-btn {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 120px;
    }
    
    .main-content-wrapper {
        flex-direction: column;
        gap: 15px;
        position: relative;
    }
    
    .sidebar-left {
        width: 100%;
        min-width: auto;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 999;
        background: #f8fafc;
        border-radius: 0;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
    }
    
    .mobile-sidebar-close-section {
        display: none;
    }
    
    .sidebar-left.mobile-open ~ .mobile-sidebar-close-section {
        display: block;
    }
    
    .sidebar-left.mobile-open {
        left: 0;
    }
    
    /* Move fixed button when sidebar is open */
    .sidebar-left.mobile-open + * .mobile-sidebar-toggle-btn.fixed,
    .sidebar-left.mobile-open ~ * .mobile-sidebar-toggle-btn.fixed {
        left: calc(100vw - 80px);
        transition: left 0.3s ease;
    }
    
    .sidebar-left .sidebar-section {
        margin-bottom: 25px;
    }
    
    .sidebar-left .sidebar-section:last-child {
        margin-bottom: 0;
        padding-bottom: 20px;
    }
    
    .main-content {
        order: 1;
        width: 100%;
    }
    
    .mobile-sidebar-overlay {
        display: block;
    }
    
    .search-wrapper.flex {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .search-actions {
        justify-content: center;
    }
    
    .btn-my-scripts {
        width: 100%;
        justify-content: center;
    }
    
    .search-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    .search-box{
        display: block;
        padding:0;
    }
    /* My Scripts Modal Responsive */
    .my-scripts-stats {
        flex-direction: column;
        gap: 12px;
    }
    #filter-objective, #filter-audience{
        width:100%;
    }
    .my-scripts-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .saved-script-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .saved-script-header h4 {
        margin-right: 0;
    }
    
    .saved-script-actions {
        justify-content: stretch;
    }
    
    .saved-script-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .search-box {
        max-width: none;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        min-width: auto;
        width: 100%;
    }
    
    .filter-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    .ajax-product-search{
        width:100%;
    }
}

/* Script Type Filter */
.script-type-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.script-type-item:hover {
    background-color: #f3f4f6;
}

.script-type-item.active {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 500;
}

.script-type-item .material-icons {
    font-size: 18px;
    color: #6b7280;
}

.script-type-item.active .material-icons {
    color: #1e40af;
}

.script-type-text {
    flex: 1;
    font-size: 0.9rem;
}

.script-type-count {
    background-color: #e5e7eb;
    color: #6b7280;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.script-type-item.active .script-type-count {
    background-color: #1e40af;
    color: white;
}

/* Sidebar Search Input */
.sidebar-search {
    margin-bottom: 12px;
}

.sidebar-search-icon {
    position: absolute;
    left: 14px;
    top: 8px;
    color: #64748b;
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.sidebar-search-wrapper:focus-within .sidebar-search-icon {
    color: #3b82f6;
    transform: scale(1.1);
}

.sidebar-search-input {
    width: 100%;
    padding: 12px 16px 12px 40px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    background: #ffffff;
    color: #1e293b;
}
.sidebar-search-wrapper{
    position: relative;
}
.sidebar-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sidebar-search-input::placeholder {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.sidebar-search-input:focus::placeholder {
    color: #cbd5e1;
}

/* Animation for search icon */
@keyframes searchPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar-search-wrapper {
        padding: 3px;
    }
    
    .sidebar-search-input {
        padding: 10px 14px 10px 44px;
        font-size: 13px;
    }
    
    .sidebar-search-icon {
        left: 12px;
        font-size: 18px;
    }
}

/* Show More Button */
.show-more-btn {
    margin-top: 8px;
    text-align: center;
}

.btn-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-show-more:hover {
    background: #e2e8f0;
    color: #374151;
    border-color: #d1d5db;
}

.btn-show-more .material-icons {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.btn-show-more:hover .material-icons {
    transform: translateY(1px);
}

/* Hidden items */
.sidebar-item.hidden {
    display: none;
}

/* Rating and Comments Section */
.rating-comments-section {
    margin-top: 30px;
    padding: 20px;
    border-top: 2px solid #e5e7eb;
    display: block !important;
    visibility: visible !important;
    background: #f8f9fa;
    border-radius: 8px;
}

.rating-section, .comments-section {
    margin-bottom: 30px;
}

.rating-section h4, .comments-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.rating-section h4 .material-icons, .comments-section h4 .material-icons {
    font-size: 18px;
    color: #f59e0b;
}

/* Rating Stats */
.rating-stats {
    margin-bottom: 20px;
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 8px;
    border: 1px solid #f59e0b;
}

.rating-number {
    font-size: 24px;
    font-weight: 700;
    color: #92400e;
}

.stars-display {
    display: flex;
    gap: 2px;
}

.stars-display .star {
    font-size: 20px;
    color: #f59e0b;
}

.rating-count {
    font-size: 14px;
    color: #92400e;
    font-weight: 500;
}

/* Rating Form */
.rating-form {
    margin-bottom: 20px;
}

.rating-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.star-rating {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.star-rating .star {
    font-size: 24px;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star-rating .star:hover,
.star-rating .star.active {
    color: #f59e0b;
    transform: scale(1.1);
}

.star-rating .star:hover ~ .star {
    color: #d1d5db;
}

/* Ratings List */
.ratings-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.rating-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-item:last-child {
    border-bottom: none;
}

.rating-item .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.rating-item .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.rating-item .user-name {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.rating-item .rating-stars {
    display: flex;
    gap: 1px;
}

.rating-item .rating-stars .star {
    font-size: 16px;
    color: #f59e0b;
}

.rating-item .rating-date {
    margin-left: auto;
    font-size: 12px;
    color: #6b7280;
}

/* Comments Section */
.comment-form {
    margin-bottom: 20px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
    transition: border-color 0.2s ease;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form .btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Comments List */
.comments-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.comment-item {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.comment-user-name {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.comment-date {
    margin-left: auto;
    font-size: 12px;
    color: #6b7280;
}

.comment-content {
    color: #374151;
    line-height: 1.5;
    font-size: 14px;
    margin-left: 42px;
}

/* Empty states */
.no-ratings, .no-comments {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
}

.no-ratings .material-icons, .no-comments .material-icons {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .average-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rating-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rating-item .user-info {
        min-width: auto;
    }
    
    .rating-item .rating-date {
        margin-left: 0;
    }
    
    .comment-content {
        margin-left: 0;
    }
}

