/*
Theme Name: Divi Child
Theme URI: https://dinwebbplats.se
Description: Child theme för Divi – egna anpassningar
Author: Ditt Namn
Author URI: https://dinwebbplats.se
Template: Divi
Version: 1.0.0
*/

/* ===================== */
/* GEMENSAM BAS FÖR BÅDE RAPPORTER & HÄNDELSER */
/* ===================== */

/* Gemensam container-stil */
.rapporter-container,
.handelser-container {
  /* Ingen bakgrund här - vi lägger den på inner containers */
}

.rapporter-container.simple,
.handelser-container.simple {
  background: transparent; /* Ta bort grå bakgrund */
  padding: 0;
  border-radius: 0;
}

/* Gemensam rubrik ovanför listorna */
.rapporter-container h2,
.handelser-container h2 {
  font-size: 28px;
  font-weight: 400;
  color: #333;
  margin: 0 0 30px 0;
  padding: 0;
  border: none;
  background: none;
}

/* ===================== */
/* GEMENSAMMA KORT-STILAR */
/* ===================== */

.rapport-item,
.handelse-item {
  background: #fff;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.rapport-item:hover,
.handelse-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* ===================== */
/* HEADER-LAYOUT */
/* ===================== */

.rapport-header,
.handelse-header {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  padding: 20px 25px;
  gap: 20px;
  background: #fff;
  min-height: 70px;
}

/* Datum - vänsterkolumn */
.rapport-datum,
.handelse-datum {
  font-size: 15px;
  color: #666;
  font-weight: 400;
  white-space: nowrap;
  letter-spacing: 0;
  line-height: 1.4;
}

/* Titel - mittkolumn */
.rapport-titel,
.handelse-titel {
  font-size: 20px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  color: #333 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Override för h2 när de används som titlar */
h2.rapport-titel,
h2.handelse-titel {
  font-size: 20px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Expand toggle-knapp */
.expand-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.2s;
  display: inline-flex;
  align-items: center;
  opacity: 0.6;
}

.expand-toggle:hover {
  opacity: 1;
}

.expand-toggle.expanded,
.expand-toggle[aria-expanded="true"] {
  transform: rotate(180deg);
}

.expand-toggle svg {
  width: 12px;
  height: 12px;
}

/* Actions - högerkolumn */
.rapport-actions,
.handelse-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* ===================== */
/* KNAPPAR & LÄNKAR */
/* ===================== */

/* PDF-länk för rapporter */
.pdf-link-btn,
.rapport-actions a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  color: #666;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.2s;
}

.pdf-link-btn:hover,
.rapport-actions a:hover {
  background: #f5f5f5;
  border-color: #ccc;
  color: #333;
}

/* Kalender-länkar för händelser */
.cal-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  color: #666;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.2s;
}

.cal-link:hover {
  background: #f5f5f5;
  border-color: #ccc;
  color: #333;
}

/* ===================== */
/* EXPANDERBART INNEHÅLL */
/* ===================== */

.rapport-expandable,
.handelse-expandable {
  border-top: 1px solid #e5e5e5;
  padding: 20px 25px;
  background: #fafafa;
  display: none;
}

.rapport-expandable.show,
.handelse-expandable.show {
  display: block;
}

.expandable-content {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.expandable-content p {
  margin: 0 0 10px 0;
}

.expandable-content p:last-child {
  margin-bottom: 0;
}

/* Filinfo i expanderat innehåll */
.file-info {
  font-size: 12px;
  color: #999;
  margin-top: 10px;
  font-style: italic;
}

/* ===================== */
/* "VISA FLER"-KNAPP */
/* ===================== */

.visa-fler-btn {
  display: inline-block;
  margin-top: 25px;
  padding: 12px 24px;
  background: #ff6b6b;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.visa-fler-btn:hover {
  background: #ff5252;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* ===================== */
/* AVANCERAD LISTA (UNDERSIDOR) */
/* ===================== */

.rapporter-container.advanced,
.handelser-container.advanced {
  padding: 0;
}

/* Flikar */
.handelser-tabs,
.rapporter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 2px solid #e5e5e5;
}

.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  position: relative;
  color: #666;
  transition: color 0.2s;
}

