/* Custom Filter Table CSS */

.cft-container {
    width: 100%;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

/* Filter Section */
.cft-header {
    background-color: #27ae60;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cft-header > div {
    flex: 1;
    padding: 8px 0;
    font-weight: bold;
    text-transform: uppercase;
}



.cft-filter-form {
    background-color: #1a365d;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.cft-filter-cell {
    flex: 1;
    position: relative;
    width: 100%;
	padding-left: 100px;
}

.cft-filter-cell:first-child {
    padding-left: 0;
}
.cft-filter-cell:last-child{
    flex:0.3;
}



/* Select and Input Styles */
.cft-filter-cell select,
.cft-filter-cell input[type="date"] {
    width: 100%;
    padding: 8px 30px 8px 8px;
    border: none;
    border-radius: 2px;
    background-color: #1a365d;
    color: white;
    font-style: italic;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Custom dropdown arrow */
.cft-filter-cell select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 12px;
}

/* Date input styles */
.cft-filter-cell input[type="date"] {
    background-color: #1a365d;
    color: white;
}

/* Calendar icon styles */
.cft-filter-cell input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
    width: 16px;
    height: 16px;
    position: static;
    margin-left: -25px;
    vertical-align: middle;
    cursor: pointer;
}


/* Table Styles */
.cft-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.cft-results-table th {
    background-color: #f5f5f5;
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: bold;
}

.cft-results-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.cft-results-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Download Button */
.cft-download-btn {
    display: inline-flex;
    width: 30px;
    height: 30px;
    background-color: #1a365d;
    border-radius: 4px;
    text-align: center;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin: 0 auto;
}

.cft-download-btn i {
    color: white;
    font-size: 16px;
}

.cft-results-table td:last-child {
    text-align: center;
}

/* Hide rows that don't match filter */
.cft-results-table tr.hidden {
    display: none;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .cft-header,
    .cft-filter-form {
        flex-wrap: wrap;
    }
    
    .cft-header > div,
    .cft-filter-cell {
        flex: 1 1 calc(50% - 10px);
        margin-bottom: 10px;
        padding: 0 5px;
    }

    .cft-reset-btn {
        margin-left: 5px;
    }
}

@media screen and (max-width: 768px) {
    .cft-header {
        display: none;
    }
    
    .cft-filter-form {
        flex-direction: column;
        padding: 0;
        background: none;
        gap: 0;
    }
    
    .cft-filter-cell {
        margin: 0 0 15px 0;
        padding: 0;
    }
    
    /* Mobile header style for each filter section */
    .cft-filter-cell::before {
        content: attr(data-label);
        display: block;
        background-color: #27ae60;
        color: white;
        padding: 10px 15px;
        font-weight: bold;
        text-transform: uppercase;
        margin-bottom: 0;
    }
    
    /* Mobile input/select container */
    .cft-filter-cell select,
    .cft-filter-cell input[type="date"] {
        width: 100%;
        padding: 12px 35px 12px 15px;
        background-color: #1a365d;
        color: white;
        border: none;
        border-radius: 0;
        margin: 0;
        font-size: 14px;
    }

    /* Mobile calendar icon */
    .cft-filter-cell input[type="date"]::-webkit-calendar-picker-indicator {
        width: 20px;
        height: 20px;
        position: static;
        margin-left: -30px;
        vertical-align: middle;
    }
    
    /* Mobile dropdown arrow position */
    .cft-filter-cell select {
        background-position: right 15px center;
    }

    /* Table Styles for Mobile */
    .cft-results-table {
        display: block;
        width: 100%;
    }

    

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

    .cft-results-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }

    .cft-results-table td {
        text-align: left;
        padding: 12px;
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .cft-results-table td:last-child {
        text-align: center;
        padding: 12px;
    }

    .cft-results-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-bottom: 5px;
        display: block;
    }

   
    /* Mobile clear filter button */
    #cft-data-clear-filter {
        width: 100%;
        padding: 12px 15px;
        background-color: #1a365d;
        color: white;
        border: none;
        border-radius: 0;
        font-size: 14px;
    }
	.cft-download-btn {
    width: 100%;
    }

    /* Mobile calendar icon */
    .cft-filter-cell input[type="date"]::-webkit-calendar-picker-indicator {
        width: 20px;
        height: 20px;
        position: static;
        margin-left: -30px;
        vertical-align: middle;
    }

    /* Mobile dropdown arrow position */
    .cft-filter-cell select {
        background-position: right 15px center;
    }
    .cft-results-table:not(:empty) thead {
        display: none;
    }
	#cft-data-publicacao-filter,
    #cft-data-final-filter {
        width: 100%;
        margin-bottom: 10px;
    }

    .ui-datepicker {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
	.cft-filter-cell input[type="text"],
    .cft-filter-cell input[type="date"] {
        font-size: 15px;
        padding: 12px 36px 12px 15px;
        border-radius: 4px;
    }
	.cft-filter-cell : last-child{
		flex:1;
	}
}

