@import "../abstract/variables";

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    border: 1px solid $section-border-color;
    border-radius: 4px;
}

thead {
    background-color: $primary-color;
    color: $secondary-text-color;
}

tbody {
    color: $tertiary-text-color;
}

th,
td {
    padding: 10px;
    font-size: 14px;
    border-bottom: 1px solid $section-border-color;
}

tbody tr:hover {
    background-color: $primary-color;
}

.state {
    &.Active {
        background-color: $status-active-color;
        color: $status-active-color-text !important;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;
        white-space: nowrap;

        a {
            color: $status-active-color-text !important;
        }
    }

    &.Waiting {
        background-color: $status-pending-color;
        color: $status-pending-color-text !important;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;
        white-space: nowrap;

        a {
            color: $status-pending-color-text !important;
        }
    }

    &.Created {
        background-color: $status-pending-color;
        color: $status-pending-color-text !important;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;

        a {
            color: $status-pending-color-text !important;
        }
    }

    &.Offered {
        background-color: $status-active-color;
        color: $status-active-color-text !important;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;
        white-space: nowrap;

        a {
            color: $status-active-color-text !important;
        }
    }

    &.Closed {
        background-color: $status-closed-color;
        color: $status-closed-color-text;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;

        a {
            color: $status-closed-color-text !important;
        }
    }

    &.Approved {
        background-color: $status-paid-color;
        color: $status-paid-color-text;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;

        a {
            color: $status-paid-color-text !important;
        }
    }

    &.Rejected {
        background-color: $status-rejected-color;
        color: $status-rejected-color-text;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;

        a {
            color: $status-rejected-color-text !important;
        }
    }

    &.Pending {
        background-color: $status-pending-color;
        color: $status-pending-color-text;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;

        a {
            color: $status-pending-color-text !important;
        }
    }

    &.Error {
        background-color: $status-error-color;
        color: $status-error-color-text;
        font-weight: bold;
        width: min-content;
        padding: 6px;
        border-radius: 4px;

        a {
            color: $status-error-color-text !important;
        }
    }
}

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.pagination button {
    padding: 5px 10px;
    border: 1px solid $section-border-color;
    background-color: $primary-color;
    cursor: pointer;
}

.pagination button:disabled {
    color: $label-text-color;
    cursor: not-allowed;
}

.search-container {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
    width: 100%;

    .search-section {
        input {
            width: min-content !important;
        }
    }
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 14px;
    color: $secondary-text-color;
    ;

    button {
        padding: 6px 12px;
        border: none;
        color: $secondary-text-color;
        cursor: pointer;
        border-radius: 4px;
        margin-right: 6px;
        touch-action: manipulation;

        &:disabled {
            background-color: $disabled-color2;
            cursor: not-allowed;
        }
    }

    @media (max-width: 768px) {
        gap: 8px;
        margin: 12px;
    
        button { padding: 4px 10px;
                border-radius: 3px; }
      }
    
      @media (max-width: 480px) {
        gap: 6px;
        margin: 10px;
    
        button { padding: 2px 8px;
                 border-radius: 2px;  }
      }
}

.table-pagination {
    border-top: 0 !important;
}

@media (max-width: 768px) {
  .search-container {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    width: 100%;
  }

  table{
    table-layout: auto !important;
    border: none !important;
    
    td{
        padding: 5px !important;
    }
  }

  .hidden-mobile {
    display: none;
  }
}
