/**
 * School Centers Directory - Styles
 */

/* --- Main Directory Layout --- */

.scm-directory-container {
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Search Bar --- */
.scm-directory-search {
    margin-bottom: 30px;
    position: relative;
}

.scm-search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.scm-search-input {
    width: 100%;
    padding: 15px 50px 15px 55px; /* Increased left padding for icon */
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    box-sizing: border-box;
    background: #ffffff;
}

.scm-search-input:focus {
    border-color: #2E86AB;
    box-shadow: 0 4px 15px rgba(46, 134, 171, 0.25);
    transform: translateY(-1px);
}

.scm-search-input::placeholder {
    color: #999;
    font-style: italic;
}

.scm-search-icon {
    position: absolute;
    right: 22px !important;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #6c757d;
    pointer-events: none;
    z-index: 2;
}

.scm-search-clear {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: gray;
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.scm-search-clear:hover {
    background: #f0f0f0;
    color: #333;
    transform: translateY(-50%) scale(1.1);
}

/* --- Search Results Dropdown --- */
.scm-search-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 15px 15px;
    margin-top: -2px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1001;
    animation: slideDown 0.2s ease-out;
    white-space: normal;
}

.scm-search-results::-webkit-scrollbar {
    width: 6px;
}

.scm-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.scm-search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.scm-search-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.scm-search-result-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
    white-space: nowrap;
}

.scm-search-result-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateX(2px);
}

.scm-search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 15px 15px;
}

.scm-search-result-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scm-search-result-type.fondamentale { 
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%); 
}

.scm-search-result-type.secondaire { 
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%); 
}

.scm-search-result-type.fondamentalspecial { 
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%); 
}

