/* Frontend styles for the SYM Klippekort dashboard */
.cc-dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: Montserrat, sans-serif; /* Updated to Montserrat */
}

.cc-dashboard .dashboard-header {
    display: flex !important; /* Use flexbox for alignment */
    justify-content: space-between !important; /* Left-justify title, right-justify SVG */
    align-items: center !important; /* Vertically center the title and SVG */
    width: 100% !important; /* Ensure the h2 takes the full width of its parent */
    line-height: 1.2; /* Set a consistent line-height for the title */
}

.cc-dashboard .dashboard-logo img {
    max-height: 1.2em !important; /* Match the SVG height to the title's line-height */
    height: 1.2em; /* Set exact height */
    width: auto; /* Maintain aspect ratio */
    min-width: 20px; /* Ensure the SVG has a minimum width */
    display: block; /* Treat as block element */
    margin-right: 10px; /* Add spacing from the right edge */
}

.cc-frontend-summary {
    margin-bottom: 30px;
    border: 1px solid #ccc;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.cc-frontend-filters {
    margin: 20px 0;
    border: 1px solid #dcdcdc;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.cc-frontend-filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.cc-frontend-filters .filter-group {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.cc-frontend-filters .filter-group label {
    font-weight: 600;
    margin-bottom: 6px;
}

.cc-frontend-filters .filter-group select,
.cc-frontend-filters .filter-group input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    height: 40px;
    box-sizing: border-box;
    background-color: #fff;
}

.cc-frontend-filters .filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.cc-reset-filters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    line-height: 38px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    background: #f5f5f5;
    transition: background-color 0.2s ease;
}

.cc-reset-filters:hover {
    background: #e2e2e2;
}

.cc-frontend-summary h3 {
    margin-top: 15px!important;
    color: #333;
    display: flex !important; /* Ensure flexbox is applied */
    justify-content: space-between !important; /* Ensure space-between is applied */
    align-items: center !important; /* Vertically center the text */
    width: 100% !important; /* Ensure the h3 takes the full width of its parent */
}

.cc-frontend-summary h3 .remaining-hours {
    font-weight: bold; /* Make "Resterende timer: xx" bold */
}

.cc-frontend-summary h4 {
    margin-top: 0;
    color: #333;
}

.cc-frontend-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cc-frontend-summary li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.cc-frontend-summary li:last-child {
    border-bottom: none;
}

.cc-frontend-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 5px;
    table-layout: fixed;
}

.cc-frontend-table th,
.cc-frontend-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.cc-frontend-table th {
    background-color: #ffd319 !important; /* Bright yellow background */
    color: #222222 !important; /* Dark gray text */
    font-weight: bold;
}

.cc-frontend-table tr.year-divider {
    background-color: #e0e0e0; /* Light gray background for the divider */
    font-weight: bold;
    text-align: center; /* Center the year text */
}

.cc-frontend-table tr.year-divider.first-year {
    margin-top: 0; /* Remove extra margin for the first year divider */
}

.cc-frontend-table tr.year-divider td {
    padding: 5px; /* Reduced padding for the divider row */
    border: none; /* Remove borders for the divider row */
}

/* Column widths */
.cc-frontend-table th:nth-child(1),
.cc-frontend-table td:nth-child(1) {
    width: 120px; /* DATO */
}

.cc-frontend-table th:nth-child(2),
.cc-frontend-table td:nth-child(2) {
    width: 48%; /* OPGAVE: 60% of remaining space */
}

.cc-frontend-table th:nth-child(3),
.cc-frontend-table td:nth-child(3) {
    width: 32%; /* NOTE: 40% of remaining space */
}

.cc-frontend-table th:nth-child(4),
.cc-frontend-table td:nth-child(4) {
    width: 100px; /* TIDSFORBRUG */
}

.cc-frontend-table td.positive {
    color: green;
}

.cc-frontend-table td.negative {
    color: red;
}

.cc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    min-width: 140px;
    background-color: #ffd319;
    color: #222222;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
    height: 40px;
    font-weight: 600;
    text-decoration: none;
}

.cc-button:hover,
.cc-button:focus {
    background-color: #ffcc00;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Export Section Styles */
.cc-export-section {
    margin-top: 40px;
    border: 1px solid #ccc;
    padding: 25px;
    background: linear-gradient(to bottom, #e8ecef, #f0f0f0); /* Subtle gradient */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* More pronounced shadow */
    border-top: 4px solid #ffd319; /* Bright yellow top border */
}

.cc-export-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.5em;
}

.cc-export-section .export-controls {
    display: flex; /* Place wrappers on the same line */
    align-items: flex-start; /* Align items to the top */
    gap: 5px; /* Reduced spacing between elements to 5px */
    margin-bottom: 15px; /* Match the previous margin-bottom */
}

.cc-export-section .date-picker-wrapper {
    display: flex;
    flex-direction: column; /* Stack label above input */
    align-items: flex-start; /* Align items to the left */
}

.cc-export-section .date-picker-wrapper label {
    margin-bottom: 5px; /* Space between label and input */
    color: #333;
    font-weight: normal;
    white-space: nowrap; /* Prevent label from wrapping */
}

.cc-export-section .date-picker-wrapper input[type="text"] {
    width: 175px; /* Updated to 175px */
    padding: 5px; /* Adjusted to match button height with border */
    border: 1px solid #ddd;
    border-radius: 3px;
    height: 40px; /* Match the button height */
    box-sizing: border-box; /* Ensure padding and border are included in height */
}

.cc-export-section p {
    margin: 10px 0;
    color: #555;
    font-style: italic;
}

.cc-no-transactions {
    margin: 25px 0;
    font-style: italic;
    color: #555;
}

/* Datepicker overrides */
.cc-dashboard .ui-datepicker {
    font-family: Montserrat, sans-serif;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    margin-top: 6px;
}

.cc-dashboard .ui-datepicker .ui-datepicker-header {
    background: none;
    border: none;
    padding: 0 0 8px;
}

.cc-dashboard .ui-datepicker .ui-datepicker-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin: 0 2em; /* Match frontend inspect layout */
}

.cc-dashboard .ui-datepicker select.ui-datepicker-month,
.cc-dashboard .ui-datepicker select.ui-datepicker-year {
    display: inline-block;
    width: auto;
    min-width: 90px;
    margin: 0 4px;
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f7f7f7;
    font-size: 13px;
}

.cc-dashboard .ui-datepicker table {
    width: 100%;
    margin: 6px 0 0;
}

.cc-dashboard .ui-datepicker th {
    font-weight: 600;
    color: #666;
}

.cc-dashboard .ui-datepicker td a {
    text-align: center;
    line-height: 28px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cc-dashboard .ui-datepicker td a:hover {
    background: #ffd319;
    color: #222;
}

.cc-dashboard .ui-datepicker .ui-state-active,
.cc-dashboard .ui-datepicker .ui-state-active:hover {
    background: #ffb400;
    color: #fff;
}
