/**
 * Frontend Tin Can Report Styles
 * Version 1.2.0
 */

/* Container */
.ftcr-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e1e1e;
    line-height: 1.5;
    max-width: 100%;
    margin: 0 auto;
}

/* Filters Section */
.ftcr-filters {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ftcr-filters-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.ftcr-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ftcr-filter-column {
    min-width: 0;
}

.ftcr-filter-column-title {
    font-size: 12px;
    font-weight: 600;
    color: #50575e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.ftcr-filter-group {
    margin-bottom: 12px;
}

.ftcr-filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #3c434a;
    margin-bottom: 4px;
}

.ftcr-select,
.ftcr-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #1e1e1e;
    background-color: #ffffff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ftcr-select:focus,
.ftcr-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.ftcr-select:hover,
.ftcr-input:hover {
    border-color: #2271b1;
}

.ftcr-filters-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* Buttons */
.ftcr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    border: 1px solid transparent;
}

.ftcr-btn-primary {
    background: #2271b1;
    color: #ffffff;
    border-color: #2271b1;
}

.ftcr-btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: #ffffff;
}

.ftcr-btn-secondary {
    background: #f6f7f7;
    color: #2271b1;
    border-color: #2271b1;
}

.ftcr-btn-secondary:hover {
    background: #f0f0f1;
    color: #135e96;
    border-color: #135e96;
}

.ftcr-btn-export {
    background: #f6f7f7;
    color: #3c434a;
    border-color: #8c8f94;
}

.ftcr-btn-export:hover {
    background: #f0f0f1;
    color: #1e1e1e;
    border-color: #50575e;
}

/* Report Section */
.ftcr-report-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ftcr-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.ftcr-report-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
}

/* Table Wrapper */
.ftcr-table-wrapper {
    padding: 0;
    overflow-x: auto;
}

/* DataTables Overrides */
.ftcr-container .dataTables_wrapper {
    padding: 16px 20px;
}

.ftcr-container .dataTables_length select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #ffffff;
}

.ftcr-container .dataTables_filter input {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    min-width: 200px;
}

.ftcr-container .dataTables_filter input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Table Styles */
.ftcr-table {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 13px;
}

.ftcr-table thead th {
    background: #f6f7f7;
    color: #1e1e1e;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.ftcr-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.ftcr-table tbody tr:hover {
    background-color: #f6f7f7;
}

.ftcr-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Links */
.ftcr-table a {
    color: #2271b1;
    text-decoration: none;
}

.ftcr-table a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Success/Completion indicator */
.ftcr-table td:nth-child(7) {
    text-align: center;
    font-size: 16px;
}

/* Pagination */
.ftcr-container .dataTables_paginate {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.ftcr-container .dataTables_paginate .paginate_button {
    padding: 6px 12px;
    font-size: 13px;
    margin: 0 2px;
    border-radius: 4px;
    border: 1px solid #dcdcde;
    background: #ffffff;
    color: #2271b1 !important;
    cursor: pointer;
}

.ftcr-container .dataTables_paginate .paginate_button:hover {
    background: #f6f7f7;
    border-color: #2271b1;
    color: #135e96 !important;
}

.ftcr-container .dataTables_paginate .paginate_button.current {
    background: #2271b1;
    border-color: #2271b1;
    color: #ffffff !important;
}

.ftcr-container .dataTables_paginate .paginate_button.disabled {
    color: #a7aaad !important;
    cursor: not-allowed;
}

.ftcr-container .dataTables_paginate .paginate_button.disabled:hover {
    background: #ffffff;
    border-color: #dcdcde;
}

/* Info */
.ftcr-container .dataTables_info {
    font-size: 13px;
    color: #50575e;
    padding-top: 8px;
}

/* Loading Spinner */
.ftcr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #50575e;
    font-size: 14px;
}

.ftcr-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: ftcr-spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes ftcr-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.ftcr-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 4px;
    padding: 16px 20px;
    color: #8b0000;
    font-size: 14px;
}

/* User Autocomplete */
.ftcr-autocomplete-wrap {
    position: relative;
}

.ftcr-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #8c8f94;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ftcr-autocomplete-dropdown.show {
    display: block;
}

.ftcr-autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f1;
}

.ftcr-autocomplete-item:last-child {
    border-bottom: none;
}

.ftcr-autocomplete-item:hover,
.ftcr-autocomplete-item.selected {
    background: #f0f6fc;
}

.ftcr-autocomplete-item .ftcr-user-name {
    font-weight: 500;
    color: #1e1e1e;
}

.ftcr-autocomplete-item .ftcr-user-email {
    font-size: 12px;
    color: #646970;
    margin-top: 2px;
}

.ftcr-autocomplete-loading,
.ftcr-autocomplete-empty {
    padding: 12px;
    text-align: center;
    color: #646970;
    font-size: 13px;
}

.ftcr-selected-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.ftcr-selected-user-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 4px 10px;
    font-size: 13px;
    color: #1e1e1e;
}

.ftcr-selected-user-tag .ftcr-remove-user {
    cursor: pointer;
    color: #646970;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    margin-left: 4px;
}

.ftcr-selected-user-tag .ftcr-remove-user:hover {
    color: #d63638;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .ftcr-filters-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ftcr-report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ftcr-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ftcr-table {
        min-width: 800px;
    }

    .ftcr-container .dataTables_wrapper {
        padding: 12px;
    }

    .ftcr-container .dataTables_length,
    .ftcr-container .dataTables_filter {
        text-align: left;
        float: none;
    }

    .ftcr-container .dataTables_filter input {
        min-width: 100%;
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .ftcr-filters {
        padding: 16px;
    }

    .ftcr-filters-actions {
        flex-direction: column;
    }

    .ftcr-btn {
        width: 100%;
    }
}

/* DataTables sorting icons */
.ftcr-table thead th.sorting,
.ftcr-table thead th.sorting_asc,
.ftcr-table thead th.sorting_desc {
    cursor: pointer;
    position: relative;
    padding-right: 28px;
}

.ftcr-table thead th.sorting::after,
.ftcr-table thead th.sorting_asc::after,
.ftcr-table thead th.sorting_desc::after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #8c8f94;
}

.ftcr-table thead th.sorting::after {
    content: "⇅";
}

.ftcr-table thead th.sorting_asc::after {
    content: "↑";
    color: #2271b1;
}

.ftcr-table thead th.sorting_desc::after {
    content: "↓";
    color: #2271b1;
}