.tab-btn:hover {
  color: #333;
}

.tab-btn.active {
  color: #333;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #ff6b6b;
}

/* Filter */
.rapporter-filter,
.handelser-filter {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  padding: 15px;
  background: #f8f8f8;
  border-radius: 6px;
}

.rapporter-filter label,
.handelser-filter label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.rapporter-filter select,
.handelser-filter select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

/* Tabellvy för avancerad lista */
.rapport-row,
.handelse-row {
  display: grid;
  grid-template-columns: 110px 1fr 100px 150px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #e5e5e5;
  transition: background 0.2s;
}

.rapport-row:hover,
.handelse-row:hover {
  background: #fafafa;
}

.datum-col {
  font-size: 14px;
  color: #666;
}

.titel-col {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2.titel-col {
  margin: 0;
  font-size: 16px !important;
}

.rapport-col,
.kalender-col {
  text-align: right;
}

/* Info-toggle knapp */
.info-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.info-toggle:hover {
  opacity: 1;
}

.info-toggle svg {
  width: 16px;
  height: 16px;
  fill: #666;
}

/* Info-panel */
.rapport-info-panel,
.handelse-info-panel {
  background: #f8f8f8;
  padding: 15px 20px;
  margin: 0 0 10px 0;
  border-left: 3px solid #ff6b6b;
  display: none;
}

.rapport-info-panel p,
.handelse-info-panel p {
  margin: 0 0 10px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

/* PDF-länk i tabellvy */
.pdf-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.pdf-link:hover {
  color: #ff6b6b;
  text-decoration: underline;
}

.pdf-link .filesize {
  margin-left: 5px;
  opacity: 0.7;
  font-size: 12px;
}

/* No PDF-text */
.no-pdf {
  font-size: 13px;
  color: #999;
  font-style: italic;
}

/* ===================== */
/* RESPONSIV DESIGN */
/* ===================== */

@media (max-width: 768px) {
  .rapport-header,
  .handelse-header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px 20px;
  }
  
  .rapport-datum,
  .handelse-datum {
    font-size: 14px;
    margin-bottom: 5px;
  }
  
  .rapport-titel,
  .handelse-titel,
  h2.rapport-titel,
  h2.handelse-titel {
    font-size: 18px !important;
  }
  
  .rapport-actions,
  .handelse-actions {
    justify-content: flex-start;
    margin-top: 10px;
  }
  
  .rapport-row,
  .handelse-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 15px;
  }
  
  .datum-col {
    font-size: 13px;
    margin-bottom: 5px;
  }
  
  .rapport-col,
  .kalender-col {
    text-align: left;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .rapporter-container h2,
  .handelser-container h2 {
    font-size: 24px;
  }
  
  .visa-fler-btn {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/* ===================== */
/* FONT OPTIMIZATION (behålls från original) */
/* ===================== */

@font-face {
  font-family: "FontAwesomeWeb" !important;
  src: url("/wp-content/themes/energipartner/fonts/fontawesome-webfont.woff2?v=4.3.0") format("woff2") !important,
       url("/wp-content/themes/energipartner/fonts/fontawesome-webfont.woff?v=4.3.0") format("woff") !important;
  font-weight: normal !important;
  font-style: normal !important;
  font-display: swap !important;
}

@font-face {
  font-family: "FontAwesomeSolid900" !important;
  src: url("/wp-content/themes/Divi/core/admin/fonts/fontawesome/fa-solid-900.woff2") format("woff2") !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-display: swap !important;
}

@font-face {
  font-family: "FontAwesomeFallback" !important;
  src: local("Arial"), local("Helvetica"), sans-serif !important;
  size-adjust: 90% !important;
  ascent-override: 105% !important;
  descent-override: 35% !important;
  line-gap-override: 0% !important;
}

.fa, .fas, [class*="fa-"], .icon {
  font-family: "FontAwesomeWeb", "FontAwesomeFallback", sans-serif !important;
}

@font-face {
  font-family: "DiviModulesFont";
  src: url("/wp-content/themes/Divi/core/admin/fonts/modules/social/modules.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DiviModulesAll";
  src: url("/wp-content/themes/Divi/core/admin/fonts/modules/all/modules.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body, .fa, .fas, .et-social-icon, .divi-icon {
  font-family: "FontAwesomeWeb", "FontAwesomeSolid", "FontAwesomeFallback", sans-serif;
}

.modules-icon, .et-modules {
  font-family: "DiviModulesFont", "DiviModulesAll", sans-serif;
}

/* ===================== */
/* EXTRA STYLING FÖR KOMMANDE HÄNDELSER */
/* ===================== */

/* Röd markering för händelser som är idag */
.handelse-row[data-date="<?php echo date('Y-m-d'); ?>"] {
    border-left: 3px solid #ff6b6b;
    padding-left: 12px;
}

/* No events meddelande */
.no-events-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f8f8;
    border-radius: 8px;
    margin: 20px 0;
}

.no-events-message p {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #555;
}

.no-events-message .subdued {
    font-size: 14px;
    color: #999;
    font-style: italic;
}

/* Filter container - dold som standard */
#filter-container {
    transition: all 0.3s ease;
}

#filter-container.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Active tab indicator animation */
.tab-btn {
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.1), transparent);
    transition: left 0.5s;
}

.tab-btn:hover::before {
    left: 100%;
}

/* Förbättrad hover-effekt på rader */
.handelse-row,
.rapport-row {
    position: relative;
    transition: all 0.2s ease;
}

.handelse-row::before,
.rapport-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.2s;
}