.scm-search-result-type.secondairespecial { 
    background: linear-gradient(135deg, #F7CB15 0%, #f4c430 100%); 
}




.scm-search-result-content {
    flex: 1;
    min-width: 0;
}

.scm-search-result-name {
    font-weight: 600;
    color: #2E86AB;
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scm-search-result-center {
    font-size: 13px;
    color: #6c757d;
    font-weight: 400;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scm-search-no-results {
    padding: 25px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scm-search-wrapper {
        max-width: 100%;
        margin: 0 15px;
    }
    
    .scm-search-input {
        padding: 12px 45px 12px 50px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .scm-search-icon {
        right: 18px !important;
        font-size: 16px;
    }
    
    .scm-search-clear {
        right: 12px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .scm-search-results {
        margin: 0 15px;
        width: calc(100% - 30px);
        left: 0;
        transform: none;
    }
    
    .scm-search-result-item {
        padding: 14px 16px;
        gap: 12px;
    }
}
/* --- Tabs --- */

.scm-directory-tabs {
    border-radius: 10px;
    overflow: hidden;
}

.scm-tabs-header {
    display: flex;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.scm-tab-button {
    flex-grow: 1;
    min-width: 150px;
    padding: 15px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 500;
    color: #1A365D;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* Tab 1 - Woluwe 1 (Rouge) */
.scm-tab-button[data-tab*="center-"]:nth-child(1) {
    border-left: 4px solid #D2232A !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(1):hover {
    background: linear-gradient(135deg, rgba(210, 35, 42, 0.08) 0%, rgba(210, 35, 42, 0.05) 100%) !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(1).active {
    background: linear-gradient(135deg, rgba(210, 35, 42, 0.12) 0%, rgba(210, 35, 42, 0.08) 100%) !important;
    border-bottom-color: #D2232A !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(1).active .scm-tab-count {
    background: #D2232A !important;
    color: white !important;
}

/* Tab 2 - Woluwe 2 (Jaune) */
.scm-tab-button[data-tab*="center-"]:nth-child(2) {
    border-left: 4px solid #F9B41E !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(2):hover {
    background: linear-gradient(135deg, rgba(249, 180, 30, 0.08) 0%, rgba(249, 180, 30, 0.05) 100%) !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(2).active {
    background: linear-gradient(135deg, rgba(249, 180, 30, 0.12) 0%, rgba(249, 180, 30, 0.08) 100%) !important;
    border-bottom-color: #F9B41E !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(2).active .scm-tab-count {
    background: #F9B41E !important;
    color: #212529 !important; /* Dark text for better contrast on yellow */
}

/* Tab 3 - Woluwe 3 (Mauve) */
.scm-tab-button[data-tab*="center-"]:nth-child(3) {
    border-left: 4px solid #A044AD !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(3):hover {
    background: linear-gradient(135deg, rgba(160, 68, 173, 0.08) 0%, rgba(160, 68, 173, 0.05) 100%) !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(3).active {
    background: linear-gradient(135deg, rgba(160, 68, 173, 0.12) 0%, rgba(160, 68, 173, 0.08) 100%) !important;
    border-bottom-color: #A044AD !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(3).active .scm-tab-count {
    background: #A044AD !important;
    color: white !important;
}

/* Tab 4 - Etterbeek (Bleu foncé) */
.scm-tab-button[data-tab*="center-"]:nth-child(4) {
    border-left: 4px solid #221E8A !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(4):hover {
    background: linear-gradient(135deg, rgba(34, 30, 138, 0.08) 0%, rgba(34, 30, 138, 0.05) 100%) !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(4).active {
    background: linear-gradient(135deg, rgba(34, 30, 138, 0.12) 0%, rgba(34, 30, 138, 0.08) 100%) !important;
    border-bottom-color: #221E8A !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(4).active .scm-tab-count {
    background: #221E8A !important;
    color: white !important;
}

/* Tab 5 - Ixelles (Vert) */
.scm-tab-button[data-tab*="center-"]:nth-child(5) {
    border-left: 4px solid #199C43 !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(5):hover {
    background: linear-gradient(135deg, rgba(25, 156, 67, 0.08) 0%, rgba(25, 156, 67, 0.05) 100%) !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(5).active {
    background: linear-gradient(135deg, rgba(25, 156, 67, 0.12) 0%, rgba(25, 156, 67, 0.08) 100%) !important;
    border-bottom-color: #199C43 !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(5).active .scm-tab-count {
    background: #199C43 !important;
    color: white !important;
}

/* Tab 6 - Schaerbeek (Bleu clair) */
.scm-tab-button[data-tab*="center-"]:nth-child(6) {
    border-left: 4px solid #0D84C8 !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(6):hover {
    background: linear-gradient(135deg, rgba(13, 132, 200, 0.08) 0%, rgba(13, 132, 200, 0.05) 100%) !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(6).active {
    background: linear-gradient(135deg, rgba(13, 132, 200, 0.12) 0%, rgba(13, 132, 200, 0.08) 100%) !important;
    border-bottom-color: #0D84C8 !important;
}
.scm-tab-button[data-tab*="center-"]:nth-child(6).active .scm-tab-count {
    background: #0D84C8 !important;
    color: white !important;
}

.scm-tab-panel:nth-child(1) .scm-center-info {
    border-left-color: #D2232A; /* Rouge -> Woluwe 1 */
    background: linear-gradient(135deg, rgba(210, 35, 42, 0.05) 0%, #f8f9fa 100%);
}

.scm-tab-panel:nth-child(2) .scm-center-info {
    border-left-color: #F9B41E; /* Jaune -> Woluwe 2 */
    background: linear-gradient(135deg, rgba(249, 180, 30, 0.05) 0%, #f8f9fa 100%);
}

.scm-tab-panel:nth-child(3) .scm-center-info {
    border-left-color: #A044AD; /* Mauve -> Woluwe 3 */
    background: linear-gradient(135deg, rgba(160, 68, 173, 0.05) 0%, #f8f9fa 100%);
}

.scm-tab-panel:nth-child(4) .scm-center-info {
    border-left-color: #221E8A; /* Bleu foncé -> Etterbeek */
    background: linear-gradient(135deg, rgba(34, 30, 138, 0.05) 0%, #f8f9fa 100%);
}

.scm-tab-panel:nth-child(5) .scm-center-info {
    border-left-color: #199C43; /* Vert -> Ixelles */
    background: linear-gradient(135deg, rgba(25, 156, 67, 0.05) 0%, #f8f9fa 100%);
}

.scm-tab-panel:nth-child(6) .scm-center-info {
    border-left-color: #0D84C8; /* Bleu clair -> Schaerbeek */
    background: linear-gradient(135deg, rgba(13, 132, 200, 0.05) 0%, #f8f9fa 100%);
}

/* Mobile responsive adjustments for colored tabs */
@media (max-width: 768px) {
    .scm-tab-button[data-tab*="center-"]:nth-child(1).active {
        border-left-color: #D2232A !important;
        border-bottom-color: transparent !important;
    }
    
    .scm-tab-button[data-tab*="center-"]:nth-child(2).active {
        border-left-color: #F9B41E !important;
        border-bottom-color: transparent !important;
    }
    
    .scm-tab-button[data-tab*="center-"]:nth-child(3).active {
        border-left-color: #A044AD !important;
        border-bottom-color: transparent !important;
    }
    
    .scm-tab-button[data-tab*="center-"]:nth-child(4).active {
        border-left-color: #221E8A !important;
        border-bottom-color: transparent !important;
    }
    
    .scm-tab-button[data-tab*="center-"]:nth-child(5).active {
        border-left-color: #199C43 !important;
        border-bottom-color: transparent !important;
    }
    
    .scm-tab-button[data-tab*="center-"]:nth-child(6).active {
        border-left-color: #0D84C8 !important;
        border-bottom-color: transparent !important;
    }
}

/* Alternative implementation using CSS custom properties for easier maintenance */
:root {
    --center-color-1: #D2232A; /* Rouge -> Woluwe 1 */
    --center-color-2: #F9B41E; /* Jaune -> Woluwe 2 */
    --center-color-3: #A044AD; /* Mauve -> Woluwe 3 */
    --center-color-4: #221E8A; /* Bleu foncé -> Etterbeek */
    --center-color-5: #199C43; /* Vert -> Ixelles */
    --center-color-6: #0D84C8; /* Bleu clair -> Schaerbeek */
}

/* If you prefer data attributes for more specific targeting */
.scm-tab-button[data-center-color="purple"] {
    border-left: 4px solid var(--center-color-1);
}

.scm-tab-button[data-center-color="purple"]:hover {
    background: linear-gradient(135deg, rgba(160, 68, 173, 0.08) 0%, rgba(160, 68, 173, 0.05) 100%) !important;
}

.scm-tab-button[data-center-color="purple"].active {
    background: linear-gradient(135deg, rgba(160, 68, 173, 0.12) 0%, rgba(160, 68, 173, 0.08) 100%);
    border-bottom-color: var(--center-color-1);
}

.scm-tab-button:hover {
    background: #e9ecef;
    color: #212529;
}

.scm-tab-button.active {
    background: white;
    color: #2E86AB;
    border-bottom-color: #2E86AB;
}

.scm-tab-count {
    display: inline-block;
    background: #e0e0e0;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.scm-tab-button.active .scm-tab-count {
    background: #2E86AB;
    color: white;
}

/* --- Tab Panels --- */

.scm-tabs-content {
    padding: 30px;
}

.scm-tab-panel {
    display: none;
}

.scm-tab-panel.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Center Info Box --- */

.scm-center-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #2E86AB;
}

.scm-center-info h3 {
    color: #1A365D;
    margin: 0 0 10px 0;
}

.scm-center-info p {
    margin: 5px 0;
    color: #495057;
}

.scm-center-info a {
    color: #2E86AB;
    text-decoration: none;
}

.scm-center-info a:hover {
    text-decoration: underline;
}

/* --- Schools Grid & Cards --- */

.scm-schools-grid {
    display: grid;
    gap: 25px;
}

.scm-schools-grid.columns-2 { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
.scm-schools-grid.columns-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.scm-schools-grid.columns-4 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.scm-school-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.scm-school-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #2E86AB;
}

.scm-school-card-header {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f8f9fa;
}

.scm-school-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s ease !important;
}

.scm-school-card:hover .scm-school-image {
    transform: scale(1.05);
}

.scm-school-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2E86AB 0%, #A23B72 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scm-school-icon {
    font-size: 60px;
    color: white;
    opacity: 0.8;
}

.scm-school-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    color: white;
    font-size: 13px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.badge-fondamentale { background: #28a745; }
.badge-secondaire { background: #dc3545; }
.badge-fondamentalspecial { background: #2c3e50; }
.badge-secondairespecial { background: #F7CB15; }

.scm-school-card-body {
    padding: 20px;
    flex-grow: 1; /* Allows footer to stick to bottom */
}

.scm-school-name {
    color: #2E86AB !important;
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.scm-school-address {
    color: #6c757d;
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px; /* 2 lines of text */
}

.scm-school-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.scm-teacher-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
}

.scm-school-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.scm-view-details-btn {
    width: 100%;
    padding: 10px;
    background: #1A365D;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
    text-align: center;
}

.scm-view-details-btn:hover {
    background: #A23B72;
}


/* --- POPUP STYLES (shared with map) --- */

body.scm-popup-open {
    overflow: hidden;
}

    
.scm-popup-general-email a:hover {
    color: #1e7e34 !important; /* Darker green on hover */
    text-decoration: underline !important;
}


.scm-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.scm-popup-overlay.active {
    display: block;
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.scm-popup-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: 5vh auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: scmPopupAppear 0.3s ease-out;
}

@keyframes scmPopupAppear {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.scm-popup-header {
    background: #2E86AB;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.scm-popup-title {
    color: white;
}
.scm-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    padding: 0;
    line-height: 1;
}

.scm-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.scm-popup-body {
    padding: 30px;
    max-height: calc(90vh - 100px); /* Adjust for header and padding */
    overflow-y: auto;
}

.scm-popup-school-image {
    text-align: center;
    margin-bottom: 30px;
}

.scm-popup-image {
    max-width: 100% !important;
    height: 300px !important;
    width: auto !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    display: none; /* Hidden by default */
}

.scm-popup-image.has-image {
    display: inline-block; /* Shown via JS */
}

.scm-popup-school-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

/* Styling for Address and Website boxes */
.scm-popup-address,
.scm-popup-website {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #2E86AB;
}

/* Titles for Address and Website boxes */
.scm-popup-address h4,
.scm-popup-website h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2E86AB;
}

.scm-popup-address-text {
    margin: 0;
    color: #495057;
    line-height: 1.5;
}

.scm-popup-website-link {
    text-decoration: none;
    font-weight: bold;
    color: #2E86AB;
    transition: color 0.3s ease;
}

.scm-popup-website-link:hover {
    text-decoration: underline;
    color: #A23B72;
}


/* --- Start of Corrected PMS Info Box Styles --- */

/* Main container for the PMS Info Box */
.scm-popup-pms-info {
    margin-bottom: 30px;
    background: #e8f5e8;
    border-left: 4px solid #28a745;
    padding: 20px 25px; /* Added more horizontal padding */
    border-radius: 8px;
}

/* The main title, e.g., "Centre PMS De Référence" */
.scm-popup-pms-info h4 {
    margin: 0 0 15px 0; /* Increased space below the title */
    font-size: 18px; /* Made the title slightly bigger */
    font-weight: 600;
    color: #28a745;
}

/* The name of the center itself, e.g., "CPMS libre Schaerbeek" */
.scm-popup-pms-name {
    font-size: 16px;
    font-weight: 600; /* Made the center name bold */
    color: #343a40;   /* A darker text color for better readability */
    margin: 0 0 10px 0; /* Added space below the name */
}

/* The "Voir le centre" link */
.scm-popup-pms-link {
    display: block; /* Ensures it takes its own line */
    margin-bottom: 15px; /* Creates space between it and the contact info */
    font-weight: bold;
    color: #28a745;
    text-decoration: none;
    font-size: 16px;
}

/* Common styling for both the Phone and Email paragraphs */
.scm-popup-pms-phone,
.scm-popup-pms-email {
    margin: 10px 0; /* Added consistent vertical spacing */
    font-size: 16px;   /* Increased font size to match the good example */
    color: #495057;
    line-height: 1.5;
    font-weight: 500; /* Makes the text slightly bolder than normal */
}

/* Common styling for the links within the Phone and Email paragraphs */
.scm-popup-pms-phone a,
.scm-popup-pms-email a {
    color: #28a745;
    text-decoration: none;
    font-weight: 600; /* Ensures the link part is bold */
    transition: color 0.3s ease;
}

/* Common hover effect for all links in the block */
.scm-popup-pms-link:hover,
.scm-popup-pms-phone a:hover,
.scm-popup-pms-email a:hover {
    text-decoration: underline;
    color: #218838 !important; /* A darker green on hover */
}

/* --- End of Corrected PMS Info Box Styles --- */


.scm-popup-teachers {
    border-top: 2px solid #e9ecef;
    padding-top: 30px;
}

.scm-popup-teachers h3 {
    color: #2E86AB;
    margin: 0 0 25px 0;
    font-size: 20px;
    text-align: center;
}

.scm-popup-teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.scm-popup-teacher-card {
    background: #fdfdfd;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.scm-popup-teacher-card:hover {
    transform: translateY(-5px);
    border-color: #2E86AB;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
}

.scm-popup-teacher-photo {
    margin-bottom: 15px;
}

.scm-popup-teacher-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.scm-popup-teacher-placeholder {
    width: 80px;
    height: 80px;
    background: #dee2e6;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23fff"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
}

.scm-popup-teacher-name {
    font-weight: bold;
    color: #343a40;
    margin-bottom: 10px;
    font-size: 16px;
}

.scm-popup-teacher-specialties {
    margin-bottom: 10px;
    min-height: 20px; /* Prevent layout shift */
}

.scm-popup-specialty {
    display: inline-block !important;
    background: #e9ecef !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    margin: 2px !important;
    font-weight: bold !important;
}

.scm-popup-specialty-psychologique {
    background: #d4edda !important;
    color: #155724 !important;
}
.scm-popup-specialty-sociale {
    background: #d1ecf1 !important;
    color: #0c5460 !important;
}
.scm-popup-specialty-logopedique {
    background: #fce4ec !important;
    color: #880e4f !important;
}
.scm-popup-specialty-sante {
    background: #fff3cd !important;
    color: #856404 !important;
}
.scm-popup-specialty-maternelles {
    background: #e2e3e5 !important;
    color: #383d41 !important;
}

.scm-popup-teacher-email {
    font-size: 13px;
    color: #6c757d;
    word-break: break-all;
    display: block;
}
.scm-popup-teacher-email a {
    color: #2E86AB;
    text-decoration: none;
}
.scm-popup-teacher-email a:hover {
    text-decoration: underline;
}

.scm-popup-no-teachers {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* --- Responsive Design --- */

@media (max-width: 768px) {
    .scm-tabs-header {
        flex-direction: column;
    }
    
    .scm-tab-button {
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
        border-left: 3px solid transparent;
    }
    
    .scm-tab-button.active {
        border-left-color: #1A365D;
        border-bottom-color: transparent;
    }
    
    .scm-schools-grid {
        grid-template-columns: 1fr;
    }
    
    .scm-tabs-content {
        padding: 20px 15px;
    }

    .scm-popup-content {
        width: 95%;
        margin: 2.5vh auto;
        max-height: 95vh;
    }
    
    .scm-popup-school-info {
        grid-template-columns: 1fr;
    }
}

.scm-directory-container .scm-school-card h4.scm-school-name {
    color: #2E86AB !important;
}

/* Fixes the blue H4 titles (Address, Website) */
#scm-directory-popup .scm-popup-address h4,
#scm-directory-popup .scm-popup-website h4 {
    color: #2E86AB;
}

/* Fixes the green H4 title (PMS Center) */
#scm-directory-popup .scm-popup-pms-info h4 {
    color: #28a745;
}

/* Fixes the black H3 title (PMS Team) */
#scm-directory-popup .scm-popup-teachers h3 {
    color: #2E86AB;
}

/* General fix for the PMS Name inside the header if it's a span */
#scm-directory-popup .scm-popup-pms-header span {
    color: #343a40; /* A dark grey, change if needed */
}

.scm-general-email-box {
    background: #e8f5e8;
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.scm-general-email-box h4 {
    color: #28a745;
    margin: 0 0 15px 0;
    font-size: 1.2em;
}

.scm-general-email-box a {
    color: #28a745;
    text-decoration: none;
    font-weight: bold;
}


.scm-general-email-box a:hover {
    color: #28a745 !important;
    text-decoration: none;
    font-weight: bold;
}

/* Directory Absence Management Styles */
.scm-absence-pill {
    background: #dc3545;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin: 10px 0 5px 0;
    text-align: center;
    line-height: 1.3;
}

.scm-replacement-email-info {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
    word-break: break-word;
    line-height: 1.3;
}

.scm-replacement-email-info a {
    color: #6c757d !important;
    text-decoration: none !important;
}

.scm-replacement-email-info a:hover {
    text-decoration: underline !important;
}


/* Amarrage Section Styles */
.scm-popup-amarrage-section {
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.scm-amarrage-highlight-box {
    background: #003399;
    color: white;
    padding: 25px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.scm-amarrage-highlight-box::after {
    content: "★";
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 16px;
    color: #FFCC00;
    opacity: 0.5;
}

.scm-amarrage-text {
    margin: 0 0 15px 0;
    font-size: 1em;
    line-height: 1.5;
}

.scm-amarrage-team {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    color: #FFCC00;
}

.scm-amarrage-logo {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.scm-amarrages-logo-img {
    max-width: 180px;
    height: auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}