/* No Results Message */
.cft-no-results {
    text-align: center;
    padding: 20px;
    background-color: #f9f9f9;
    color: #666;
}

/* Date input and datepicker styles */
#cft-data-publicacao-filter,
#cft-data-final-filter {
    width: 100%;
    padding: 8px 38px 8px 12px;
    border: none;
    border-radius: 6px;
    background-color: #1a365d;
    color: #fff;
    font-style: italic;
    font-size: 16px;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
    background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="5" width="18" height="16" rx="2" stroke="white" stroke-width="2" fill="none"/><rect x="7" y="2" width="2" height="4" rx="1" fill="white"/><rect x="15" y="2" width="2" height="4" rx="1" fill="white"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px 20px;
}

#cft-data-publicacao-filter::placeholder,
#cft-data-final-filter::placeholder {
    color: #fff;
    opacity: 0.7;
    font-style: italic;
}

#cft-data-publicacao-filter:focus,
#cft-data-final-filter:focus {
    outline: none;
    box-shadow: 0 0 0 2px #27ae60;
}

/* jQuery UI Datepicker customization */
.ui-datepicker {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: inherit;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ui-datepicker .ui-datepicker-header {
    background: #f8f9fa;
    border: none;
    border-radius: 4px;
    padding: 5px;
    margin-bottom: 5px;
}

.ui-datepicker .ui-datepicker-title {
    color: #333;
    font-weight: 600;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    cursor: pointer;
    top: 5px;
}

.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    border-color: #666;
}

.ui-datepicker table {
    margin: 0;
}

.ui-datepicker th {
    color: #666;
    font-weight: 600;
    padding: 5px;
}

.ui-datepicker td {
    padding: 2px;
}

.ui-datepicker td span,
.ui-datepicker td a {
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    color: #333;
    background: none;
    border: none;
}

.ui-datepicker td a:hover {
    background-color: #f0f0f0;
}

.ui-datepicker .ui-state-active {
    background-color: #007bff !important;
    color: #fff !important;
}

.ui-datepicker .ui-state-highlight {
    background-color: #e9ecef;
}



/* Clear Filter Button */
#cft-data-clear-filter {
    width: 100%;
    padding: 8px 15px;
    background-color: #1a365d;
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-style: italic;
    font-size: 14px;
}

#cft-data-clear-filter:hover {
    background-color: #2a4670;
}

.cft-filter-cell input[type="text"],
.cft-filter-cell input[type="date"] {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: none;
    border-radius: 6px;
    background-color: #1a365d;
    color: #fff;
    font-style: italic;
    font-size: 16px;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}

.cft-filter-cell input[type="text"]::placeholder,
.cft-filter-cell input[type="date"]::placeholder {
    color: #fff;
    opacity: 0.7;
    font-style: italic;
}

.cft-filter-cell input[type="text"]:focus,
.cft-filter-cell input[type="date"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px #27ae60;
}

.cft-filter-cell input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.9;
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 8px;
}

.cft-filter-cell input[type="date"]::-ms-input-placeholder {
    color: #fff;
    font-style: italic;
}

.cft-filter-cell input[type="date"]::-moz-placeholder {
    color: #fff;
    font-style: italic;
}

.cft-filter-cell input[type="date"]:-ms-input-placeholder {
    color: #fff;
    font-style: italic;
}

.cft-filter-cell input[type="date"]::-webkit-input-placeholder {
    color: #fff;
    font-style: italic;
}



