/* --- Petition Node Forms --- */

/* Hide 'About text formats' help link in petition add and edit forms */
.node-petition-form #edit-body-0-format-help-about,
.node-petition-form a[href*="filter/tips"],
.node-petition-edit-form #edit-body-0-format-help-about,
.node-petition-edit-form a[href*="filter/tips"] {
  display: none !important;
}

/* --- Views Exposed Form Layout --- */

/* Set filters in a 3-column grid layout */
.views-exposed-form .d-flex.flex-wrap {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: end;
}

/* Adjust font size for floating labels within the form */
.views-exposed-form .form-floating > label {
  font-size: 0.95rem !important;
}

/* Align min and max date fields side-by-side */
[data-drupal-selector="edit-field-date-sumbitted-value-wrapper"] .fieldset-wrapper {
  display: flex !important;
  gap: 10px;
}

/* Styling for the date submitted fieldset legend */
[data-drupal-selector="edit-field-date-sumbitted-value-wrapper"] legend {
  font-size: 0.8rem !important;
  margin-bottom: 2px !important;
}

/* Reduce standard bottom margins for form elements */
.views-exposed-form .mb-4, 
.views-exposed-form .mb-3 {
  margin-bottom: 5px !important;
}

/* --- Navigation & Action Buttons --- */

/* Style for the 'New Petition' button */
.btn-add-petition {
  background-color: rgba(var(--bs-secondary-bg-rgb), var(--bs-bg-opacity)) !important;
  color: #212529 !important;
  height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 20px !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  border: 1px solid #dee2e6 !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.btn-add-petition:hover {
  background-color: rgba(var(--bs-secondary-bg-rgb), 1) !important;
  border-color: #ced4da !important;
  color: #000 !important;
}

/* --- Exposed Form Buttons (Apply/Reset) --- */

/* Container layout for Apply and Reset buttons */
#edit-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: flex-end !important;
  gap: 15px !important;
  grid-column: 3;
  margin-top: auto;
  margin-bottom: 10px;
}

/* Common sizing for Apply and Reset buttons */
#edit-actions input.form-submit {
  width: auto !important;
  height: 38px !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  padding: 0 20px !important;
  margin-bottom: 0 !important;
  border-radius: 6px !important;
  transition: all 0.2s ease;
}

/* Primary Apply button color */
#edit-submit-petitions {
  background-color: #00597A !important;
  color: #FFFFFF !important;
}

/* Secondary Reset button color */
#edit-reset-petitions {
  background-color: #6c757d !important;
  color: #ffffff !important;
}

/* --- Exposed Form & Node Form Submit Buttons --- */

/* Style for both Apply (Filters) and Save (Node Form) buttons */
#edit-submit-petitions,
#edit-submit {
  background-color: #00597A !important;
  color: #FFFFFF !important;
  width: auto !important; /* Overrides bootstrap form-control full width */
  height: 38px !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  padding: 0 20px !important;
  border-radius: 6px !important;
  border: none !important;
  transition: all 0.2s ease;
}

/* Hover effects for both buttons */
#edit-submit-petitions:hover,
#edit-submit:hover {
  background-color: #004660 !important; /* Slightly darker on hover */
  cursor: pointer;
}

/* --- View Header & Summary --- */

/* Align button to the left and result summary to the right */
.view-header {
  display: flex !important;
  justify-content: space-between !important; 
  align-items: center !important;       
  width: 100%;
  margin-bottom: 15px;                   
}

/* Small styling for the results count text */
.view-header .views-result-summary {
  font-size: 0.85rem;
  color: #6c757d;
}

/* --- Table Action Icons --- */

/* Style for the edit button in the table */
.views-field-edit-node a,
table.views-table td a[href*="/edit"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 35px;
    height: 35px;
    margin: 0 auto;
    font-size: 0 !important;
    text-decoration: none !important;
    transition: background-color 0.3s ease !important; /* Smooth color transition */
    transform: none !important; /* No movement on click */
    border-radius: 50%; 
}

/* SVG Edit icon background */
.views-field-edit-node a::before,
table.views-table td a[href*="/edit"]::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300597A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transition: none !important;
    transform: none !important;
}

/* Light background highlight on hover */
.views-field-edit-node a:hover,
table.views-table td a[href*="/edit"]:hover {
    background-color: rgba(0, 89, 122, 0.12) !important;
    transform: none !important;
}

/* Slightly darker background highlight on click */
.views-field-edit-node a:active,
table.views-table td a[href*="/edit"]:active {
    background-color: rgba(0, 89, 122, 0.2) !important;
    transform: none !important;
}

/* ===== General field cleanup inside cards ===== */
.card .field {
  margin: 0;
}

.card .field__label {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6c757d; 
  margin-bottom: 0.15rem;
}

.card .field__item {
  font-size: 1rem;
  font-weight: 500;
  color: #212529;
}

.card .field__label,
.card .field__item {
  background: none !important;
  border: 0 !important;
}

.card h6 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #6c757d;
}

/* Ομοιόμορφο shadow σε όλες τις πλευρές */
.card {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1) !important;
}

/* Ή πιο έντονο */
.card {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15) !important;
}

/* Ή πιο subtle */
.card {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.08) !important;
}

/* Απόκρυψη labels από τα team member fields */
.node--type-petition .field--name-field-added-by .field__label,
.node--type-petition .field--name-field-assigner .field__label,
.node--type-petition .field--name-field-coordinator .field__label {
  display: none !important;
}

.node--type-petition .row.row-cols-1.row-cols-md-3.g-4.mb-4:last-of-type {
  margin-top: 2.5rem;
}

/* Remove link styling from field items in petition nodes */
.node--type-petition .field__item a {
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: none !important;
}

.node--type-petition .field__item a:hover {
  color: inherit !important;
  text-decoration: none !important;
}

/* Remove border from user profile images in petition */
.node--type-petition .card img.rounded-circle {
  border: none !important;
}

/* Back to Petitions button */
.btn-back-to-list {
  background-color: rgba(var(--bs-secondary-bg-rgb), var(--bs-bg-opacity)) !important;
  color: #212529 !important;
  height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 20px !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  border: 1px solid #dee2e6 !important;
  text-decoration: none !important;
  gap: 10px !important; 
  transition: background-color 0.2s ease;
}

.btn-back-to-list:hover {
  background-color: rgba(var(--bs-secondary-bg-rgb), 1) !important;
  border-color: #ced4da !important;
  color: #000 !important;
}

.btn-back-to-list svg {
  display: block;
}