.handelse-row:hover::before,
.rapport-row:hover::before {
    background: #ff6b6b;
}

/* Animering när innehåll laddas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active .handelse-row,
.tab-content.active .rapport-row {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

/* Stagger animation för rader */
.tab-content.active .handelse-row:nth-child(1) { animation-delay: 0.05s; }
.tab-content.active .handelse-row:nth-child(2) { animation-delay: 0.1s; }
.tab-content.active .handelse-row:nth-child(3) { animation-delay: 0.15s; }
.tab-content.active .handelse-row:nth-child(4) { animation-delay: 0.2s; }
.tab-content.active .handelse-row:nth-child(5) { animation-delay: 0.25s; }

/* Stil för aktiv info-toggle */
.info-toggle.active {
    background: #f0f0f0;
    border-radius: 50%;
}

.info-toggle.active svg {
    fill: #ff6b6b;
}

/* Loading state (om du vill implementera AJAX-laddning) */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* ===================== */
/* GRUPPERAD RAPPORTLISTA */
/* ===================== */

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

/* Filter header */
.rapporter-filter-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 150px;
    transition: all 0.2s;
}

.filter-group select:hover {
    border-color: #999;
}

.filter-group select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Årsgrupperingar */
.rapport-years-container {
    margin-top: 20px;
}

.rapport-year-group {
    margin-bottom: 40px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

/* År-header */
.year-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.year-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.pdf-column-header {
    font-size: 13px;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-right: 30px;
}

/* Rapportrader */
.year-reports {
    background: #fff;
}

.rapport-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

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

.rapport-item-row:hover {
    background: #fafafa;
}

/* Rapport innehåll */
.rapport-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rapport-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rapport-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.rapport-date {
    font-size: 13px;
    color: #999;
}

/* Info-toggle inline */
.info-toggle-inline {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
}

.info-toggle-inline:hover {
    opacity: 1;
}

.info-toggle-inline svg {
    width: 16px;
    height: 16px;
}

.info-toggle-inline svg circle {
    stroke: #999;
}

.info-toggle-inline svg text {
    fill: #999;
    font-weight: bold;
}

.info-toggle-inline:hover svg circle {
    stroke: #ff6b6b;
}

.info-toggle-inline:hover svg text {
    fill: #ff6b6b;
}

/* PDF kolumn */
.rapport-pdf {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    justify-content: flex-end;
}

.pdf-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f0f0f0;
    transition: all 0.2s;
    color: #666;
}

