/**
 * @file
 * CiviCRM 6.6 compatibility overrides for CAGP theme.
 * This file contains updated styling for CiviCRM components to ensure
 * compatibility with CiviCRM 6.6 and modern Drupal.
 */

/* CiviCRM 6.6 Form Container Updates */
.crm-container {
  font-family: 'Clear Sans', Arial, sans-serif !important;
}

/* Updated CiviCRM Button Styling */
.crm-container .crm-button,
.crm-container .crm-form-submit,
.crm-container input.crm-button {
  background: #2786c2;
  border: 1px solid #2786c2;
  color: white;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.crm-container .crm-button:hover,
.crm-container .crm-form-submit:hover {
  background: #1e6fa8;
  border-color: #1e6fa8;
}

/* CiviCRM 6.6 Accordion Updates */
.crm-container .crm-accordion-header {
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 10px 15px;
  font-weight: bold;
  cursor: pointer;
}

/* Updated Dialog and Popup Styling */
.crm-container .ui-dialog,
.crm-container .crm-popup {
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* CiviCRM 6.6 Select2 Updates */
.crm-container .select2-container .select2-choice {
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  height: 32px;
  line-height: 32px;
}

.crm-container .select2-container .select2-choice > .select2-chosen {
  padding-left: 8px;
  padding-right: 26px;
}

/* Modern CiviCRM Tab Styling */
.crm-container .crm-contact-tabs {
  border-bottom: 2px solid #e0e0e0;
}

.crm-container .crm-contact-tabs li {
  margin-right: 5px;
}

.crm-container .crm-contact-tabs li a {
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
}

.crm-container .crm-contact-tabs li.ui-tabs-active a,
.crm-container .crm-contact-tabs li a:hover {
  background: white;
  border: 1px solid #e0e0e0;
  border-bottom-color: white;
  color: #2786c2;
}

/* CiviCRM 6.6 Dashboard Updates */
.crm-container .crm-dashboard-groups {
  margin: 0;
  padding: 0;
}

.crm-container .crm-dashboard .crm-section {
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 15px;
  background: white;
}

/* Updated CiviCRM Action Links */
.crm-container .crm-actions-ribbon {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 10px 15px;
  margin-bottom: 20px;
}

/* CiviCRM 6.6 Event and Contribution Page Styling */
.crm-container #crm-event-links-list,
.crm-container #crm-contribpage-links-list,
.crm-container #crm-create-new-list,
.crm-container #crm-contact-actions-list,
.crm-container #crm-participant-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Modern CiviCRM Form Layout */
.crm-container .crm-form-block {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

/* CiviCRM 6.6 Field Styling */
.crm-container .crm-section {
  margin-bottom: 15px;
  clear: both;
}

.crm-container .crm-section .label {
  float: left;
  width: 50%;
  padding-right: 15px;
  font-weight: bold;
  text-align: right;
}

.crm-container .crm-section .content {
  margin-left: 25%;
  padding-left: 15px;
}

/* Responsive CiviCRM Forms */
@media (max-width: 768px) {
  .crm-container .crm-section .label,
  .crm-container .crm-section .content {
    float: none;
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    text-align: left;
  }
  
  .crm-container .crm-section .label {
    margin-bottom: 5px;
  }
}

/* CiviCRM 6.6 Notification Updates */
.crm-container .crm-status {
  border-radius: 4px;
  padding: 12px 15px;
  margin-bottom: 15px;
  border-left: 4px solid;
}

.crm-container .crm-status.status-success {
  background: #d4edda;
  border-left-color: #28a745;
  color: #155724;
}

.crm-container .crm-status.status-warning {
  background: #fff3cd;
  border-left-color: #ffc107;
  color: #856404;
}

.crm-container .crm-status.status-error {
  background: #f8d7da;
  border-left-color: #dc3545;
  color: #721c24;
}

/* CiviCRM Public Forms Enhancement */
.crm-container.crm-public {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.crm-container.crm-public .select2-container .select2-choice {
  height: 40px;
  line-height: 40px;
  font-size: 14px;
}

/* Job Posting Contribution Page Specific Styling */
.page-node-type-civicrm-contribution-page .crm-container,
.page-civicrm-contribute-transact .crm-container {
  font-family: 'Clear Sans', Arial, sans-serif;
  line-height: 1.6;
}

/* Enhanced page title for contribution pages */
.page-civicrm-contribute-transact #page-title,
.page-civicrm-contribute-transact h1.page-title {
  font-size: 2.5rem;
  color: #666;
  font-weight: 300;
  margin-bottom: 30px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 15px;
}

/* Job Board link styling - more comprehensive selectors */
.crm-container a[href*="job-board"],
.crm-container a[href*="Job Board"],
.crm-container a:contains("Job Board") {
  color: #2786c2 !important;
  text-decoration: none !important;
  font-weight: bold !important;
}

.crm-container a[href*="job-board"]:hover,
.crm-container a[href*="Job Board"]:hover,
.crm-container a:contains("Job Board"):hover {
  color: #1e6fa8 !important;
  text-decoration: underline !important;
}

/* Improve typography and spacing */
.crm-container .crm-contribution-page-id-36 {
  font-size: 14px;
  line-height: 1.6;
}

.crm-container .crm-contribution-page-id-36 p {
  margin-bottom: 20px;
}

.crm-container .crm-contribution-page-id-36 ul {
  margin: 15px 0;
  padding-left: 25px;
}

.crm-container .crm-contribution-page-id-36 li {
  margin-bottom: 8px;
}

/* Pricing section styling */
.crm-container .crm-contribution-page-id-36 strong:contains("Pricing") {
  color: #333;
  font-size: 16px;
}

/* Enhanced section headers */
.crm-container .crm-contribution-page-id-36 h3,
.crm-container .crm-contribution-page-id-36 strong {
  color: #333;
  margin-top: 25px;
  margin-bottom: 15px;
  font-weight: bold;
}

/* Sign-in instruction styling */
.crm-container .crm-contribution-page-id-36 .sign-in-instruction {
  background: #f8f9fa;
  padding: 15px;
  border-left: 4px solid #2786c2;
  margin: 20px 0;
  border-radius: 4px;
}

/* Enhanced italic text */
.crm-container .crm-contribution-page-id-36 em {
  font-style: italic;
  color: #666;
}

/* Better form section styling */
.crm-container .crm-contribution-page-id-36 .crm-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
}

/* Improve horizontal rules */
.crm-container .crm-contribution-page-id-36 hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 25px 0;
}

/* Enhanced Giving Matters styling */
.crm-container .crm-contribution-page-id-36 em:contains("Giving Matters") {
  font-style: italic;
  font-weight: bold;
}

/* Content wrapper for better spacing */
.crm-container .crm-contribution-page-id-36 .crm-form-block,
.crm-container .crm-contribution-page-id-36 .crm-public-form {
  background: white;
  padding: 30px;
  margin: 20px 0;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* General link styling improvements */
.page-civicrm-job-posting .crm-container a {
  color: #2786c2 !important;
  text-decoration: none !important;
}

.page-civicrm-job-posting .crm-container a:hover {
  color: #1e6fa8 !important;
  text-decoration: underline !important;
}

/* Ensure proper spacing and typography matches legacy */
.page-civicrm-job-posting .crm-container {
  font-family: 'Clear Sans', Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #333 !important;
}

.page-civicrm-job-posting .crm-container p {
  margin-bottom: 18px !important;
}

.page-civicrm-job-posting .crm-container ul {
  margin: 15px 0 !important;
  padding-left: 20px !important;
}

.page-civicrm-job-posting .crm-container li {
  margin-bottom: 8px !important;
}

/* Section headers styling */
.page-civicrm-job-posting .crm-container strong,
.page-civicrm-job-posting .crm-container b {
  color: #333 !important;
  font-weight: bold !important;
}

/* Ensure italic text is properly styled */
.page-civicrm-job-posting .crm-container em,
.page-civicrm-job-posting .crm-container i {
  font-style: italic !important;
  color: #666 !important;
}
/* ========================================
   CAGP CiviCRM Event Pages Styling
   ======================================== */

/* Event Info Page Container */
.page-civicrm-event .crm-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Event Title Styling */
.page-civicrm-event .crm-container h1,
.page-civicrm-event .crm-container .page-title {
  color: #2786c2;
  font-family: 'Clear Sans', Arial, sans-serif;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
  border-bottom: 3px solid #2786c2;
  padding-bottom: 10px;
}

/* Event Information Sections */
.page-civicrm-event .crm-section {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #2786c2;
}

.page-civicrm-event .crm-section .label {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

.page-civicrm-event .crm-section .content {
  color: #555;
  line-height: 1.6;
}

/* Event Date/Time Styling */
.page-civicrm-event .event_date_time-section .content {
  font-size: 16px;
  font-weight: bold;
  color: #2786c2;
}

/* Registration/Action Buttons */
.page-civicrm-event .crm-container .crm-button,
.page-civicrm-event .crm-container .button,
.page-civicrm-event .crm-container input[type=submit] {
  background: #2786c2 !important;
  border: 2px solid #2786c2 !important;
  color: white !important;
  padding: 12px 25px !important;
  border-radius: 6px !important;
  font-weight: bold !important;
  text-transform: uppercase !important;
  font-size: 14px !important;
  letter-spacing: 0.5px !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
}

.page-civicrm-event .crm-container .crm-button:hover,
.page-civicrm-event .crm-container .button:hover,
.page-civicrm-event .crm-container input[type=submit]:hover {
  background: #1e6fa8 !important;
  border-color: #1e6fa8 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 15px rgba(39, 134, 194, 0.3) !important;
}

/* Social Sharing Section */
.page-civicrm-event .crm-socialnetwork {
  background: #e8f4f8 !important;
  border: 1px solid #2786c2 !important;
  border-radius: 8px !important;
  padding: 20px !important;
  margin-top: 30px !important;
}

.page-civicrm-event .crm-socialnetwork h2 {
  color: #2786c2 !important;
  font-size: 18px !important;
  margin-bottom: 10px !important;
}

.page-civicrm-event .crm-socialnetwork .btn {
  background: #2786c2 !important;
  border-color: #2786c2 !important;
  margin-right: 10px !important;
  margin-bottom: 10px !important;
  padding: 8px 16px !important;
  border-radius: 4px !important;
}

.page-civicrm-event .crm-socialnetwork .btn:hover {
  background: #1e6fa8 !important;
  border-color: #1e6fa8 !important;
}

/* Event Location/Contact Information */
.page-civicrm-event .event_location-section,
.page-civicrm-event .event_contact-section {
  background: #fff3cd;
  border-left-color: #ffc107;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-civicrm-event .crm-container {
    margin: 10px;
    padding: 15px;
  }
  
  .page-civicrm-event .crm-container h1 {
    font-size: 24px;
  }
  
  .page-civicrm-event .crm-section {
    padding: 12px;
  }
}

/* Integration with CAGP Theme Colors */
.page-civicrm-event .crm-container {
  font-family: 'Clear Sans', Arial, sans-serif;
}

.page-civicrm-event .crm-container a {
  color: #2786c2;
  text-decoration: none;
}

.page-civicrm-event .crm-container a:hover {
  color: #1e6fa8;
  text-decoration: underline;
}
/* Wrapper */
.views-exposed-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* Form items */
.views-exposed-form .form-item {
  display: flex;
  flex-direction: column;
}

/* Labels */
.views-exposed-form label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #333;
}
.views-exposed-form input.form-text,
.views-exposed-form select.form-select {
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  min-height: 0px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.views-exposed-form input.form-text:focus,
.views-exposed-form select.form-select:focus {
  outline: none;
  border-color: #005fcc;
  box-shadow: 0 0 0 2px rgba(0, 95, 204, 0.15);
}
#edit-actions {
  display: flex;
  align-items: flex-end;
  gap:10px;
}

/* Search button */
#edit-submit-member-directory {
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background-color: #005fcc;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
/* ======================================
   Member Directory – Views Table
   ====================================== */

/* Table base */
.views-view-table,
table.cols-4 {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

/* Table header */
.views-view-table thead th,
table.cols-4 thead th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid #dcdcdc;
  font-weight: 600;
  color: #fff;
  background: #253980;
}

/* Sortable header links */
.views-view-table thead th a,
table.cols-4 thead th a {
  color: #fff;
  text-decoration: none;
}

.views-view-table thead th a:hover {
  text-decoration: underline;
}

/* Table rows */
.views-view-table tbody tr,
table.cols-4 tbody tr {
  border-bottom: 1px solid #e6e6e6;
}

/* Zebra striping */
.views-view-table tbody tr:nth-child(even),
table.cols-4 tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* Table cells */
.views-view-table td,
table.cols-4 td {
  padding: 0.75rem;
  vertical-align: top;
  color: #222;
}

/* Member name */
.views-field-member-combined h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* Contact info under name */
.views-table-contact-info {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}

/* Chapter + organization columns */
.views-field-chapter-label,
.views-field-member-organization {
  white-space: normal;
}

/* Contact link */
.views-field-contact-link a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #005fcc;
  border: 1px solid #005fcc;
  border-radius: 3px;
  text-decoration: none;
}

.views-field-contact-link a:hover {
  background-color: rgba(0, 95, 204, 0.08);
}

/* ======================================
   Mobile – stack table rows
   ====================================== */

@media (max-width: 768px) {
  .views-view-table thead {
    display: none;
  }

  .views-view-table,
  .views-view-table tbody,
  .views-view-table tr,
  .views-view-table td {
    display: block;
    width: 100%;
  }

  .views-view-table tr {
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #e6e6e6;
    padding-bottom: 0.75rem;
  }

  .views-view-table td {
    padding: 0.35rem 0;
  }

  .views-field-contact-link {
    margin-top: 0.5rem;
  }
}