.pdf-icon-link:hover {
    background: #ff6b6b;
    color: white;
    transform: scale(1.1);
}

.pdf-icon-link svg {
    width: 20px;
    height: 20px;
}

.file-size {
    font-size: 11px;
    color: #999;
}

.no-pdf {
    color: #ccc;
    font-size: 18px;
}

/* Beskrivning inline */
.rapport-description-inline {
    padding: 15px 25px;
    background: #f9f9f9;
    border-left: 3px solid #ff6b6b;
    margin: 0;
    display: none;
}

.rapport-description-inline.active {
    display: block;
}

.description-content {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.description-content p {
    margin: 0 0 10px 0;
}

.description-content p:last-child {
    margin-bottom: 0;
}

/* No reports meddelande */
.no-reports-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f8f8;
    border-radius: 8px;
}

.no-reports-message p {
    font-size: 16px;
    color: #999;
    margin: 0;
}

/* Filtrering - dold klass */
.rapport-item-row.hidden {
    display: none;
}

.rapport-year-group.hidden {
    display: none;
}

/* Empty year message */
.rapport-year-group.empty-after-filter .year-reports::after {
    content: "Inga rapporter matchar filtret för detta år";
    display: block;
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* ===================== */
/* RESPONSIV DESIGN */
/* ===================== */

@media (max-width: 768px) {
    .rapporter-filter-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .year-header {
        padding: 12px 20px;
    }
    
    .year-title {
        font-size: 18px;
    }
    
    .pdf-column-header {
        display: none;
    }
    
    .rapport-item-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .rapport-content {
        gap: 3px;
    }
    
    .rapport-pdf {
        justify-content: flex-start;
    }

/* Footer Custom Styling - Child Theme */
/* Baserad på faktisk HTML-struktur */

/* Footer section bakgrund och allmän styling */
.et_pb_section_0_tb_footer.custom-footer {
    /* Lägg till eventuell bakgrundsfärg eller annan styling här */
}

/* Footer rubrik styling (h4) */
.et_pb_section_0_tb_footer.custom-footer h4,
.custom-footer .et_pb_text_inner h4 {
    font-size: 18px !important;
    color: #fff !important;
    margin-bottom: 12px !important;
    font-weight: bold !important;
}

/* Footer navigation lista (första kolumnen) */
.custom-footer .et_pb_text_inner ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.custom-footer .et_pb_text_inner ul li {
    margin: 4px 0 !important;
    padding: 0 !important;
}

/* Footer länkar - överskrider ET Core's generella a {} regel */
.et_pb_section_0_tb_footer.custom-footer a,
.custom-footer .et_pb_text_inner a,
.custom-footer .et_pb_text_inner ul li a {
    color: #ddd !important;
    text-decoration: none !important;
}

/* Footer länkar hover */
.et_pb_section_0_tb_footer.custom-footer a:hover,
.custom-footer .et_pb_text_inner a:hover,
.custom-footer .et_pb_text_inner ul li a:hover {
    color: #ff6b6b !important;
}

/* Kontakt paragraf styling */
.custom-footer .et_pb_text_inner p {
    color: #ddd !important;
    margin: 8px 0 !important;
}

/* Social media ikoner om du vill styla dem */
.custom-footer .et_pb_social_media_follow .et_pb_social_icon a {
    background-color: transparent !important;
    border-color: #ddd !important;
}

.custom-footer .et_pb_social_media_follow .et_pb_social_icon a:hover {
    border-color: #ff6b6b !important;
    background-color: #ff6b6b !important;
}
